void-packages/srcpkgs/pax/template

51 lines
1.4 KiB
Bash

# Template file for 'pax'
pkgname=pax
version=20171021
revision=2
wrksrc="paxmirabilis-${version}"
build_wrksrc="${pkgname}"
hostmakedepends="cpio bmake groff"
short_desc="POSIX archiving utility pax from MirOS (plus tar and cpio)"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="3-clause-BSD"
homepage="https://www.mirbsd.org/MirOS/dist/mir/cpio/"
distfiles="https://www.mirbsd.org/MirOS/dist/mir/cpio/paxmirabilis-${version}.cpio.gz"
checksum=fd45cb42524ae94b5105588bb6bce347e731703740197cb9d933065f27006382
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 LDADD="-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
sed -i 's/__GLIBC__/__linux__/g' ${build_wrksrc}/cache.c
case "$XBPS_TARGET_MACHINE" in
i686-musl|arm*-musl|mips*-musl) # 32bit-platforms
sed -i 's/-DLONG_OFF_T//' ${build_wrksrc}/Makefile
esac
}
do_build() {
bmake ${makejobs} MACHINE_OS=Linux \
CC="${CC}" CFLAGS="${CFLAGS} -DGNU_SOURCE" LDFLAGS="${LDFLAGS}"
}
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
}