void-packages/srcpkgs/pax/template
Đoàn Trần Công Danh 49cb564d14 srcpkgs/p*: convert patches to -Np1
* par is kept at -Np0

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

45 lines
1.2 KiB
Bash

# Template file for 'pax'
pkgname=pax
version=20201030
revision=1
wrksrc="paxmirabilis-${version}"
build_wrksrc="${pkgname}"
hostmakedepends="cpio"
short_desc="POSIX archiving utility pax from MirOS (plus tar and cpio)"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="BSD-3-Clause"
homepage="https://www.mirbsd.org/MirOS/dist/mir/cpio/"
distfiles="https://www.mirbsd.org/MirOS/dist/mir/cpio/paxmirabilis-${version}.cpio.gz"
checksum=fe3f99c28ba7a46c4bce0b329da3742908b87fe8fbe17f0db1f99a1bd053d46b
alternatives="
pax:pax:/usr/bin/paxmirabilis
pax:pax.1:/usr/share/man/man1/paxmirabilis.1
"
case "$XBPS_TARGET_MACHINE" in
*-musl)
makedepends+=" musl-fts-devel"
export LIBS="-lfts"
esac
do_extract() {
zcat ${XBPS_SRCDISTDIR}/${pkgname}-${version}/paxmirabilis-${version}.cpio.gz | cpio -mid
sed -i '1i#include <sys/types.h>' ${build_wrksrc}/pax.h
}
do_build() {
TARGET_OS=Linux CC="${CC}" CFLAGS="${CFLAGS} -DGNU_SOURCE" \
LDFLAGS="${LDFLAGS}" sh ./Build.sh -r
}
do_install() {
vbin pax paxmirabilis
ln -s paxmirabilis ${DESTDIR}/usr/bin/paxtar
ln -s paxmirabilis ${DESTDIR}/usr/bin/paxcpio
vman pax.1 paxmirabilis.1
vman tar.1 paxtar.1
vman cpio.1 paxcpio.1
head -n37 pax.c >LICENSE
vlicense LICENSE
}