blob: b3adfd57afa1f29012115f3463ac4fe78ba90f00 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001SUMMARY = "LiSt Open Files tool"
2DESCRIPTION = "Lsof is a Unix-specific diagnostic tool. \
3Its name stands for LiSt Open Files, and it does just that."
4HOMEPAGE = "http://people.freebsd.org/~abe/"
5SECTION = "devel"
6LICENSE = "BSD"
7LIC_FILES_CHKSUM = "file://00README;beginline=645;endline=679;md5=964df275d26429ba3b39dbb9f205172a"
8
9# Upstream lsof releases are hosted on an ftp server which times out download
10# attempts from hosts for which it can not perform a DNS reverse-lookup (See:
11# https://people.freebsd.org/~abe/ ). http://www.mirrorservice.org seems to be
12# the most commonly used alternative.
13
14SRC_URI = "http://www.mirrorservice.org/sites/lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_${PV}.tar.bz2 \
15 file://lsof-remove-host-information.patch \
16 "
17
18SRC_URI[md5sum] = "148ed410cb52e08c2adc0c60f480f11f"
19SRC_URI[sha256sum] = "c9da946a525fbf82ff80090b6d1879c38df090556f3fe0e6d782cb44172450a3"
20
21LOCALSRC = "file://${WORKDIR}/lsof_${PV}/lsof_${PV}_src.tar"
22
23S = "${WORKDIR}/lsof_${PV}_src"
24
25python do_unpack () {
26 if not bb.data.inherits_class('externalsrc', d) or not d.getVar('EXTERNALSRC'):
27 # temporarily change S for unpack of lsof_${PV}
28 s = d.getVar('S', False)
29 d.setVar('S', '${WORKDIR}/lsof_${PV}')
30 bb.build.exec_func('base_do_unpack', d)
31 # temporarily change SRC_URI for unpack of lsof_${PV}_src
32 src_uri = d.getVar('SRC_URI', False)
33 d.setVar('SRC_URI', '${LOCALSRC}')
34 d.setVar('S', s)
35 bb.build.exec_func('base_do_unpack', d)
36 d.setVar('SRC_URI', src_uri)
37}
38
39export LSOF_INCLUDE = "${STAGING_INCDIR}"
40
41do_configure () {
42 export LSOF_AR="${AR} cr"
43 export LSOF_RANLIB="${RANLIB}"
44 if [ "x${GLIBCVERSION}" != "x" ]; then
45 LINUX_CLIB=`echo ${GLIBCVERSION} |sed -e 's,\.,,g'`
46 LINUX_CLIB="-DGLIBCV=${LINUX_CLIB}"
47 export LINUX_CLIB
48 fi
49 yes | ./Configure linux
50}
51
52export I = "${STAGING_INCDIR}"
53export L = "${STAGING_INCDIR}"
54
55do_compile () {
56 oe_runmake 'CC=${CC}' 'CFGL=${LDFLAGS} -L./lib -llsof' 'DEBUG=' 'INCL=${CFLAGS}'
57}
58
59do_install () {
60 install -d ${D}${sbindir} ${D}${mandir}/man8
61 install -m 0755 lsof ${D}${sbindir}/lsof
62 install -m 0644 lsof.8 ${D}${mandir}/man8/lsof.8
63}