blob: c479eefba0670e80c866ad50ecf9b314a705f1fe [file] [log] [blame]
Andrew Geissler9aee5002022-03-30 16:27:02 +00001
2SUMMARY = "Uncomplicated Firewall"
3DESCRIPTION = "UFW stands for Uncomplicated Firewall, and is program for \
4managing a netfilter firewall. It provides a command line interface and aims \
5to be uncomplicated and easy to use."
6HOMEPAGE = "https://launchpad.net/ufw"
7SECTION = "net"
8LICENSE = "GPL-3.0-only"
9LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
10
11SRC_URI = "https://launchpad.net/ufw/0.36/0.36.1/+download/ufw-0.36.1.tar.gz \
12 file://0001-optimize-boot.patch \
13 file://0002-add-an-option-to-specify-iptables-location.patch \
14 file://0003-only-make-one-reference-to-env.patch \
15 file://setuptools.patch \
16 "
17SRC_URI[sha256sum] = "1c57e78fbf2970f0cc9c56ea87a231e6d83d825e55b9e31e2c88b91b0ea03c8c"
18
19UPSTREAM_CHECK_URI = "https://launchpad.net/ufw"
20
21inherit setuptools3_legacy features_check systemd update-rc.d
22
23RDEPENDS:${PN} = " \
24 iptables \
25 python3 \
26 python3-modules \
27 "
28
29RRECOMMENDS:${PN} = " \
30 kernel-module-ipv6 \
31 kernel-module-nf-conntrack-ipv6 \
32 kernel-module-nf-log-common \
33 kernel-module-nf-log-ipv4 \
34 kernel-module-nf-log-ipv6 \
35 kernel-module-nf-addrtype \
36 kernel-module-nf-limit \
37 kernel-module-nf-log \
38 kernel-module-nf-recent \
39"
40
Patrick Williams03907ee2022-05-01 06:28:52 -050041
42do_configure:prepend() {
43 if ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','true','false',d)}; then
44 sed -i -e 's|/lib|${nonarch_base_libdir}|' ${S}/setup.py
45 fi
46}
47
Andrew Geissler9aee5002022-03-30 16:27:02 +000048do_install:append() {
49 install -d ${D}${systemd_unitdir}/system/
50 install -m 0644 ${S}/doc/systemd.example ${D}${systemd_unitdir}/system/ufw.service
51
52 install -d ${D}${sysconfdir}/init.d/
53 install -m 0755 ${S}/doc/initscript.example ${D}${sysconfdir}/init.d/ufw
54}
55
56SYSTEMD_SERVICE:${PN} = "ufw.service"
57
58INITSCRIPT_NAME = "ufw"
59INITSCRIPT_PARAMS = "defaults"
60
61# Certain items are explicitly put under /lib, not base_libdir when installed.
62#
63FILES:${PN} += " \
64 ${sbindir}/* \
65 ${datadir}/ufw/* \
Andrew Geisslerd5838332022-05-27 11:33:10 -050066 ${nonarch_base_libdir}/ufw/* \
Andrew Geissler9aee5002022-03-30 16:27:02 +000067 ${sysconfdir}/ufw/* \
68 ${sysconfdir}/default/ufw \
69"
70
71REQUIRED_DISTRO_FEATURES = "ipv6"
72
Andrew Geissler87f5cff2022-09-30 13:13:31 -050073SETUPTOOLS_BUILD_ARGS:append = " --iptables-dir /usr/sbin"
74SETUPTOOLS_INSTALL_ARGS:append = " --iptables-dir /usr/sbin"