]> git.pld-linux.org Git - packages/xtables-addons.git/blob - xtables-addons.spec
- updated to 1.47.1 with a fix for DNETMAP for linux 3.7
[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
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     1
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.47.1
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:  92b9fc72980f9046622446d451296994
29 Patch0:         %{name}-DNETMAP.patch
30 URL:            http://xtables-addons.sourceforge.net/
31 BuildRequires:  autoconf >= 2.65
32 BuildRequires:  automake >= 1:1.11
33 BuildRequires:  iptables-devel >= 1.4.5
34 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.32}
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.5
41 Obsoletes:      iptables-ipp2p
42 BuildRoot:      %{tmpdir}/%{pname}-%{version}-root-%(id -u -n)
43
44 # use macro, so adapter won't try to wrap
45 %define         kpackage        kernel%{_alt_kernel}-net-xtables-addons = %{version}-%{rel}@%{_kernel_ver_str}
46
47 %description
48 xtables-addons is the proclaimed successor to patch-o-matic(-ng). It
49 contains extensions that were not accepted in the main
50 xtables/iptables package.
51
52 For the tools to work, you should install kernel modules, which could
53 be found in %{kpackage}.
54
55 %description -l pl.UTF-8
56 xtables-addons to następca patch-o-matic(-ng). Zawiera rozszerzenia,
57 które nie zostały zaakceptowane do głównego pakietu xtables/iptables.
58
59 Aby narzędzia działały należy zainstalować moduły jądra, które można
60 znaleźć w pakiecie %{kpackage}.
61
62 %package -n kernel%{_alt_kernel}-net-xtables-addons
63 Summary:        Kernel modules for xtables addons
64 Summary(pl.UTF-8):      Moudły jądra dla rozszerzeń z pakietu xtables-addons
65 Release:        %{rel}@%{_kernel_ver_str}
66 Group:          Base/Kernel
67 # VERSION only dependency is intentional, for allowing multiple kernel pkgs and
68 # single userspace package installs.
69 Requires:       %{pname} = %{version}
70 Suggests:       xtables-geoip
71 Conflicts:      xtables-geoip < 20090901-2
72 %{?with_dist_kernel:%requires_releq_kernel}
73 Requires(post,postun):  /sbin/depmod
74
75 %description -n kernel%{_alt_kernel}-net-xtables-addons
76 Kernel modules for xtables addons.
77
78 %description -n kernel%{_alt_kernel}-net-xtables-addons -l pl.UTF-8
79 Moduły jądra dla rozszerzeń z pakietu xtables-addons.
80
81 %prep
82 %setup -q -n %{pname}-%{version}
83 %patch0 -p1
84
85 %build
86 %{__libtoolize}
87 %{__aclocal}
88 %{__autoconf}
89 %{__autoheader}
90 %{__automake}
91 %configure \
92         --without-kbuild
93
94 %if %{with kernel}
95 srcdir=${PWD:-$(pwd)}
96 %build_kernel_modules V=1 XA_ABSTOPSRCDIR=$srcdir -C extensions -m compat_xtables
97 %endif
98
99 %if %{with userspace}
100 %{__make} \
101         V=1
102 %endif
103
104 %install
105 rm -rf $RPM_BUILD_ROOT
106
107 %if %{with kernel}
108 install -d $RPM_BUILD_ROOT{/etc/modprobe.d,/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter}
109 cd extensions
110 install iptable_rawpost.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
111 %install_kernel_modules -m compat_xtables -d kernel/net/netfilter
112 install -p {ACCOUNT/,pknock/,}xt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/netfilter
113 cd ..
114
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, to use SHA-256 instead of the default SHA-1:
121 #options xt_SYSRQ hash=sha256
122 EOF
123 %endif
124
125 %if %{with userspace}
126 %{__make} -C extensions install \
127         DESTDIR=$RPM_BUILD_ROOT
128 %{__make} install-man \
129         DESTDIR=$RPM_BUILD_ROOT
130
131 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libxt_ACCOUNT_cl.{la,so}
132 %endif
133
134 %clean
135 rm -rf $RPM_BUILD_ROOT
136
137 %post   -p /sbin/ldconfig
138 %postun -p /sbin/ldconfig
139
140 %post -n kernel%{_alt_kernel}-net-xtables-addons
141 %depmod %{_kernel_ver}
142
143 %postun -n kernel%{_alt_kernel}-net-xtables-addons
144 %depmod %{_kernel_ver}
145
146 %if %{with userspace}
147 %files
148 %defattr(644,root,root,755)
149 %doc README doc/{README.psd,changelog.txt}
150 %attr(755,root,root) %{_sbindir}/iptaccount
151 %attr(755,root,root) %{_libdir}/libxt_ACCOUNT_cl.so.*.*.*
152 %attr(755,root,root) %ghost %{_libdir}/libxt_ACCOUNT_cl.so.0
153 %attr(755,root,root) %{_libdir}/xtables/libxt_*.so
154 %{_mandir}/man8/iptaccount.8*
155 %{_mandir}/man8/xtables-addons.8*
156 %endif
157
158 %if %{with kernel}
159 %files -n kernel%{_alt_kernel}-net-xtables-addons
160 %defattr(644,root,root,755)
161 # restricted permissions - may contain password
162 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/xt_sysrq.conf
163 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/iptable_rawpost.ko.gz
164 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/compat_xtables.ko.gz
165 /lib/modules/%{_kernel_ver}/kernel/net/netfilter/xt_*.ko.gz
166 %endif
This page took 0.039188 seconds and 3 git commands to generate.