blob: 14546db23cda275c296b9115599c165a2b5bc3da [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "LiSt Open Files tool"
2DESCRIPTION = "Lsof is a Unix-specific diagnostic tool. \
3Its name stands for LiSt Open Files, and it does just that."
Brad Bishop37a0e4d2017-12-04 01:01:44 -05004HOMEPAGE = "http://people.freebsd.org/~abe/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005SECTION = "devel"
6LICENSE = "BSD"
Brad Bishop37a0e4d2017-12-04 01:01:44 -05007LIC_FILES_CHKSUM = "file://00README;beginline=645;endline=679;md5=964df275d26429ba3b39dbb9f205172a"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05008
Brad Bishop37a0e4d2017-12-04 01:01:44 -05009# 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
Brad Bishopd7bf8c12018-02-25 22:55:05 -050014SRC_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 "
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017
18SRC_URI[md5sum] = "1b9cd34f3fb86856a125abbf2be3a386"
19SRC_URI[sha256sum] = "81ac2fc5fdc944793baf41a14002b6deb5a29096b387744e28f8c30a360a3718"
20
21LOCALSRC = "file://${WORKDIR}/lsof_${PV}/lsof_${PV}_src.tar"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050022
Brad Bishop37a0e4d2017-12-04 01:01:44 -050023S = "${WORKDIR}/lsof_${PV}_src"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050024
25python do_unpack () {
26 # temporarily change S for unpack
27 # 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
32 # of lsof_${PV}_src
33 src_uri = d.getVar('SRC_URI', False)
34 d.setVar('SRC_URI', '${LOCALSRC}')
35 d.setVar('S', s)
36 bb.build.exec_func('base_do_unpack', d)
37 d.setVar('SRC_URI', src_uri)
38}
39
40export LSOF_INCLUDE = "${STAGING_INCDIR}"
41
42do_configure () {
43 export LSOF_AR="${AR} cr"
44 export LSOF_RANLIB="${RANLIB}"
Brad Bishop37a0e4d2017-12-04 01:01:44 -050045 if [ "x${GLIBCVERSION}" != "x" ]; then
46 LINUX_CLIB=`echo ${GLIBCVERSION} |sed -e 's,\.,,g'`
47 LINUX_CLIB="-DGLIBCV=${LINUX_CLIB}"
48 export LINUX_CLIB
49 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050050 yes | ./Configure linux
51}
52
53export I = "${STAGING_INCDIR}"
54export L = "${STAGING_INCDIR}"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050055
Patrick Williamsc124f4f2015-09-15 14:41:29 -050056do_compile () {
57 oe_runmake 'CC=${CC}' 'CFGL=${LDFLAGS} -L./lib -llsof' 'DEBUG=' 'INCL=${CFLAGS}'
58}
59
60do_install () {
61 install -d ${D}${sbindir} ${D}${mandir}/man8
Brad Bishop37a0e4d2017-12-04 01:01:44 -050062 install -m 0755 lsof ${D}${sbindir}/lsof
Patrick Williamsc124f4f2015-09-15 14:41:29 -050063 install -m 0644 lsof.8 ${D}${mandir}/man8/lsof.8
64}