Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -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=b234ee4d69f5fce4486a80fdaf4a4263 \ |
| 7 | file://ifconfig.c;beginline=11;endline=15;md5=d1ca372080ad5401e23ca0afc35cf9ba" |
| 8 | |
| 9 | PV = "1.60-20181103+git${SRCPV}" |
| 10 | SRCREV = "0eebece8c964e3cfa8a018f42b2e7e751a7009a0" |
| 11 | SRC_URI = "git://git.code.sf.net/p/net-tools/code;protocol=https \ |
| 12 | file://net-tools-config.h \ |
| 13 | file://net-tools-config.make \ |
| 14 | file://Add_missing_headers.patch \ |
| 15 | file://Bug_443075-ifconfig.c-pointtopoint_spelling.patch \ |
| 16 | file://Bug_541172-netstat.c-exit-codes.patch \ |
| 17 | " |
| 18 | |
| 19 | UPSTREAM_VERSION_UNKNOWN = "1" |
| 20 | |
| 21 | S = "${WORKDIR}/git" |
| 22 | |
| 23 | inherit gettext |
| 24 | |
| 25 | # The Makefile is lame, no parallel build |
| 26 | PARALLEL_MAKE = "" |
| 27 | |
| 28 | PACKAGECONFIG ??= "hostname arp serial plip" |
| 29 | PACKAGECONFIG[hostname] = "" |
| 30 | PACKAGECONFIG[arp] = "" |
| 31 | PACKAGECONFIG[serial] = "" |
| 32 | PACKAGECONFIG[plip] = "" |
| 33 | |
| 34 | do_configure() { |
| 35 | # net-tools has its own config mechanism requiring "make config" |
| 36 | # we pre-generate desired options and copy to source directory instead |
| 37 | cp ${WORKDIR}/net-tools-config.h ${S}/config.h |
| 38 | cp ${WORKDIR}/net-tools-config.make ${S}/config.make |
| 39 | |
| 40 | if [ "${USE_NLS}" = "no" ]; then |
| 41 | sed -i -e 's/^I18N=1/# I18N=1/' ${S}/config.make |
| 42 | fi |
| 43 | |
| 44 | if ${@bb.utils.contains('PACKAGECONFIG', 'hostname', 'true', 'false', d)} ; then |
| 45 | echo "#define HAVE_HOSTNAME_TOOLS 1" >> ${S}/config.h |
| 46 | echo "#define HAVE_HOSTNAME_SYMLINKS 1" >> ${S}/config.h |
| 47 | echo "HAVE_HOSTNAME_TOOLS=1" >> ${S}/config.make |
| 48 | echo "HAVE_HOSTNAME_SYMLINKS=1" >> ${S}/config.make |
| 49 | fi |
| 50 | if ${@bb.utils.contains('PACKAGECONFIG', 'arp', 'true', 'false', d)} ; then |
| 51 | echo "#define HAVE_ARP_TOOLS 1" >> ${S}/config.h |
| 52 | echo "HAVE_ARP_TOOLS=1" >> ${S}/config.make |
| 53 | fi |
| 54 | if ${@bb.utils.contains('PACKAGECONFIG', 'serial', 'true', 'false', d)} ; then |
| 55 | echo "#define HAVE_SERIAL_TOOLS 1" >> ${S}/config.h |
| 56 | echo "HAVE_SERIAL_TOOLS=1" >> ${S}/config.make |
| 57 | fi |
| 58 | if ${@bb.utils.contains('PACKAGECONFIG', 'plip', 'true', 'false', d)} ; then |
| 59 | echo "#define HAVE_PLIP_TOOLS 1" >> ${S}/config.h |
| 60 | echo "HAVE_PLIP_TOOLS=1" >> ${S}/config.make |
| 61 | fi |
| 62 | } |
| 63 | |
| 64 | do_compile() { |
| 65 | # net-tools use COPTS/LOPTS to allow adding custom options |
| 66 | oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS" |
| 67 | } |
| 68 | |
| 69 | do_install() { |
| 70 | # We don't need COPTS or LOPTS, but let's be consistent. |
| 71 | oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS" BASEDIR=${D} INSTALLNLSDIR=${D}${datadir}/locale mandir=${mandir} install |
| 72 | |
| 73 | if [ "${base_bindir}" != "/bin" ]; then |
| 74 | mkdir -p ${D}/${base_bindir} |
| 75 | mv ${D}/bin/* ${D}/${base_bindir}/ |
| 76 | rmdir ${D}/bin |
| 77 | fi |
| 78 | if [ "${base_sbindir}" != "/sbin" ]; then |
| 79 | mkdir ${D}/${base_sbindir} |
| 80 | mv ${D}/sbin/* ${D}/${base_sbindir}/ |
| 81 | rmdir ${D}/sbin |
| 82 | fi |
| 83 | } |
| 84 | |
| 85 | inherit update-alternatives |
| 86 | |
| 87 | base_sbindir_progs = "ipmaddr iptunnel mii-tool nameif \ |
| 88 | ${@bb.utils.contains('PACKAGECONFIG', 'arp', 'arp rarp', '', d)} \ |
| 89 | ${@bb.utils.contains('PACKAGECONFIG', 'plip', 'plipconfig', '', d)} \ |
| 90 | ${@bb.utils.contains('PACKAGECONFIG', 'serial', 'slattach', '', d)} \ |
| 91 | " |
| 92 | base_bindir_progs = "ifconfig netstat route \ |
| 93 | ${@bb.utils.contains('PACKAGECONFIG', 'hostname', 'dnsdomainname domainname hostname nisdomainname ypdomainname', '', d)} \ |
| 94 | " |
| 95 | |
| 96 | ALTERNATIVE_${PN} = "${base_sbindir_progs} ${base_bindir_progs}" |
| 97 | ALTERNATIVE_${PN}-doc += "${@bb.utils.contains('PACKAGECONFIG', 'hostname', 'hostname.1 dnsdomainname.1', '', d)}" |
| 98 | ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1" |
| 99 | ALTERNATIVE_LINK_NAME[dnsdomainname.1] = "${mandir}/man1/dnsdomainname.1" |
| 100 | ALTERNATIVE_PRIORITY[hostname.1] = "10" |
| 101 | |
| 102 | python __anonymous() { |
| 103 | for prog in d.getVar('base_sbindir_progs').split(): |
| 104 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog)) |
| 105 | for prog in d.getVar('base_bindir_progs').split(): |
| 106 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog)) |
| 107 | } |
| 108 | ALTERNATIVE_PRIORITY = "100" |
| 109 | |
| 110 | BBCLASSEXTEND = "native nativesdk" |