Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | SUMMARY = "Tools for managing kernel packet filtering capabilities" |
| 2 | DESCRIPTION = "iptables is the userspace command line program used to configure and control network packet \ |
| 3 | filtering code in Linux." |
| 4 | HOMEPAGE = "http://www.netfilter.org/" |
| 5 | BUGTRACKER = "http://bugzilla.netfilter.org/" |
| 6 | LICENSE = "GPLv2+" |
| 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263\ |
| 8 | file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d0f763df2a12dc" |
| 9 | |
| 10 | SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \ |
| 11 | file://0001-configure-Add-option-to-enable-disable-libnfnetlink.patch \ |
| 12 | file://0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch \ |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame^] | 13 | file://iptables.service \ |
| 14 | file://iptables.rules \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 15 | " |
| 16 | |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 17 | SRC_URI[md5sum] = "29de711d15c040c402cf3038c69ff513" |
| 18 | SRC_URI[sha256sum] = "a23cac034181206b4545f4e7e730e76e08b5f3dd78771ba9645a6756de9cdd80" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 19 | |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame^] | 20 | inherit autotools pkgconfig systemd |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 21 | |
| 22 | EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR}" |
| 23 | |
| 24 | PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" |
| 25 | |
| 26 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," |
| 27 | |
| 28 | # libnfnetlink recipe is in meta-networking layer |
| 29 | PACKAGECONFIG[libnfnetlink] = "--enable-libnfnetlink,--disable-libnfnetlink,libnfnetlink libnetfilter-conntrack" |
| 30 | |
| 31 | # libnftnl recipe is in meta-networking layer(previously known as libnftables) |
| 32 | PACKAGECONFIG[libnftnl] = "--enable-nftables,--disable-nftables,libnftnl" |
| 33 | |
| 34 | do_configure_prepend() { |
| 35 | # Remove some libtool m4 files |
| 36 | # Keep ax_check_linker_flags.m4 which belongs to autoconf-archive. |
| 37 | rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 |
| 38 | } |
| 39 | |
| 40 | PACKAGES += "${PN}-modules" |
| 41 | PACKAGES_DYNAMIC += "^${PN}-module-.*" |
| 42 | |
| 43 | python populate_packages_prepend() { |
| 44 | modules = do_split_packages(d, '${libdir}/xtables', r'lib(.*)\.so$', '${PN}-module-%s', '${PN} module %s', extra_depends='') |
| 45 | if modules: |
| 46 | metapkg = d.getVar('PN') + '-modules' |
| 47 | d.appendVar('RDEPENDS_' + metapkg, ' ' + ' '.join(modules)) |
| 48 | } |
| 49 | |
| 50 | FILES_${PN} += "${datadir}/xtables" |
| 51 | |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 52 | # Include the symlinks as well in respective packages |
| 53 | FILES_${PN}-module-xt-conntrack += "${libdir}/xtables/libxt_state.so" |
| 54 | FILES_${PN}-module-xt-ct += "${libdir}/xtables/libxt_NOTRACK.so" |
| 55 | |
| 56 | INSANE_SKIP_${PN}-module-xt-conntrack = "dev-so" |
| 57 | INSANE_SKIP_${PN}-module-xt-ct = "dev-so" |
| 58 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 59 | ALLOW_EMPTY_${PN}-modules = "1" |
| 60 | |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame^] | 61 | do_install_append() { |
| 62 | |
| 63 | install -d ${D}${sysconfdir}/iptables |
| 64 | install -m 0644 ${WORKDIR}/iptables.rules ${D}${sysconfdir}/iptables |
| 65 | |
| 66 | install -d ${D}${systemd_system_unitdir} |
| 67 | install -m 0644 ${WORKDIR}/iptables.service ${D}${systemd_system_unitdir} |
| 68 | |
| 69 | sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/iptables.service |
| 70 | } |
| 71 | |
| 72 | SYSTEMD_SERVICE_${PN} = "iptables.service" |
| 73 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 74 | RDEPENDS_${PN} = "${PN}-module-xt-standard" |
| 75 | RRECOMMENDS_${PN} = " \ |
| 76 | ${PN}-modules \ |
| 77 | kernel-module-x-tables \ |
| 78 | kernel-module-ip-tables \ |
| 79 | kernel-module-iptable-filter \ |
| 80 | kernel-module-iptable-nat \ |
| 81 | kernel-module-nf-defrag-ipv4 \ |
| 82 | kernel-module-nf-conntrack \ |
| 83 | kernel-module-nf-conntrack-ipv4 \ |
| 84 | kernel-module-nf-nat \ |
| 85 | kernel-module-ipt-masquerade \ |
| 86 | " |