Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | SUMMARY = "Filtering tool for a Linux-based bridging firewall" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 2 | HOMEPAGE = "http://sourceforge.net/projects/ebtables/" |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 3 | DESCRIPTION = "Utility for basic Ethernet frame filtering on a Linux bridge, \ |
| 4 | advanced logging, MAC DNAT/SNAT and brouting." |
| 5 | LICENSE = "GPLv2" |
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=53b4a999993871a28ab1488fdbd2e73e" |
| 7 | SECTION = "net" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 8 | PR = "r4" |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 9 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 10 | RDEPENDS_${PN} += "bash" |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 11 | |
| 12 | RRECOMMENDS_${PN} += "kernel-module-ebtables \ |
| 13 | " |
| 14 | |
| 15 | SRC_URI = "${SOURCEFORGE_MIRROR}/ebtables/ebtables-v${PV}.tar.gz \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 16 | file://ebtables-save \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 17 | file://installnonroot.patch \ |
| 18 | file://01debian_defaultconfig.patch \ |
| 19 | file://ebtables.init \ |
| 20 | file://ebtables.common \ |
| 21 | file://ebtables.service \ |
| 22 | file://no-as-needed.patch \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 23 | file://0001-add-RARP-and-update-iana-url.patch \ |
| 24 | file://0002-fix-compilation-warning.patch \ |
| 25 | file://0003-add-info-about-Wl-no-as-needed.patch \ |
| 26 | file://0004-workaround-for-kernel-regression-bug-IPv6-source-des.patch \ |
| 27 | file://0005-Add-noflush-command-line-support-for-ebtables-restor.patch \ |
| 28 | file://0006-don-t-print-IPv6-mask-if-it-s-all-ones-based-on-patc.patch \ |
| 29 | file://0007-extensions-Use-stdint-types.patch \ |
| 30 | file://0008-ethernetdb.h-Remove-C-specific-compiler-hint-macro-_.patch \ |
| 31 | file://0009-ebtables-Allow-RETURN-target-rules-in-user-defined-c.patch \ |
| 32 | file://0010-Adjust-header-include-sequence.patch \ |
| 33 | " |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 34 | |
| 35 | SRC_URI[md5sum] = "506742a3d44b9925955425a659c1a8d0" |
| 36 | SRC_URI[sha256sum] = "dc6f7b484f207dc712bfca81645f45120cb6aee3380e77a1771e9c34a9a4455d" |
| 37 | |
| 38 | S = "${WORKDIR}/ebtables-v${PV}" |
| 39 | |
| 40 | inherit update-rc.d systemd |
| 41 | |
| 42 | python __anonymous () { |
| 43 | import re |
| 44 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 45 | karch = d.getVar('KARCH') |
| 46 | multilib = d.getVar('MLPREFIX') |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 47 | |
| 48 | if multilib and karch == 'powerpc64': |
| 49 | searchstr = "lib.?32" |
| 50 | reg = re.compile(searchstr) |
| 51 | if reg.search(multilib): |
| 52 | d.appendVar('CFLAGS' ,' -DKERNEL_64_USERSPACE_32 -DEBT_MIN_ALIGN=8') |
| 53 | } |
| 54 | |
| 55 | EXTRA_OEMAKE = " \ |
| 56 | BINDIR=${base_sbindir} \ |
| 57 | MANDIR=${mandir} \ |
| 58 | ETHERTYPESPATH=${sysconfdir} \ |
| 59 | INITDIR=${sysconfdir}/init.d \ |
| 60 | SYSCONFIGDIR=${sysconfdir}/default \ |
| 61 | LIBDIR=${base_libdir}/ebtables \ |
| 62 | 'CC=${CC}' \ |
| 63 | 'CFLAGS=${CFLAGS}' \ |
| 64 | 'LDFLAGS=${LDFLAGS} -Wl,--no-as-needed' \ |
| 65 | 'LD=${LD}' \ |
| 66 | " |
| 67 | |
| 68 | do_install () { |
| 69 | install -d ${D}${sbindir} |
| 70 | install -m 0755 ${WORKDIR}/ebtables.common ${D}${sbindir}/ebtables.common |
| 71 | # Fix hardcoded paths in scripts |
| 72 | sed -i 's!/sbin/!${base_sbindir}/!g' ${D}${sbindir}/ebtables.common |
| 73 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sbindir}/ebtables.common |
| 74 | |
| 75 | install -d ${D}${sysconfdir}/init.d |
| 76 | install -d ${D}${sysconfdir}/default |
| 77 | install -d ${D}${sysconfdir}/ebtables |
| 78 | oe_runmake DESTDIR='${D}' install |
| 79 | install -m 0755 ${WORKDIR}/ebtables.init ${D}/${sysconfdir}/init.d/ebtables |
| 80 | mv ${D}${sysconfdir}/default/ebtables-config ${D}${sysconfdir}/default/ebtables |
| 81 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ebtables |
| 82 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 83 | # Replace upstream ebtables-save perl script with Fedora bash based rewrite |
| 84 | # http://pkgs.fedoraproject.org/cgit/rpms/ebtables.git/tree/ebtables-save |
| 85 | install -m 0755 ${WORKDIR}/ebtables-save ${D}${base_sbindir}/ebtables-save |
| 86 | sed -i 's!/sbin/!${base_sbindir}/!g' ${D}${base_sbindir}/ebtables-save |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 87 | |
| 88 | # Install systemd service files |
| 89 | install -d ${D}${systemd_unitdir}/system |
| 90 | install -m 0644 ${WORKDIR}/ebtables.service ${D}${systemd_unitdir}/system |
| 91 | sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/ebtables.service |
| 92 | } |
| 93 | |
| 94 | CONFFILES_${PN} += "${sysconfdir}/default/ebtables" |
| 95 | |
| 96 | INITSCRIPT_NAME = "ebtables" |
| 97 | INITSCRIPT_PARAMS = "start 41 S . stop 41 6 ." |
| 98 | |
| 99 | SYSTEMD_SERVICE_${PN} = "ebtables.service" |
| 100 | |
| 101 | FILES_${PN}-dbg += "${base_libdir}/ebtables/.debug" |
| 102 | FILES_${PN} += "${base_libdir}/ebtables/*.so" |