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