]> git.pld-linux.org Git - packages/xtables-addons.git/blob - xtables-addons.spec
- rebuild for kernel-3.9.9-1
[packages/xtables-addons.git] / xtables-addons.spec
1 #
2 # UPDATE WARNING: xtables-addons 2.0 support only kernels 3.7+
3 #
4 #
5 # Conditional build:
6 %bcond_without  dist_kernel     # without distribution kernel
7 %bcond_without  kernel          # don't build kernel modules
8 %bcond_without  userspace       # don't build userspace tools
9
10 %if %{without kernel}
11 %undefine       with_dist_kernel
12 %endif
13 %if "%{_alt_kernel}" != "%{nil}"
14 %undefine       with_userspace
15 %endif
16 %if %{without userspace}
17 # nothing to be placed to debuginfo package
18 %define         _enable_debug_packages  0
19 %endif
20
21 %define         rel     7
22 %define         pname   xtables-addons
23 Summary:        Additional extensions for xtables packet filtering system
24 Summary(pl.UTF-8):      Dodatkowe rozszerzenia do systemu filtrowania pakietów xtables
25 Name:           %{pname}%{_alt_kernel}
26 Version:        2.2
27 Release:        %{rel}
28 License:        GPL v2
29 Group:          Networking/Admin
30 Source0:        http://downloads.sourceforge.net/xtables-addons/%{pname}-%{version}.tar.xz
31 # Source0-md5:  bc60abaa3cacc907f646ec6f873054f5
32 URL:            http://xtables-addons.sourceforge.net/
33 BuildRequires:  autoconf >= 2.65
34 BuildRequires:  automake >= 1:1.11
35 BuildRequires:  iptables-devel >= 1.4.5
36 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:3.7}
37 BuildRequires:  libtool
38 BuildRequires:  pkgconfig >= 0.9.0
39 BuildRequires:  rpmbuild(macros) >= 1.379
40 BuildRequires:  tar >= 1.22
41 BuildRequires:  xz
42 Requires:       iptables >= 1.4.5
43 Obsoletes:      iptables-ipp2p
44 BuildRoot:      %{tmpdir}/%{pname}-%{version}-root-%(id -u -n)
45
46 # use macro, so adapter won't try to wrap
47 %define         kpackage        kernel%{_alt_kernel}-net-xtables-addons = %{version}-%{rel}@%{_kernel_ver_str}
48
49 %description
50 xtables-addons is the proclaimed successor to patch-o-matic(-ng). It
51 contains extensions that were not accepted in the main
52 xtables/iptables package.
53
54 For the tools to work, you should install kernel modules, which could
55 be found in %{kpackage}.
56
57 %description -l pl.UTF-8
58 xtables-addons to następca patch-o-matic(-ng). Zawiera rozszerzenia,
59 które nie zostały zaakceptowane do głównego pakietu xtables/iptables.
60
61 Aby narzędzia działały należy zainstalować moduły jądra, które można
62 znaleźć w pakiecie %{kpackage}.
63
64 %package -n kernel%{_alt_kernel}-net-xtables-addons
65 Summary:        Kernel modules for xtables addons
66 Summary(pl.UTF-8):      Moudły jądra dla rozszerzeń z pakietu xtables-addons
67 Release:        %{rel}@%{_kernel_ver_str}
68 Group:          Base/Kernel
69 # VERSION only dependency is intentional, for allowing multiple kernel pkgs and
70 # single userspace package installs.
71 Requires:       %{pname} = %{version}
72 Suggests:       xtables-geoip
73 Conflicts:      xtables-geoip < 20090901-2
74 %{?with_dist_kernel:%requires_releq_kernel}
75 Requires(post,postun):  /sbin/depmod
76
77 %description -n kernel%{_alt_kernel}-net-xtables-addons
78 Kernel modules for xtables addons.
79
80 %description -n kernel%{_alt_kernel}-net-xtables-addons -l pl.UTF-8
81 Moduły jądra dla rozszerzeń z pakietu xtables-addons.
82
83 %prep
84 %setup -q -n %{pname}-%{version}
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_kernel_modules -m extensions/iptable_rawpost -d kernel/net/ipv4/netfilter
110 for drv in extensions/compat_xtables.ko extensions/{ACCOUNT/,pknock/,}xt_*.ko ; do
111 %install_kernel_modules -m ${drv%.ko} -d kernel/net/netfilter
112 done
113
114 install -d $RPM_BUILD_ROOT/etc/modprobe.d
115 cat <<'EOF' > $RPM_BUILD_ROOT/etc/modprobe.d/xt_sysrq.conf
116 # Set password at modprobe time. This file is secure if properly guarded,
117 # i.e only readable by root.
118 #options xt_SYSRQ password=cookies
119
120 # The hash algorithm can also be specified as a module option, for example,
121 # 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 %{__make} install-man \
130         DESTDIR=$RPM_BUILD_ROOT
131
132 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libxt_ACCOUNT_cl.{la,so}
133 %endif
134
135 %clean
136 rm -rf $RPM_BUILD_ROOT
137
138 %post   -p /sbin/ldconfig
139 %postun -p /sbin/ldconfig
140
141 %post -n kernel%{_alt_kernel}-net-xtables-addons
142 %depmod %{_kernel_ver}
143
144 %postun -n kernel%{_alt_kernel}-net-xtables-addons
145 %depmod %{_kernel_ver}
146
147 %if %{with userspace}
148 %files
149 %defattr(644,root,root,755)
150 %doc README doc/{README.psd,changelog.txt}
151 %attr(755,root,root) %{_sbindir}/iptaccount
152 %attr(755,root,root) %{_libdir}/libxt_ACCOUNT_cl.so.*.*.*
153 %attr(755,root,root) %ghost %{_libdir}/libxt_ACCOUNT_cl.so.0
154 %attr(755,root,root) %{_libdir}/xtables/libxt_*.so
155 %{_mandir}/man8/iptaccount.8*
156 %{_mandir}/man8/xtables-addons.8*
157 %endif
158
159 %if %{with kernel}
160 %files -n kernel%{_alt_kernel}-net-xtables-addons
161 %defattr(644,root,root,755)
162 # restricted permissions - may contain password
163 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/xt_sysrq.conf
164 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/iptable_rawpost.ko.gz
165 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/compat_xtables.ko.gz
166 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_*.ko.gz
167 %endif
This page took 0.057157 seconds and 4 git commands to generate.