blob: 9b7de9aadc3cb2c1536e81ce0dcb1167d6174bb2 [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."
4SECTION = "devel"
5LICENSE = "BSD"
6
7SRC_URI = "ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_${PV}.tar.bz2"
8
9SRC_URI[md5sum] = "1b9cd34f3fb86856a125abbf2be3a386"
10SRC_URI[sha256sum] = "81ac2fc5fdc944793baf41a14002b6deb5a29096b387744e28f8c30a360a3718"
11
12LOCALSRC = "file://${WORKDIR}/lsof_${PV}/lsof_${PV}_src.tar"
13S = "${WORKDIR}/lsof_${PV}_src"
14
15LIC_FILES_CHKSUM = "file://${S}/00README;beginline=645;endline=679;md5=964df275d26429ba3b39dbb9f205172a"
16
17python do_unpack () {
18 # temporarily change S for unpack
19 # of lsof_${PV}
20 s = d.getVar('S', False)
21 d.setVar('S', '${WORKDIR}/lsof_${PV}')
22 bb.build.exec_func('base_do_unpack', d)
23 # temporarily change SRC_URI for unpack
24 # of lsof_${PV}_src
25 src_uri = d.getVar('SRC_URI', False)
26 d.setVar('SRC_URI', '${LOCALSRC}')
27 d.setVar('S', s)
28 bb.build.exec_func('base_do_unpack', d)
29 d.setVar('SRC_URI', src_uri)
30}
31
32export LSOF_INCLUDE = "${STAGING_INCDIR}"
33
34do_configure () {
35 export LSOF_AR="${AR} cr"
36 export LSOF_RANLIB="${RANLIB}"
37 if [ "x${GLIBCVERSION}" != "x" ];then
38 LINUX_CLIB=`echo ${GLIBCVERSION} |sed -e 's,\.,,g'`
39 LINUX_CLIB="-DGLIBCV=${LINUX_CLIB}"
40 export LINUX_CLIB
41 fi
42 yes | ./Configure linux
43}
44
45export I = "${STAGING_INCDIR}"
46export L = "${STAGING_INCDIR}"
47export EXTRA_OEMAKE = ""
48
49do_compile () {
50 oe_runmake 'CC=${CC}' 'CFGL=${LDFLAGS} -L./lib -llsof' 'DEBUG=' 'INCL=${CFLAGS}'
51}
52
53do_install () {
54 install -d ${D}${sbindir} ${D}${mandir}/man8
55 install -m 4755 lsof ${D}${sbindir}/lsof
56 install -m 0644 lsof.8 ${D}${mandir}/man8/lsof.8
57}