]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without dist_kernel # without distribution kernel | |
4 | %bcond_without kernel # don't build kernel modules | |
5 | %bcond_without userspace # # don't build userspace tools | |
6 | ||
7 | %if %{without kernel} | |
8 | %undefine with_dist_kernel | |
9 | %endif | |
10 | %if "%{_alt_kernel}" != "%{nil}" | |
11 | %undefine with_userspace | |
12 | %endif | |
13 | %if %{without userspace} | |
14 | # nothing to be placed to debuginfo package | |
15 | %define _enable_debug_packages 0 | |
16 | %endif | |
17 | ||
18 | %define rel 3 | |
19 | Summary: Additional extensions for xtables packet filtering system | |
20 | Summary(pl.UTF-8): Dodatkowe rozszerzenia do systemu filtrowania pakietów xtables | |
21 | Name: xtables-addons | |
22 | Version: 1.38 | |
23 | Release: %{rel} | |
24 | License: GPL v2 | |
25 | Group: Networking/Admin | |
26 | Source0: http://downloads.sourceforge.net/xtables-addons/%{name}-%{version}.tar.xz | |
27 | # Source0-md5: 6a69e9931e2392348c8674af1f2fc056 | |
28 | Patch0: %{name}-build.patch | |
29 | URL: http://xtables-addons.sourceforge.net/ | |
30 | BuildRequires: autoconf >= 2.50 | |
31 | BuildRequires: automake >= 1:1.11 | |
32 | BuildRequires: iptables-devel >= 1.4.3 | |
33 | %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.29} | |
34 | BuildRequires: libtool | |
35 | BuildRequires: pkgconfig >= 0.9.0 | |
36 | BuildRequires: rpmbuild(macros) >= 1.379 | |
37 | BuildRequires: tar >= 1.22 | |
38 | BuildRequires: xz | |
39 | Requires: iptables >= 1.4.3 | |
40 | Obsoletes: ipset | |
41 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
42 | ||
43 | # use macro, so adapter won't try to wrap | |
44 | %define kpackage kernel%{_alt_kernel}-net-xtables-addons = %{version}-%{rel}@%{_kernel_ver_str} | |
45 | ||
46 | %description | |
47 | xtables-addons is the proclaimed successor to patch-o-matic(-ng). It | |
48 | contains extensions that were not accepted in the main | |
49 | xtables/iptables package. | |
50 | ||
51 | For the tools to work, you should install kernel modules, which could | |
52 | be found in %{kpackage}. | |
53 | ||
54 | %description -l pl.UTF-8 | |
55 | xtables-addons to następca patch-o-matic(-ng). Zawiera rozszerzenia, | |
56 | które nie zostały zaakceptowane do głównego pakietu xtables/iptables. | |
57 | ||
58 | Aby narzędzia działały należy zainstalować moduły jądra, które można | |
59 | znaleźć w pakiecie %{kpackage}. | |
60 | ||
61 | %package -n kernel%{_alt_kernel}-net-xtables-addons | |
62 | Summary: Kernel modules for xtables addons | |
63 | Summary(pl.UTF-8): Moudły jądra dla rozszerzeń z pakietu xtables-addons | |
64 | Release: %{rel}@%{_kernel_ver_str} | |
65 | Group: Base/Kernel | |
66 | # VERSION only dependency is intentional, for allowing multiple kernel pkgs and | |
67 | # single userspace package installs. | |
68 | Requires: %{name} = %{version} | |
69 | Suggests: xtables-geoip | |
70 | Conflicts: xtables-geoip < 20090901-2 | |
71 | %{?with_dist_kernel:%requires_releq_kernel} | |
72 | Requires(post,postun): /sbin/depmod | |
73 | ||
74 | %description -n kernel%{_alt_kernel}-net-xtables-addons | |
75 | Kernel modules for xtables addons. | |
76 | ||
77 | %description -n kernel%{_alt_kernel}-net-xtables-addons -l pl.UTF-8 | |
78 | Moduły jądra dla rozszerzeń z pakietu xtables-addons. | |
79 | ||
80 | %prep | |
81 | %setup -q | |
82 | %patch0 -p1 | |
83 | ||
84 | %{__sed} -i -e 's#build_ipset4=m#build_ipset4=#' mconfig | |
85 | ||
86 | %build | |
87 | %{__libtoolize} | |
88 | %{__aclocal} | |
89 | %{__autoconf} | |
90 | %{__autoheader} | |
91 | %{__automake} | |
92 | %configure \ | |
93 | --without-kbuild | |
94 | ||
95 | %if %{with kernel} | |
96 | srcdir=${PWD:-$(pwd)} | |
97 | %build_kernel_modules V=1 XA_ABSTOPSRCDIR=$srcdir -C extensions -m compat_xtables | |
98 | %endif | |
99 | ||
100 | %if %{with userspace} | |
101 | %{__make} \ | |
102 | V=1 | |
103 | %endif | |
104 | ||
105 | %install | |
106 | rm -rf $RPM_BUILD_ROOT | |
107 | ||
108 | %if %{with kernel} | |
109 | install -d $RPM_BUILD_ROOT{/etc/modprobe.d,/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter} | |
110 | cd extensions | |
111 | install iptable_rawpost.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter | |
112 | %install_kernel_modules -m compat_xtables -d kernel/net/netfilter | |
113 | install -p {ACCOUNT/,pknock/,}xt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/netfilter | |
114 | cd .. | |
115 | ||
116 | cat <<'EOF' > $RPM_BUILD_ROOT/etc/modprobe.d/xt_sysrq.conf | |
117 | # Set password at modprobe time. This file is secure if properly guarded, | |
118 | # i.e only readable by root. | |
119 | #options xt_SYSRQ password=cookies | |
120 | ||
121 | # The hash algorithm can also be specified as a module option, for example, to use SHA-256 instead of the default SHA-1: | |
122 | #options xt_SYSRQ hash=sha256 | |
123 | EOF | |
124 | %endif | |
125 | ||
126 | %if %{with userspace} | |
127 | %{__make} -C extensions install \ | |
128 | DESTDIR=$RPM_BUILD_ROOT | |
129 | ||
130 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libxt_ACCOUNT_cl.{la,so} | |
131 | ||
132 | install -d $RPM_BUILD_ROOT%{_mandir}/man8 | |
133 | cp -a xtables-addons.8 $RPM_BUILD_ROOT%{_mandir}/man8 | |
134 | %endif | |
135 | ||
136 | %clean | |
137 | rm -rf $RPM_BUILD_ROOT | |
138 | ||
139 | %post -p /sbin/ldconfig | |
140 | %postun -p /sbin/ldconfig | |
141 | ||
142 | %post -n kernel%{_alt_kernel}-net-xtables-addons | |
143 | %depmod %{_kernel_ver} | |
144 | ||
145 | %postun -n kernel%{_alt_kernel}-net-xtables-addons | |
146 | %depmod %{_kernel_ver} | |
147 | ||
148 | %if %{with userspace} | |
149 | %files | |
150 | %defattr(644,root,root,755) | |
151 | %doc README doc/{README.psd,changelog.txt} | |
152 | %attr(755,root,root) %{_sbindir}/ipset | |
153 | %attr(755,root,root) %{_sbindir}/iptaccount | |
154 | %attr(755,root,root) %{_libdir}/libxt_ACCOUNT_cl.so.*.*.* | |
155 | %attr(755,root,root) %ghost %{_libdir}/libxt_ACCOUNT_cl.so.0 | |
156 | %attr(755,root,root) %{_libdir}/xtables/libxt_*.so | |
157 | %attr(755,root,root) %{_libdir}/libipset.so.* | |
158 | %{_mandir}/man8/ipset.8* | |
159 | %{_mandir}/man8/iptaccount.8* | |
160 | %{_mandir}/man8/xtables-addons.8* | |
161 | %endif | |
162 | ||
163 | %if %{with kernel} | |
164 | %files -n kernel%{_alt_kernel}-net-xtables-addons | |
165 | %defattr(644,root,root,755) | |
166 | # restricted permissions - may contain password | |
167 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/xt_sysrq.conf | |
168 | /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/iptable_rawpost.ko.gz | |
169 | /lib/modules/%{_kernel_ver}/kernel/net/netfilter/compat_xtables.ko.gz | |
170 | /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_*.ko.gz | |
171 | %endif |