diff --git a/srcpkgs/lsof/files/license.txt b/srcpkgs/lsof/files/license.txt deleted file mode 100644 index 6d241ddbfe1..00000000000 --- a/srcpkgs/lsof/files/license.txt +++ /dev/null @@ -1,27 +0,0 @@ -Copyright 2002 Purdue Research Foundation, West Lafayette, -Indiana 47907. All rights reserved. - -Written by Victor A. Abell - -This software is not subject to any license of the American -Telephone and Telegraph Company or the Regents of the -University of California. - -Permission is granted to anyone to use this software for -any purpose on any computer system, and to alter it and -redistribute it freely, subject to the following -restrictions: - -1. Neither the authors nor Purdue University are responsible - for any consequences of the use of this software. - -2. The origin of this software must not be misrepresented, - either by explicit claim or by omission. Credit to the - authors and Purdue University must appear in documentation - and sources. - -3. Altered versions must be plainly marked as such, and must - not be misrepresented as being the original software. - -4. This notice may not be removed or altered. - diff --git a/srcpkgs/lsof/template b/srcpkgs/lsof/template index 027af62ac00..2d12a9c7471 100644 --- a/srcpkgs/lsof/template +++ b/srcpkgs/lsof/template @@ -1,26 +1,48 @@ # Template file for 'lsof' pkgname=lsof version=4.93.2 -revision=1 -hostmakedepends="perl" +revision=2 +build_style=configure +configure_script="./Configure" +configure_args="-n linux" +hostmakedepends="perl which" short_desc="LiSt Open Files" maintainer="Orphaned " -license="lsof" +license="custom:lsof" homepage="https://people.freebsd.org/~abe/" distfiles="https://fossies.org/linux/misc/lsof-${version}.tar.gz" checksum=3df912bd966fc24dc73ddea3e36a61d79270b21b085936a4caabca56e5b486a2 -do_build() { - sed "s|/\* #define\tHASSECURITY\t1 \*/|#define\tHASSECURITY\t1|" \ +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 - if [ "$CROSS_BUILD" ]; then - export LSOF_INCLUDE="${XBPS_CROSS_BASE}/usr/include" - fi - LSOF_CFGF="$CFLAGS" LSOF_CFGL="$LDFLAGS" ./Configure -n linux - make CC=$CC ${makejobs} } + +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 - vlicense ${FILESDIR}/license.txt + vman Lsof.8 lsof.8 + + # extract license from readme + sed -n 00README -e '/^License/,/\*\/$/p' > License + vlicense License }