|
@@ -1,18 +1,22 @@
|
|
|
|
+%bcond_with systemd
|
|
|
|
+
|
|
Name: nftables
|
|
Name: nftables
|
|
-Version: 0.9.2
|
|
+Version: 1.0.9
|
|
-Release: 1%{?_dist_release}
|
|
+Release: 1%{?_dist_release}%{?with_systemd:.systemd}
|
|
Summary: Netfilter Tables userspace utillites
|
|
Summary: Netfilter Tables userspace utillites
|
|
|
|
+Group: system
|
|
|
|
+Vendor: Project Vine
|
|
|
|
+Distribution: Vine Linux
|
|
|
|
|
|
License: GPLv2
|
|
License: GPLv2
|
|
-Group: System Environment/Base
|
|
|
|
URL: http://netfilter.org/projects/nftables/
|
|
URL: http://netfilter.org/projects/nftables/
|
|
-
|
|
+Source0: http://ftp.netfilter.org/pub/nftables/nftables-%{version}.tar.xz
|
|
-Source0: http://ftp.netfilter.org/pub/nftables/nftables-%{version}.tar.bz2
|
|
|
|
Source1: nftables.init
|
|
Source1: nftables.init
|
|
Source2: nftables.conf
|
|
Source2: nftables.conf
|
|
-
|
|
+Source3: main.nft
|
|
-Vendor: Project Vine
|
|
+Source4: router.nft
|
|
-Distribution: Vine Linux
|
|
+Source5: nat.nft
|
|
|
|
+Source11: nftables.service
|
|
|
|
|
|
#BuildRequires: autogen
|
|
#BuildRequires: autogen
|
|
#BuildRequires: autoconf
|
|
#BuildRequires: autoconf
|
|
@@ -23,18 +27,27 @@ BuildRequires: bison
|
|
BuildRequires: libmnl-devel
|
|
BuildRequires: libmnl-devel
|
|
BuildRequires: gmp-devel
|
|
BuildRequires: gmp-devel
|
|
BuildRequires: readline-devel
|
|
BuildRequires: readline-devel
|
|
|
|
+BuildRequires: libedit-devel
|
|
BuildRequires: libnftnl-devel
|
|
BuildRequires: libnftnl-devel
|
|
BuildRequires: asciidoc
|
|
BuildRequires: asciidoc
|
|
BuildRequires: docbook2X
|
|
BuildRequires: docbook2X
|
|
BuildRequires: jansson-devel
|
|
BuildRequires: jansson-devel
|
|
BuildRequires: iptables-devel
|
|
BuildRequires: iptables-devel
|
|
BuildRequires: python-rpm-macros
|
|
BuildRequires: python-rpm-macros
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%{?systemd_requires}
|
|
|
|
+%else
|
|
|
|
+Requires(post): chkconfig
|
|
|
|
+Requires(preun): chkconfig
|
|
|
|
+%endif
|
|
|
|
|
|
%description
|
|
%description
|
|
Netfilter Tables userspace utilities.
|
|
Netfilter Tables userspace utilities.
|
|
|
|
|
|
|
|
+
|
|
%package devel
|
|
%package devel
|
|
Summary: Development library for nftables / libnftables
|
|
Summary: Development library for nftables / libnftables
|
|
|
|
+Group: programming
|
|
Requires: %{name} = %{version}-%{release}
|
|
Requires: %{name} = %{version}-%{release}
|
|
Requires: pkgconfig
|
|
Requires: pkgconfig
|
|
|
|
|
|
@@ -42,15 +55,25 @@ Requires: pkgconfig
|
|
Development tools and static libraries and header files for
|
|
Development tools and static libraries and header files for
|
|
the libnftables library.
|
|
the libnftables library.
|
|
|
|
|
|
|
|
+
|
|
|
|
+%debug_package
|
|
|
|
+
|
|
|
|
+
|
|
%prep
|
|
%prep
|
|
#setup -q -n nftables-%{snapdate}
|
|
#setup -q -n nftables-%{snapdate}
|
|
%setup -q
|
|
%setup -q
|
|
|
|
|
|
|
|
+
|
|
%build
|
|
%build
|
|
#./autogen.sh
|
|
#./autogen.sh
|
|
-%configure --disable-silent-rules --with-xtables --with-json --enable-python=no
|
|
+%configure \
|
|
|
|
+ --disable-silent-rules \
|
|
|
|
+ --with-xtables \
|
|
|
|
+ --with-json \
|
|
|
|
+ --enable-python=no
|
|
make %{?_smp_mflags}
|
|
make %{?_smp_mflags}
|
|
|
|
|
|
|
|
+
|
|
%install
|
|
%install
|
|
%make_install
|
|
%make_install
|
|
find %{buildroot} -name '*.la' -exec rm -f {} ';'
|
|
find %{buildroot} -name '*.la' -exec rm -f {} ';'
|
|
@@ -59,42 +82,68 @@ chmod 644 %{buildroot}/%{_mandir}/man8/nft*
|
|
# Don't ship static lib (for now at least)
|
|
# Don't ship static lib (for now at least)
|
|
rm -f $RPM_BUILD_ROOT/%{_libdir}/libnftables.a
|
|
rm -f $RPM_BUILD_ROOT/%{_libdir}/libnftables.a
|
|
|
|
|
|
|
|
+# drop vendor-provided configs, they are not really useful
|
|
|
|
+rm -f $RPM_BUILD_ROOT/%{_datadir}/nftables/*.nft
|
|
|
|
+
|
|
chmod 644 $RPM_BUILD_ROOT/%{_mandir}/man8/nft*
|
|
chmod 644 $RPM_BUILD_ROOT/%{_mandir}/man8/nft*
|
|
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
|
+mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
|
|
|
|
+cp -a %{SOURCE11} $RPM_BUILD_ROOT/%{_unitdir}/
|
|
|
|
+%else
|
|
mkdir -p $RPM_BUILD_ROOT/%{_initdir}
|
|
mkdir -p $RPM_BUILD_ROOT/%{_initdir}
|
|
install -m755 %{SOURCE1} $RPM_BUILD_ROOT/%{_initdir}/nftables
|
|
install -m755 %{SOURCE1} $RPM_BUILD_ROOT/%{_initdir}/nftables
|
|
|
|
+%endif
|
|
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig
|
|
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig
|
|
cp -a %{SOURCE2} $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/
|
|
cp -a %{SOURCE2} $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/
|
|
chmod 600 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/nftables.conf
|
|
chmod 600 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/nftables.conf
|
|
|
|
|
|
mkdir -m 700 -p $RPM_BUILD_ROOT/%{_sysconfdir}/nftables
|
|
mkdir -m 700 -p $RPM_BUILD_ROOT/%{_sysconfdir}/nftables
|
|
-chmod 600 $RPM_BUILD_ROOT/%{_sysconfdir}/nftables/*.nft
|
|
+cp %{SOURCE3} %{SOURCE4} %{SOURCE5} \
|
|
-chmod 700 $RPM_BUILD_ROOT/%{_sysconfdir}/nftables
|
|
+ $RPM_BUILD_ROOT/%{_sysconfdir}/nftables/
|
|
|
|
+
|
|
|
|
+find $RPM_BUILD_ROOT/%{_sysconfdir} -type f -exec chmod 0600 {} \;
|
|
|
|
|
|
rm -rf %{buildroot}%{python_sitelib}/*
|
|
rm -rf %{buildroot}%{python_sitelib}/*
|
|
|
|
|
|
|
|
+
|
|
%post
|
|
%post
|
|
-/sbin/ldconfig
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_post nftables.service
|
|
|
|
+%else
|
|
/sbin/chkconfig --add nftables
|
|
/sbin/chkconfig --add nftables
|
|
|
|
+%endif
|
|
|
|
|
|
%preun
|
|
%preun
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_preun nftables.service
|
|
|
|
+%else
|
|
if [ "$1" = 0 ]; then
|
|
if [ "$1" = 0 ]; then
|
|
/sbin/chkconfig --del nftables
|
|
/sbin/chkconfig --del nftables
|
|
fi
|
|
fi
|
|
|
|
+%endif
|
|
|
|
+
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%postun
|
|
|
|
+%systemd_postun_with_restart nftables.service
|
|
|
|
+%endif
|
|
|
|
|
|
-%postun -p /sbin/ldconfig
|
|
|
|
|
|
|
|
%files
|
|
%files
|
|
%license COPYING
|
|
%license COPYING
|
|
-%doc TODO
|
|
+%doc %{_docdir}/nftables/examples
|
|
%config(noreplace) %{_sysconfdir}/nftables/
|
|
%config(noreplace) %{_sysconfdir}/nftables/
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/nftables.conf
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/nftables.conf
|
|
%{_libdir}/*.so.*
|
|
%{_libdir}/*.so.*
|
|
%{_sbindir}/nft
|
|
%{_sbindir}/nft
|
|
%{_mandir}/man5/libnftables-json*
|
|
%{_mandir}/man5/libnftables-json*
|
|
%{_mandir}/man8/nft*
|
|
%{_mandir}/man8/nft*
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%{_unitdir}/nftables.service
|
|
|
|
+%else
|
|
%{_initdir}/nftables
|
|
%{_initdir}/nftables
|
|
|
|
+%endif
|
|
|
|
|
|
%files devel
|
|
%files devel
|
|
%{_libdir}/pkgconfig/*.pc
|
|
%{_libdir}/pkgconfig/*.pc
|
|
@@ -104,6 +153,9 @@ fi
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
%changelog
|
|
|
|
+* Fri Oct 20 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.9-1
|
|
|
|
+- new upstream release.
|
|
|
|
+
|
|
* Mon Sep 02 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.9.2-1
|
|
* Mon Sep 02 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.9.2-1
|
|
- new upstream release.
|
|
- new upstream release.
|
|
|
|
|