void-packages/srcpkgs/lsof/template
Piraty 600756641c lsof: cleanup template
* use build-style
* rename Lsof.8 -> lsof.8 to match the binary's name
* make tests run
* get license text from sources, don't ship it
2020-03-30 18:24:36 +02:00

49 lines
1.2 KiB
Bash

# Template file for 'lsof'
pkgname=lsof
version=4.93.2
revision=2
build_style=configure
configure_script="./Configure"
configure_args="-n linux"
hostmakedepends="perl which"
short_desc="LiSt Open Files"
maintainer="Orphaned <orphan@voidlinux.org>"
license="custom:lsof"
homepage="https://people.freebsd.org/~abe/"
distfiles="https://fossies.org/linux/misc/lsof-${version}.tar.gz"
checksum=3df912bd966fc24dc73ddea3e36a61d79270b21b085936a4caabca56e5b486a2
pre_configure() {
export LSOF_CC="$CC"
export LSOF_CFGF="$CFLAGS"
export LSOF_CFGL="$LDFLAGS"
export LSOF_INCLUDE="${XBPS_CROSS_BASE}/usr/include"
vsed "s|/\* #define\tHASSECURITY\t1 \*/|#define\tHASSECURITY\t1|" \
-i dialects/linux/machine.h
}
pre_check() {
# test resolves hostname
cp /etc/hosts ./hosts
printf '# +++ xbps-src +++ required for lsof tests\n127.0.0.100 %s\n' "$(hostname)" >> /etc/hosts
# write current config to test db
cd tests && ./Add2TestDB
}
do_check() {
make -C tests
}
post_check() {
# cleanup polluted hosts file
mv ./hosts /etc/hosts
}
do_install() {
vbin lsof
vman Lsof.8 lsof.8
# extract license from readme
sed -n 00README -e '/^License/,/\*\/$/p' > License
vlicense License
}