]>
Commit | Line | Data |
---|---|---|
19bb6686 JP |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without systemd # without systemd unit | |
4 | ||
f4e8c132 JB |
5 | Summary: Administration tool for packet filtering and classification |
6 | Summary(pl.UTF-8): Narzędzie administracyjne do filtrowania i klasyfikacji pakietów | |
7 | Name: nftables | |
1bd197c2 | 8 | Version: 0.9.8 |
e8d710b4 | 9 | Release: 1 |
f4e8c132 JB |
10 | License: GPL v2 |
11 | Group: Applications/Networking | |
4e4aed31 | 12 | Source0: https://netfilter.org/projects/nftables/files/%{name}-%{version}.tar.bz2 |
1bd197c2 | 13 | # Source0-md5: 77bf0bd43e65e92212fc73139a2e47fc |
19bb6686 JP |
14 | Source1: %{name}.service |
15 | Source2: %{name}.conf | |
cf7ed850 | 16 | Patch0: %{name}-python.patch |
4e4aed31 | 17 | URL: https://netfilter.org/projects/nftables/ |
e8d710b4 | 18 | BuildRequires: asciidoc |
f4e8c132 | 19 | BuildRequires: autoconf >= 2.61 |
09b93bc2 | 20 | BuildRequires: automake >= 1.6 |
f4e8c132 | 21 | BuildRequires: bison |
f4e8c132 JB |
22 | BuildRequires: flex |
23 | BuildRequires: gmp-devel | |
435e9057 | 24 | BuildRequires: iptables-devel >= 1.6.1 |
163d1557 | 25 | BuildRequires: jansson-devel |
aa5e3930 | 26 | BuildRequires: libmnl-devel >= 1.0.4 |
1bd197c2 | 27 | BuildRequires: libnftnl-devel >= 1.1.9 |
c5846f36 | 28 | BuildRequires: libtool >= 2:2 |
7be40d4e | 29 | BuildRequires: pkgconfig |
cf7ed850 | 30 | BuildRequires: python-modules >= 1:2.5 |
f4e8c132 | 31 | BuildRequires: readline-devel |
cf7ed850 JB |
32 | BuildRequires: rpm-pythonprov |
33 | BuildRequires: rpmbuild(macros) >= 1.219 | |
435e9057 | 34 | Requires: iptables-libs >= 1.6.1 |
aa5e3930 | 35 | Requires: libmnl >= 1.0.4 |
1bd197c2 | 36 | Requires: libnftnl >= 1.1.9 |
19bb6686 | 37 | %{?with_systemd:Requires: systemd-units >= 38} |
f4e8c132 JB |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
39 | ||
40 | %description | |
41 | nftables is the project that aims to replace the existing | |
42 | {ip,ip6,arp,eb}tables framework. Basically, this project provides a | |
43 | new packet filtering framework, a new userspace utility and also a | |
44 | compatibility layer for {ip,ip6}tables. nftables is built upon the | |
45 | building blocks of the Netfilter infrastructure such as the existing | |
46 | hooks, the connection tracking system, the userspace queueing | |
47 | component and the logging subsystem. | |
48 | ||
49 | %description -l pl.UTF-8 | |
50 | nftables to projekt mający na celu zastąpienie istniejącego szkieletu | |
51 | {ip,ip6,arp,eb}tables. Ten projekt przede wszystkim dostarcza nowy | |
52 | szkielet filtrowania, nowe narzędzie linii poleceń oraz warstwę | |
53 | zgodności dla {ip,ip6}tables. nftables jest zbudowane w oparciu o | |
54 | bloki tworzące infrastrukturę Netfilter, takie jak istniejące uchwyty, | |
55 | system śledzenia połączeń, komponent kolejkowania w przestrzeni | |
56 | użytkownika oraz podsystem logowania. | |
57 | ||
163d1557 JB |
58 | %package devel |
59 | Summary: Header file for nftables library | |
60 | Summary(pl.UTF-8): Plik nagłówkowy biblioteki nftables | |
61 | Group: Development/Libraries | |
62 | Requires: %{name} = %{version}-%{release} | |
63 | ||
64 | %description devel | |
65 | Header file for nftables library. | |
66 | ||
67 | %description devel -l pl.UTF-8 | |
68 | Plik nagłówkowy biblioteki nftables. | |
69 | ||
70 | %package static | |
71 | Summary: Static nftables library | |
72 | Summary(pl.UTF-8): Statyczna biblioteka nftables | |
73 | Group: Development/Libraries | |
74 | Requires: %{name}-devel = %{version}-%{release} | |
75 | ||
76 | %description static | |
77 | Static nftables library. | |
78 | ||
79 | %description static -l pl.UTF-8 | |
80 | Statyczna biblioteka nftables. | |
81 | ||
cf7ed850 JB |
82 | %package -n python-nftables |
83 | Summary: Python bindings for libnftables library | |
84 | Summary(pl.UTF-8): Wiązania Pythona do biblioteki libnftables | |
85 | Group: Libraries/Python | |
86 | Requires: %{name} = %{version}-%{release} | |
87 | ||
88 | %description -n python-nftables | |
89 | Python bindings for libnftables library. | |
90 | ||
91 | %description -n python-nftables -l pl.UTF-8 | |
92 | Wiązania Pythona do biblioteki libnftables. | |
93 | ||
f4e8c132 JB |
94 | %prep |
95 | %setup -q | |
cf7ed850 | 96 | %patch0 -p1 |
f4e8c132 JB |
97 | |
98 | %build | |
4e4aed31 | 99 | %{__libtoolize} |
09b93bc2 | 100 | %{__aclocal} -I m4 |
f4e8c132 | 101 | %{__autoconf} |
09b93bc2 JB |
102 | %{__autoheader} |
103 | %{__automake} | |
f4e8c132 | 104 | %configure \ |
435e9057 | 105 | --disable-silent-rules \ |
163d1557 | 106 | --with-json \ |
435e9057 | 107 | --with-xtables |
f4e8c132 JB |
108 | |
109 | %{__make} | |
110 | ||
111 | %install | |
112 | rm -rf $RPM_BUILD_ROOT | |
113 | ||
9f8e3e09 | 114 | install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}} |
19bb6686 | 115 | |
f4e8c132 JB |
116 | %{__make} install \ |
117 | DESTDIR=$RPM_BUILD_ROOT | |
118 | ||
9f8e3e09 JB |
119 | cp %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/nftables |
120 | %{__sed} -i -e 's|@NFT@|%{_sbindir}/nft|' \ | |
121 | $RPM_BUILD_ROOT/etc/sysconfig/nftables | |
19bb6686 JP |
122 | |
123 | %if %{with systemd} | |
124 | cp %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir} | |
9f8e3e09 | 125 | %{__sed} -i -e '{ |
19bb6686 | 126 | s|@NFT@|%{_sbindir}/nft| |
9f8e3e09 | 127 | s|@CONF@|/etc/sysconfig/nftables| |
19bb6686 JP |
128 | }' \ |
129 | $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service | |
130 | %endif | |
131 | ||
163d1557 JB |
132 | # obsoleted by pkg-config |
133 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libnftables.la | |
134 | ||
cf7ed850 JB |
135 | %py_postclean |
136 | ||
f4e8c132 JB |
137 | %clean |
138 | rm -rf $RPM_BUILD_ROOT | |
139 | ||
19bb6686 JP |
140 | %post |
141 | /sbin/ldconfig | |
142 | %{?with_systemd:%systemd_post %{name}.service} | |
143 | ||
144 | %preun | |
145 | %{?with_systemd:%systemd_preun %{name}.service} | |
146 | ||
147 | %postun | |
148 | /sbin/ldconfig | |
149 | %{?with_systemd:%systemd_reload} | |
150 | ||
163d1557 | 151 | |
f4e8c132 JB |
152 | %files |
153 | %defattr(644,root,root,755) | |
f4e8c132 | 154 | %attr(755,root,root) %{_sbindir}/nft |
163d1557 JB |
155 | %dir %{_sysconfdir}/nftables |
156 | %attr(740,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nftables/all-in-one.nft | |
157 | %attr(740,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nftables/arp-filter.nft | |
158 | %attr(740,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nftables/bridge-filter.nft | |
159 | %attr(740,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nftables/inet-filter.nft | |
c5846f36 | 160 | %attr(740,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nftables/inet-nat.nft |
163d1557 JB |
161 | %attr(740,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nftables/ipv4-filter.nft |
162 | %attr(740,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nftables/ipv4-mangle.nft | |
163 | %attr(740,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nftables/ipv4-nat.nft | |
164 | %attr(740,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nftables/ipv4-raw.nft | |
165 | %attr(740,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nftables/ipv6-filter.nft | |
166 | %attr(740,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nftables/ipv6-mangle.nft | |
167 | %attr(740,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nftables/ipv6-nat.nft | |
168 | %attr(740,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nftables/ipv6-raw.nft | |
c5846f36 | 169 | %attr(740,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nftables/netdev-ingress.nft |
cf7ed850 JB |
170 | %dir %{_sysconfdir}/nftables/osf |
171 | %attr(740,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nftables/osf/pf.os | |
9f8e3e09 | 172 | %attr(740,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/nftables |
163d1557 | 173 | %attr(755,root,root) %{_libdir}/libnftables.so.*.*.* |
cf7ed850 | 174 | %attr(755,root,root) %ghost %{_libdir}/libnftables.so.1 |
388b512c | 175 | %doc %{_docdir}/nftables |
cf7ed850 | 176 | %{_mandir}/man5/libnftables-json.5* |
f4e8c132 | 177 | %{_mandir}/man8/nft.8* |
19bb6686 | 178 | %{?with_systemd:%{systemdunitdir}/%{name}.service} |
163d1557 JB |
179 | |
180 | %files devel | |
181 | %defattr(644,root,root,755) | |
182 | %attr(755,root,root) %{_libdir}/libnftables.so | |
183 | %{_includedir}/nftables | |
184 | %{_pkgconfigdir}/libnftables.pc | |
cf7ed850 | 185 | %{_mandir}/man3/libnftables.3* |
163d1557 JB |
186 | |
187 | %files static | |
188 | %defattr(644,root,root,755) | |
189 | %{_libdir}/libnftables.a | |
cf7ed850 JB |
190 | |
191 | %files -n python-nftables | |
192 | %defattr(644,root,root,755) | |
193 | %dir %{py_sitedir}/nftables | |
194 | %{py_sitedir}/nftables/*.py[co] | |
195 | %{py_sitedir}/nftables/schema.json | |
196 | %{py_sitedir}/nftables-0.1-py*.egg-info |