void-packages/srcpkgs/lsof/template

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
}