]> git.pld-linux.org Git - packages/ipset.git/blob - ipset.spec
- release 6
[packages/ipset.git] / ipset.spec
1 #
2 # TODO:
3 #       - patch our kernel to provide the needed API and update
4 #         the dependencies here
5 #
6 # Conditional build:
7 %bcond_without  dist_kernel     # allow non-distribution kernel
8 %bcond_without  kernel          # don't build kernel modules
9 %bcond_without  userspace       # don't build userspace tools
10 %bcond_with     verbose         # verbose build (V=1)
11
12 %if %{without kernel}
13 %undefine       with_dist_kernel
14 %endif
15 %if "%{_alt_kernel}" != "%{nil}"
16 %undefine       with_userspace
17 %endif
18 %if %{without userspace}
19 # nothing to be placed to debuginfo package
20 %define         _enable_debug_packages  0
21 %endif
22
23 %define         rel     6
24 %define         pname   ipset
25 Summary:        IP sets utility
26 Summary(pl.UTF-8):      Narzędzie do zarządzania zbiorami IP
27 Name:           %{pname}%{_alt_kernel}
28 Version:        6.11
29 Release:        %{rel}
30 License:        GPL v2
31 Group:          Networking/Admin
32 #Source0Download: http://ipset.netfilter.org/install.html
33 Source0:        http://ipset.netfilter.org/%{pname}-%{version}.tar.bz2
34 # Source0-md5:  bfcc92e30a0fcf10ae6e7c4affa03c84
35 Source1:        %{pname}.init
36 Patch0:         %{pname}-no_kernel.patch
37 Patch1:         %{pname}-hash-net-if-fix.patch
38 Patch2:         %{pname}-kernel-3.3.patch
39 Patch3:         %{pname}-kernel-3.0.patch
40 URL:            http://ipset.netfilter.org/
41 BuildRequires:  autoconf >= 2.50
42 BuildRequires:  automake
43 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.38.6}
44 BuildRequires:  libmnl-devel >= 1
45 BuildRequires:  libtool
46 %{?with_userspace:BuildRequires:        linux-libc-headers >= 7:2.6.38.6}
47 BuildRequires:  pkgconfig
48 BuildRequires:  rpmbuild(macros) >= 1.583
49 Suggests:       kernel-net-ipset
50 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51
52 # unresolved ipset_errcode, defined in the ipset binary
53 %define         skip_post_check_so      libipset\.so.*
54
55 %description
56 IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
57 can be administered by the ipset utility. Depending on the type,
58 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
59 IP addresses with MAC addresses in a way, which ensures lightning
60 speed when matching an entry against a set.
61
62 %description -l pl.UTF-8
63 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
64 administrować przy użyciu narzędzia ipset. W zależności od
65 rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery
66 portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób
67 zapewniający maksymalną szybkość przy dopasowywaniu elementu do
68 zbioru.
69
70 %package devel
71 Summary:        Header files for ipset interface
72 Summary(pl.UTF-8):      Pliki nagłówkowe do interfejsu ipset
73 Group:          Development/Libraries
74 Requires:       %{name} = %{version}-%{release}
75 Requires:       libmnl-devel >= 1
76
77 %description devel
78 Header files for IPset interface.
79
80 %description devel -l pl.UTF-8
81 Pliki nagłówkowe do interfejsu IPset.
82
83 %package static
84 Summary:        Static ipset interface library
85 Summary(pl.UTF-8):      Biblioteka statyczna interfejsu ipset
86 Group:          Development/Libraries
87 Requires:       %{name}-devel = %{version}-%{release}
88
89 %description static
90 Static IPset interface library.
91
92 %description static -l pl.UTF-8
93 Biblioteka statyczna interfejsu IPset.
94
95 %package init
96 Summary:        IPset init script
97 Summary(pl.UTF-8):      Skrypt startowy IPset
98 Group:          Networking/Admin
99 Requires(post,preun):   /sbin/chkconfig
100 Requires:       %{pname} = %{version}-%{release}
101 Requires:       rc-scripts
102
103 %description init
104 IPset initialization script.
105
106 %description init -l pl.UTF-8
107 Skrypt startowy IPset.
108
109 %package -n kernel%{_alt_kernel}-net-ipset
110 Summary:        IPset kernel modules
111 Summary(pl.UTF-8):      Moduły jądra oferujące wsparcie dla zbiorów IP
112 Release:        %{rel}@%{_kernel_ver_str}
113 Group:          Base/Kernel
114 %{?with_dist_kernel:%requires_releq_kernel}
115 Requires(post,postun):  /sbin/depmod
116
117 %description -n kernel%{_alt_kernel}-net-ipset
118 IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
119 can be administered by the ipset utility. Depending on the type,
120 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
121 IP addresses with MAC addresses in a way, which ensures lightning
122 speed when matching an entry against a set.
123
124 This package contains kernel modules.
125
126 %description -n kernel%{_alt_kernel}-net-ipset -l pl.UTF-8
127 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
128 administrować przy użyciu narzędzia ipset. W zależności od
129 rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery
130 portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób
131 zapewniający maksymalną szybkość przy dopasowywaniu elementu do
132 zbioru.
133
134 Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP.
135
136 %prep
137 %setup -q -n %{pname}-%{version}
138 %{!?with_kernel:%patch0 -p1}
139 %patch1 -p1
140 %patch2 -p1
141 %patch3 -p1
142
143 %build
144 %{__libtoolize}
145 %{__aclocal} -I m4
146 %{__autoconf}
147 %{__autoheader}
148 %{__automake}
149 %configure \
150         --with-kbuild=%{_kernelsrcdir}
151
152 %if %{with userspace}
153 %{__make}
154 %endif
155
156 %if %{with kernel}
157 # a hack not to list all modules: list only ip_set, all other are build anyway
158 %build_kernel_modules -C kernel/net/netfilter -m ipset/ip_set IP_SET_MAX=255 KDIR=$PWD/../..
159 %endif
160
161 %install
162 rm -rf $RPM_BUILD_ROOT
163
164 %if %{with userspace}
165 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}/libipset}
166
167 %{__make} install \
168         DESTDIR=$RPM_BUILD_ROOT
169 cp include/libipset/*.h $RPM_BUILD_ROOT%{_includedir}/libipset
170
171 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname}
172 %endif
173
174 %if %{with kernel}
175 cd kernel/net/netfilter
176 %install_kernel_modules -m ipset/ip_set -d kernel/net/ipv4/netfilter/ipset
177 install -p ipset/ip_set_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset
178 install -p xt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
179 cd -
180 %endif
181
182 %clean
183 rm -rf $RPM_BUILD_ROOT
184
185 %post init
186 /sbin/chkconfig --add %{pname}
187
188 %preun init
189 if [ "$1" = "0" ]; then
190         /sbin/chkconfig --del %{pname}
191 fi
192
193 %post   -n kernel%{_alt_kernel}-net-ipset
194 %depmod %{_kernel_ver}
195
196 %postun -n kernel%{_alt_kernel}-net-ipset
197 %depmod %{_kernel_ver}
198
199 %if %{with userspace}
200 %files
201 %defattr(644,root,root,755)
202 %doc ChangeLog ChangeLog.ippool README UPGRADE
203 %attr(755,root,root) %{_sbindir}/ipset
204 %attr(755,root,root) %{_libdir}/libipset.so.*.*.*
205 %attr(755,root,root) %ghost %{_libdir}/libipset.so.2
206 %{_mandir}/man8/ipset.8*
207
208 %files devel
209 %defattr(644,root,root,755)
210 %attr(755,root,root) %{_libdir}/libipset.so
211 %{_libdir}/libipset.la
212 %{_includedir}/libipset
213
214 %files static
215 %defattr(644,root,root,755)
216 %{_libdir}/libipset.a
217
218 %files init
219 %defattr(644,root,root,755)
220 %attr(754,root,root) /etc/rc.d/init.d/ipset
221 %endif
222
223 %if %{with kernel}
224 %files -n kernel%{_alt_kernel}-net-ipset
225 %defattr(644,root,root,755)
226 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/xt_*.ko*
227 %dir /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset
228 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set.ko*
229 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set_*.ko*
230 %endif
This page took 0.127436 seconds and 4 git commands to generate.