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 \ |
| 18 | " |
| 19 | |
| 20 | # for this package we're mostly interested in tracking debian patches, |
| 21 | # and not in the upstream version where all development has effectively stopped |
| 22 | UPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 23 | |
| 24 | S = "${WORKDIR}/net-tools-1.60" |
| 25 | |
| 26 | SRC_URI[tarball.md5sum] = "ecaf37acb5b5daff4bdda77785fd916d" |
| 27 | SRC_URI[tarball.sha256sum] = "ec67967cf7b1a3a3828a84762fbc013ac50ee5dc9aa3095d5c591f302c2de0f5" |
| 28 | |
| 29 | SRC_URI[patch.md5sum] = "ea3592f49ac8380962bc4d9b66c7e7e9" |
| 30 | SRC_URI[patch.sha256sum] = "aeeeafaff68866a446f01bb639d4e0146a60af34dcd20e31a3e46585022fc76c" |
| 31 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 32 | # the package is taken from snapshots.debian.org; that source is static and goes stale |
| 33 | # so we check the latest upstream from a directory that does get updated |
| 34 | UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/net-tools/" |
| 35 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 36 | inherit gettext |
| 37 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 38 | do_patch[depends] = "quilt-native:do_populate_sysroot" |
| 39 | |
| 40 | LDFLAGS_append_libc-uclibc = " -lintl " |
| 41 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 42 | # The Makefile is lame, no parallel build |
| 43 | PARALLEL_MAKE = "" |
| 44 | |
| 45 | # Unlike other Debian packages, net-tools *.diff.gz contains another series of |
| 46 | # patches maintained by quilt. So manually apply them before applying other local |
| 47 | # patches. Also remove all temp files before leaving, because do_patch() will pop |
| 48 | # up all previously applied patches in the start |
| 49 | nettools_do_patch() { |
| 50 | cd ${S} |
| 51 | quilt pop -a || true |
| 52 | if [ -d ${S}/.pc-nettools ]; then |
| 53 | rm -rf ${S}/.pc |
| 54 | mv ${S}/.pc-nettools ${S}/.pc |
| 55 | QUILT_PATCHES=${S}/debian/patches quilt pop -a |
| 56 | rm -rf ${S}/.pc ${S}/debian |
| 57 | fi |
| 58 | patch -p1 < ${WORKDIR}/${BPN}_${PV}.diff |
| 59 | QUILT_PATCHES=${S}/debian/patches quilt push -a |
| 60 | mv ${S}/.pc ${S}/.pc-nettools |
| 61 | } |
| 62 | |
| 63 | do_unpack[cleandirs] += "${S}" |
| 64 | |
| 65 | # We invoke base do_patch at end, to incorporate any local patch |
| 66 | python do_patch() { |
| 67 | bb.build.exec_func('nettools_do_patch', d) |
| 68 | bb.build.exec_func('patch_do_patch', d) |
| 69 | } |
| 70 | |
| 71 | do_configure() { |
| 72 | # net-tools has its own config mechanism requiring "make config" |
| 73 | # we pre-generate desired options and copy to source directory instead |
| 74 | cp ${WORKDIR}/net-tools-config.h ${S}/config.h |
| 75 | cp ${WORKDIR}/net-tools-config.make ${S}/config.make |
| 76 | } |
| 77 | |
| 78 | do_compile() { |
| 79 | # net-tools use COPTS/LOPTS to allow adding custom options |
| 80 | export COPTS="$CFLAGS" |
| 81 | export LOPTS="$LDFLAGS" |
| 82 | unset CFLAGS |
| 83 | unset LDFLAGS |
| 84 | |
| 85 | oe_runmake |
| 86 | } |
| 87 | |
| 88 | do_install() { |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 89 | export COPTS="$CFLAGS" |
| 90 | export LOPTS="$LDFLAGS" |
| 91 | unset CFLAGS |
| 92 | unset LDFLAGS |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 93 | oe_runmake 'BASEDIR=${D}' install |
| 94 | } |
| 95 | |
| 96 | inherit update-alternatives |
| 97 | |
| 98 | base_sbindir_progs = "arp ifconfig ipmaddr iptunnel mii-tool nameif plipconfig rarp route slattach" |
| 99 | base_bindir_progs = "dnsdomainname domainname hostname netstat nisdomainname ypdomainname" |
| 100 | |
| 101 | ALTERNATIVE_${PN} = "${base_sbindir_progs} ${base_bindir_progs}" |
| 102 | python __anonymous() { |
| 103 | for prog in d.getVar('base_sbindir_progs', True).split(): |
| 104 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir', True), prog)) |
| 105 | for prog in d.getVar('base_bindir_progs', True).split(): |
| 106 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog)) |
| 107 | } |
| 108 | ALTERNATIVE_PRIORITY = "100" |
| 109 | |