]>
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 10 | |
19 | %define pname xtables-addons | |
20 | Summary: Additional extensions for xtables packet filtering system | |
21 | Summary(pl.UTF-8): Dodatkowe rozszerzenia do systemu filtrowania pakietów xtables | |
22 | Name: %{pname}%{_alt_kernel} | |
23 | Version: 1.42 | |
24 | Release: %{rel} | |
25 | License: GPL v2 | |
26 | Group: Networking/Admin | |
27 | Source0: http://downloads.sourceforge.net/xtables-addons/%{pname}-%{version}.tar.xz | |
28 | # Source0-md5: 7c996a0400667b57ab4fb53a013ae742 | |
29 | URL: http://xtables-addons.sourceforge.net/ | |
30 | BuildRequires: autoconf >= 2.65 | |
31 | BuildRequires: automake >= 1:1.11 | |
32 | BuildRequires: iptables-devel >= 1.4.5 | |
33 | %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.32} | |
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.5 | |
40 | Obsoletes: iptables-ipp2p | |
41 | BuildRoot: %{tmpdir}/%{pname}-%{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: %{pname} = %{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 -n %{pname}-%{version} | |
82 | ||
83 | %build | |
84 | %{__libtoolize} | |
85 | %{__aclocal} | |
86 | %{__autoconf} | |
87 | %{__autoheader} | |
88 | %{__automake} | |
89 | %configure \ | |
90 | --without-kbuild | |
91 | ||
92 | %if %{with kernel} | |
93 | srcdir=${PWD:-$(pwd)} | |
94 | %build_kernel_modules V=1 XA_ABSTOPSRCDIR=$srcdir -C extensions -m compat_xtables | |
95 | %endif | |
96 | ||
97 | %if %{with userspace} | |
98 | %{__make} \ | |
99 | V=1 | |
100 | %endif | |
101 | ||
102 | %install | |
103 | rm -rf $RPM_BUILD_ROOT | |
104 | ||
105 | %if %{with kernel} | |
106 | install -d $RPM_BUILD_ROOT{/etc/modprobe.d,/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter} | |
107 | cd extensions | |
108 | install iptable_rawpost.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter | |
109 | %install_kernel_modules -m compat_xtables -d kernel/net/netfilter | |
110 | install -p {ACCOUNT/,pknock/,}xt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/netfilter | |
111 | cd .. | |
112 | ||
113 | cat <<'EOF' > $RPM_BUILD_ROOT/etc/modprobe.d/xt_sysrq.conf | |
114 | # Set password at modprobe time. This file is secure if properly guarded, | |
115 | # i.e only readable by root. | |
116 | #options xt_SYSRQ password=cookies | |
117 | ||
118 | # The hash algorithm can also be specified as a module option, for example, to use SHA-256 instead of the default SHA-1: | |
119 | #options xt_SYSRQ hash=sha256 | |
120 | EOF | |
121 | %endif | |
122 | ||
123 | %if %{with userspace} | |
124 | %{__make} -C extensions install \ | |
125 | DESTDIR=$RPM_BUILD_ROOT | |
126 | %{__make} install-man \ | |
127 | DESTDIR=$RPM_BUILD_ROOT | |
128 | ||
129 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libxt_ACCOUNT_cl.{la,so} | |
130 | %endif | |
131 | ||
132 | %clean | |
133 | rm -rf $RPM_BUILD_ROOT | |
134 | ||
135 | %post -p /sbin/ldconfig | |
136 | %postun -p /sbin/ldconfig | |
137 | ||
138 | %post -n kernel%{_alt_kernel}-net-xtables-addons | |
139 | %depmod %{_kernel_ver} | |
140 | ||
141 | %postun -n kernel%{_alt_kernel}-net-xtables-addons | |
142 | %depmod %{_kernel_ver} | |
143 | ||
144 | %if %{with userspace} | |
145 | %files | |
146 | %defattr(644,root,root,755) | |
147 | %doc README doc/{README.psd,changelog.txt} | |
148 | %attr(755,root,root) %{_sbindir}/iptaccount | |
149 | %attr(755,root,root) %{_libdir}/libxt_ACCOUNT_cl.so.*.*.* | |
150 | %attr(755,root,root) %ghost %{_libdir}/libxt_ACCOUNT_cl.so.0 | |
151 | %attr(755,root,root) %{_libdir}/xtables/libxt_*.so | |
152 | %{_mandir}/man8/iptaccount.8* | |
153 | %{_mandir}/man8/xtables-addons.8* | |
154 | %endif | |
155 | ||
156 | %if %{with kernel} | |
157 | %files -n kernel%{_alt_kernel}-net-xtables-addons | |
158 | %defattr(644,root,root,755) | |
159 | # restricted permissions - may contain password | |
160 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/xt_sysrq.conf | |
161 | /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/iptable_rawpost.ko.gz | |
162 | /lib/modules/%{_kernel_ver}/kernel/net/netfilter/compat_xtables.ko.gz | |
163 | /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_*.ko.gz | |
164 | %endif |