blob: d9d5cad75f7a0301627800f803ac020a8ec333bc [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "Dynamic firewall daemon with a D-Bus interface"
2HOMEPAGE = "https://firewalld.org/"
3BUGTRACKER = "https://github.com/firewalld/firewalld/issues"
Brad Bishop779d0ac2019-09-27 08:23:48 -04004UPSTREAM_CHECK_URI = "https://github.com/firewalld/firewalld/releases"
Brad Bishop19323692019-04-05 15:28:33 -04005LICENSE = "GPLv2+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
7
Brad Bishop26bdd442019-08-16 17:08:17 -04008SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BP}.tar.gz \
Brad Bishop19323692019-04-05 15:28:33 -04009 file://0001-fix-building-in-a-separate-directory-outside-the-sou.patch \
Brad Bishop26bdd442019-08-16 17:08:17 -040010 file://firewalld.init \
Brad Bishop19323692019-04-05 15:28:33 -040011"
Brad Bishop26bdd442019-08-16 17:08:17 -040012SRC_URI[md5sum] = "e63bdd65a4d2f6338f60b31e91bb5525"
13SRC_URI[sha256sum] = "5a82a72fd9ad4cbbfb805bae615faa9b91a27855245de0fef3bcb06439394852"
Brad Bishop19323692019-04-05 15:28:33 -040014
15# glib-2.0-native is needed for GSETTINGS_RULES autoconf macro from gsettings.m4
16# xmlto-native is needed to populate /etc/xml/catalog.xml in the sysroot so that xsltproc finds the docbook xslt
17DEPENDS = "intltool-native glib-2.0-native libxslt-native docbook-xsl-stylesheets-native xmlto-native"
18
19inherit gettext autotools bash-completion python3native gsettings systemd update-rc.d
20
21PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
22PACKAGECONFIG[systemd] = "--with-systemd-unitdir=${systemd_unitdir}/system/,--disable-systemd"
23
24# iptables, ip6tables, ebtables, and ipset *should* be unnecessary
25# when the nftables backend is available, because nftables supersedes all of them.
26# However we still need iptables and ip6tables to be available otherwise any
27# application relying on "direct passthrough" rules (such as docker) will break.
28# /etc/sysconfig/firewalld is a Red Hat-ism, only referenced by
29# the Red Hat-specific init script which we aren't using, so we disable that.
30EXTRA_OECONF = "\
31 --with-nft=${sbindir}/nft \
32 --without-ipset \
33 --with-iptables=${sbindir}/iptables \
34 --with-iptables-restore=${sbindir}/iptables-restore \
35 --with-ip6tables=${sbindir}/ip6tables \
36 --with-ip6tables-restore=${sbindir}/ip6tables-restore \
37 --without-ebtables \
38 --without-ebtables-restore \
39 --disable-sysconfig \
40"
41
42INITSCRIPT_NAME = "firewalld"
43SYSTEMD_SERVICE = "firewalld.service"
44
45do_install_append() {
46 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
47 :
48 else
49 # firewalld ships an init script but it contains Red Hat-isms, replace it with our own
50 rm -rf ${D}${sysconfdir}/rc.d/
51 install -d ${D}${sysconfdir}/init.d
52 install -m0755 ${WORKDIR}/firewalld.init ${D}${sysconfdir}/init.d/firewalld
53 fi
54
55 # We ran ./configure with PYTHON pointed at the binary inside $STAGING_BINDIR_NATIVE
56 # so now we need to fix up any references to point at the proper path in the image.
57 # This hack is also in distutils.bbclass, but firewalld doesn't use distutils/setuptools.
58 if [ ${PN} != "${BPN}-native" ]; then
59 sed -i -e s:${STAGING_BINDIR_NATIVE}/python3-native/python3:${bindir}/python3:g \
60 ${D}${bindir}/* ${D}${sbindir}/* ${D}${sysconfdir}/firewalld/*.xml
61 fi
62 sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g \
63 ${D}${bindir}/* ${D}${sbindir}/* ${D}${sysconfdir}/firewalld/*.xml
64}
65
66FILES_${PN} += "\
67 ${PYTHON_SITEPACKAGES_DIR}/firewall \
68 ${datadir}/polkit-1 \
69 ${datadir}/metainfo \
70"
71
72RDEPENDS_${PN} = "\
73 nftables \
74 iptables \
75 python3-core \
76 python3-io \
77 python3-fcntl \
78 python3-shell \
79 python3-syslog \
80 python3-xml \
81 python3-dbus \
82 python3-slip-dbus \
83 python3-decorator \
84 python3-pygobject \
85"