Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Basic networking tools" |
| 2 | DESCRIPTION = "A collection of programs that form the base set of the NET-3 networking distribution for the Linux operating system" |
| 3 | HOMEPAGE = "http://net-tools.berlios.de/" |
| 4 | BUGTRACKER = "http://bugs.debian.org/net-tools" |
| 5 | LICENSE = "GPLv2+" |
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ |
| 7 | file://ifconfig.c;beginline=11;endline=15;md5=d1ca372080ad5401e23ca0afc35cf9ba" |
| 8 | |
| 9 | SRC_URI = "http://snapshot.debian.org/archive/debian/20050312T000000Z/pool/main/n/${BPN}/${BPN}_1.60.orig.tar.gz;name=tarball \ |
| 10 | http://snapshot.debian.org/archive/debian//20150831T093342Z/pool/main/n/${BPN}/${BPN}_${PV}.diff.gz;apply=no;name=patch \ |
| 11 | file://net-tools-config.h \ |
| 12 | file://net-tools-config.make \ |
| 13 | file://ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 14 | file://musl-fixes.patch \ |
| 15 | file://net-tools-1.60-sctp1.patch \ |
| 16 | file://net-tools-1.60-sctp2-quiet.patch \ |
| 17 | file://net-tools-1.60-sctp3-addrs.patch \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 18 | file://0001-lib-inet6.c-INET6_rresolve-various-fixes.patch \ |
| 19 | file://net-tools-fix-building-with-linux-4.8.patch \ |
Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 20 | file://0001-added-ull-prefix-to-unsigned-long-long-constants-to-.patch \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 21 | " |
| 22 | |
| 23 | # for this package we're mostly interested in tracking debian patches, |
| 24 | # and not in the upstream version where all development has effectively stopped |
| 25 | UPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | |
| 27 | S = "${WORKDIR}/net-tools-1.60" |
| 28 | |
| 29 | SRC_URI[tarball.md5sum] = "ecaf37acb5b5daff4bdda77785fd916d" |
| 30 | SRC_URI[tarball.sha256sum] = "ec67967cf7b1a3a3828a84762fbc013ac50ee5dc9aa3095d5c591f302c2de0f5" |
| 31 | |
| 32 | SRC_URI[patch.md5sum] = "ea3592f49ac8380962bc4d9b66c7e7e9" |
| 33 | SRC_URI[patch.sha256sum] = "aeeeafaff68866a446f01bb639d4e0146a60af34dcd20e31a3e46585022fc76c" |
| 34 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 35 | # the package is taken from snapshots.debian.org; that source is static and goes stale |
| 36 | # so we check the latest upstream from a directory that does get updated |
| 37 | UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/net-tools/" |
| 38 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 39 | inherit gettext |
| 40 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 41 | do_patch[depends] += "quilt-native:do_populate_sysroot" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 42 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 43 | # The Makefile is lame, no parallel build |
| 44 | PARALLEL_MAKE = "" |
| 45 | |
| 46 | # Unlike other Debian packages, net-tools *.diff.gz contains another series of |
| 47 | # patches maintained by quilt. So manually apply them before applying other local |
| 48 | # patches. Also remove all temp files before leaving, because do_patch() will pop |
| 49 | # up all previously applied patches in the start |
| 50 | nettools_do_patch() { |
| 51 | cd ${S} |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 52 | # it's important that we only pop the existing patches when they've |
| 53 | # been applied, otherwise quilt will climb the directory tree |
| 54 | # and reverse out some completely different set of patches |
| 55 | if [ -d ${S}/patches ]; then |
| 56 | # whilst this is the default directory, doing it like this |
| 57 | # defeats the directory climbing that quilt will otherwise |
| 58 | # do; note the directory must exist to defeat this, hence |
| 59 | # the test inside which we operate |
| 60 | QUILT_PATCHES=${S}/patches quilt pop -a |
| 61 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 62 | if [ -d ${S}/.pc-nettools ]; then |
| 63 | rm -rf ${S}/.pc |
| 64 | mv ${S}/.pc-nettools ${S}/.pc |
| 65 | QUILT_PATCHES=${S}/debian/patches quilt pop -a |
| 66 | rm -rf ${S}/.pc ${S}/debian |
| 67 | fi |
| 68 | patch -p1 < ${WORKDIR}/${BPN}_${PV}.diff |
| 69 | QUILT_PATCHES=${S}/debian/patches quilt push -a |
| 70 | mv ${S}/.pc ${S}/.pc-nettools |
| 71 | } |
| 72 | |
| 73 | do_unpack[cleandirs] += "${S}" |
| 74 | |
| 75 | # We invoke base do_patch at end, to incorporate any local patch |
| 76 | python do_patch() { |
| 77 | bb.build.exec_func('nettools_do_patch', d) |
| 78 | bb.build.exec_func('patch_do_patch', d) |
| 79 | } |
| 80 | |
| 81 | do_configure() { |
| 82 | # net-tools has its own config mechanism requiring "make config" |
| 83 | # we pre-generate desired options and copy to source directory instead |
| 84 | cp ${WORKDIR}/net-tools-config.h ${S}/config.h |
| 85 | cp ${WORKDIR}/net-tools-config.make ${S}/config.make |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 86 | |
| 87 | if [ "${USE_NLS}" = "no" ]; then |
| 88 | sed -i -e 's/^I18N=1/# I18N=1/' ${S}/config.make |
| 89 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | do_compile() { |
| 93 | # net-tools use COPTS/LOPTS to allow adding custom options |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 94 | oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | do_install() { |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 98 | # We don't need COPTS or LOPTS, but let's be consistent. |
Brad Bishop | 00e122a | 2019-10-05 11:10:57 -0400 | [diff] [blame] | 99 | oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS" BASEDIR=${D} INSTALLNLSDIR=${D}${datadir}/locale mandir=${mandir} install |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 100 | |
| 101 | if [ "${base_bindir}" != "/bin" ]; then |
| 102 | mkdir -p ${D}/${base_bindir} |
| 103 | mv ${D}/bin/* ${D}/${base_bindir}/ |
| 104 | rmdir ${D}/bin |
| 105 | fi |
| 106 | if [ "${base_sbindir}" != "/sbin" ]; then |
| 107 | mkdir ${D}/${base_sbindir} |
| 108 | mv ${D}/sbin/* ${D}/${base_sbindir}/ |
| 109 | rmdir ${D}/sbin |
| 110 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 111 | } |
| 112 | |
| 113 | inherit update-alternatives |
| 114 | |
| 115 | base_sbindir_progs = "arp ifconfig ipmaddr iptunnel mii-tool nameif plipconfig rarp route slattach" |
| 116 | base_bindir_progs = "dnsdomainname domainname hostname netstat nisdomainname ypdomainname" |
| 117 | |
| 118 | ALTERNATIVE_${PN} = "${base_sbindir_progs} ${base_bindir_progs}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 119 | ALTERNATIVE_${PN}-doc += "hostname.1 dnsdomainname.1" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 120 | ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 121 | ALTERNATIVE_LINK_NAME[dnsdomainname.1] = "${mandir}/man1/dnsdomainname.1" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 122 | ALTERNATIVE_PRIORITY[hostname.1] = "10" |
| 123 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 124 | python __anonymous() { |
Brad Bishop | a5c52ff | 2018-11-23 10:55:50 +1300 | [diff] [blame] | 125 | for prog in d.getVar('base_sbindir_progs').split(): |
| 126 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog)) |
| 127 | for prog in d.getVar('base_bindir_progs').split(): |
| 128 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog)) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 129 | } |
| 130 | ALTERNATIVE_PRIORITY = "100" |
| 131 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 132 | BBCLASSEXTEND = "native nativesdk" |