blob: fbf586f769e1718e2dd501a41abce191370b1847 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Dynamic firewall daemon with a D-Bus interface"
2HOMEPAGE = "https://firewalld.org/"
3BUGTRACKER = "https://github.com/firewalld/firewalld/issues"
4UPSTREAM_CHECK_URI = "https://github.com/firewalld/firewalld/releases"
5LICENSE = "GPLv2+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
7
8SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BP}.tar.gz \
9 file://firewalld.init \
10"
Andrew Geisslerd221e032020-07-10 16:13:21 -050011SRC_URI[md5sum] = "b1aeede85a72adcf4f79d98019811244"
12SRC_URI[sha256sum] = "45a8a7dbc084ef56ce306154d3834922e7f1fc2bf11b6c821f579cad51313226"
Andrew Geissler82c905d2020-04-13 13:39:40 -050013
14# glib-2.0-native is needed for GSETTINGS_RULES autoconf macro from gsettings.m4
Andrew Geisslerd221e032020-07-10 16:13:21 -050015DEPENDS = "intltool-native glib-2.0-native"
Andrew Geissler82c905d2020-04-13 13:39:40 -050016
17inherit gettext autotools bash-completion python3native gsettings systemd update-rc.d
18
19PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
20PACKAGECONFIG[systemd] = "--with-systemd-unitdir=${systemd_system_unitdir},--disable-systemd"
Andrew Geisslerd221e032020-07-10 16:13:21 -050021PACKAGECONFIG[docs] = "--with-xml-catalog=${STAGING_ETCDIR_NATIVE}/xml/catalog,--disable-docs,libxslt-native docbook-xsl-stylesheets-native"
Andrew Geissler82c905d2020-04-13 13:39:40 -050022
23PACKAGES += "${PN}-zsh-completion"
24
25# iptables, ip6tables, ebtables, and ipset *should* be unnecessary
26# when the nftables backend is available, because nftables supersedes all of them.
27# However we still need iptables and ip6tables to be available otherwise any
28# application relying on "direct passthrough" rules (such as docker) will break.
29# /etc/sysconfig/firewalld is a Red Hat-ism, only referenced by
30# the Red Hat-specific init script which we aren't using, so we disable that.
31EXTRA_OECONF = "\
32 --with-nft=${sbindir}/nft \
33 --without-ipset \
34 --with-iptables=${sbindir}/iptables \
35 --with-iptables-restore=${sbindir}/iptables-restore \
36 --with-ip6tables=${sbindir}/ip6tables \
37 --with-ip6tables-restore=${sbindir}/ip6tables-restore \
38 --without-ebtables \
39 --without-ebtables-restore \
40 --disable-sysconfig \
Andrew Geissler82c905d2020-04-13 13:39:40 -050041"
42
43INITSCRIPT_NAME = "firewalld"
44SYSTEMD_SERVICE_${PN} = "firewalld.service"
45
46do_install_append() {
47 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
48 :
49 else
50 # firewalld ships an init script but it contains Red Hat-isms, replace it with our own
51 rm -rf ${D}${sysconfdir}/rc.d/
52 install -d ${D}${sysconfdir}/init.d
53 install -m0755 ${WORKDIR}/firewalld.init ${D}${sysconfdir}/init.d/firewalld
54 fi
55
56 # We ran ./configure with PYTHON pointed at the binary inside $STAGING_BINDIR_NATIVE
57 # so now we need to fix up any references to point at the proper path in the image.
58 # This hack is also in distutils.bbclass, but firewalld doesn't use distutils/setuptools.
59 if [ ${PN} != "${BPN}-native" ]; then
60 sed -i -e s:${STAGING_BINDIR_NATIVE}/python3-native/python3:${bindir}/python3:g \
61 ${D}${bindir}/* ${D}${sbindir}/* ${D}${sysconfdir}/firewalld/*.xml
62 fi
63 sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g \
64 ${D}${bindir}/* ${D}${sbindir}/* ${D}${sysconfdir}/firewalld/*.xml
Andrew Geisslerd221e032020-07-10 16:13:21 -050065
66 # This file contains Red Hat-isms. Modules get loaded without it.
67 rm -f ${D}${sysconfdir}/modprobe.d/firewalld-sysctls.conf
Andrew Geissler82c905d2020-04-13 13:39:40 -050068}
69
70FILES_${PN} += "\
71 ${PYTHON_SITEPACKAGES_DIR}/firewall \
72 ${nonarch_libdir}/firewalld \
73 ${datadir}/dbus-1 \
74 ${datadir}/polkit-1 \
75 ${datadir}/metainfo \
76"
77FILES_${PN}-zsh-completion = "${datadir}/zsh/site-functions"
78
79RDEPENDS_${PN} = "\
80 nftables \
81 iptables \
82 python3-core \
83 python3-io \
84 python3-fcntl \
85 python3-shell \
86 python3-syslog \
87 python3-xml \
88 python3-dbus \
89 python3-slip-dbus \
90 python3-decorator \
91 python3-pygobject \
92"