]> git.pld-linux.org Git - packages/ipset.git/blob - ipset.spec
- added fixes from upstream git to allow building with kernel 5.13, rel 2
[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  kernel          # don't build kernel modules
8 %bcond_without  userspace       # don't build userspace tools
9 %bcond_with     verbose         # verbose build (V=1)
10
11 # The goal here is to have main, userspace, package built once with
12 # simple release number, and only rebuild kernel packages with kernel
13 # version as part of release number, without the need to bump release
14 # with every kernel change.
15 %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
16 %{error:kernel and userspace cannot be built at the same time on PLD builders}
17 exit 1
18 %endif
19
20 %if %{without userspace}
21 # nothing to be placed to debuginfo package
22 %define         _enable_debug_packages  0
23 %endif
24
25 %define         rel     2
26 %define         pname   ipset
27 Summary:        IP sets utility
28 Summary(pl.UTF-8):      Narzędzie do zarządzania zbiorami IP
29 Name:           %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
30 Version:        7.11
31 Release:        %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
32 License:        GPL v2
33 Group:          Networking/Admin
34 #Source0Download: http://ipset.netfilter.org/install.html
35 Source0:        http://ipset.netfilter.org/%{pname}-%{version}.tar.bz2
36 # Source0-md5:  7c17aca72bcf852f5bc95582aaa60408
37 Source1:        %{pname}.init
38 Patch0:         git.patch
39 URL:            http://ipset.netfilter.org/
40 BuildRequires:  autoconf >= 2.63
41 BuildRequires:  automake
42 BuildRequires:  libltdl-devel >= 2:2.0
43 BuildRequires:  libmnl-devel >= 1
44 BuildRequires:  libtool >= 2:2.0
45 %{?with_userspace:BuildRequires:        linux-libc-headers >= 7:2.6.38.6}
46 BuildRequires:  pkgconfig
47 BuildRequires:  rpmbuild(macros) >= 1.701
48 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.24}}
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 rodzaju
65 aktualnie zbiór IP może przechowywać adresy IP, numery portów
66 (TCP/UDP) lub adresy IP z adresami MAC - w sposób zapewniający
67 maksymalną szybkość przy dopasowywaniu elementu do zbioru.
68
69 %package devel
70 Summary:        Header files for ipset interface
71 Summary(pl.UTF-8):      Pliki nagłówkowe do interfejsu ipset
72 Group:          Development/Libraries
73 Requires:       %{name} = %{version}-%{release}
74 Requires:       libmnl-devel >= 1
75
76 %description devel
77 Header files for IPset interface.
78
79 %description devel -l pl.UTF-8
80 Pliki nagłówkowe do interfejsu IPset.
81
82 %package static
83 Summary:        Static ipset interface library
84 Summary(pl.UTF-8):      Biblioteka statyczna interfejsu ipset
85 Group:          Development/Libraries
86 Requires:       %{name}-devel = %{version}-%{release}
87
88 %description static
89 Static IPset interface library.
90
91 %description static -l pl.UTF-8
92 Biblioteka statyczna interfejsu IPset.
93
94 %package init
95 Summary:        IPset init script
96 Summary(pl.UTF-8):      Skrypt startowy IPset
97 Group:          Networking/Admin
98 Requires(post,preun):   /sbin/chkconfig
99 Requires:       %{pname} = %{version}-%{release}
100 Requires:       rc-scripts
101
102 %description init
103 IPset initialization script.
104
105 %description init -l pl.UTF-8
106 Skrypt startowy IPset.
107
108 %package -n bash-completion-ipset
109 Summary:        Bash completion for ipset command
110 Summary(pl.UTF-8):      Bashowe dopełnianie parametrów polecenia ipset
111 Group:          Applications/Shells
112 Requires:       %{pname} = %{version}-%{release}
113 Requires:       bash-completion >= 2.0
114
115 %description -n bash-completion-ipset
116 Bash completion for ipset command.
117
118 %description -n bash-completion-ipset -l pl.UTF-8
119 Bashowe dopełnianie parametrów polecenia ipset.
120
121 %define kernel_pkg()\
122 %package -n kernel%{_alt_kernel}-net-ipset\
123 Summary:        IPset kernel modules\
124 Summary(pl.UTF-8):      Moduły jądra oferujące wsparcie dla zbiorów IP\
125 Release:        %{rel}@%{_kernel_ver_str}\
126 Group:          Base/Kernel\
127 Requires(post,postun):  /sbin/depmod\
128 %requires_releq_kernel\
129 Requires(postun):       %releq_kernel\
130 \
131 %description -n kernel%{_alt_kernel}-net-ipset\
132 IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which\
133 can be administered by the ipset utility. Depending on the type,\
134 currently an IP set may store IP addresses, (TCP/UDP) port numbers or\
135 IP addresses with MAC addresses in a way, which ensures lightning\
136 speed when matching an entry against a set.\
137 \
138 This package contains kernel modules.\
139 \
140 %description -n kernel%{_alt_kernel}-net-ipset -l pl.UTF-8\
141 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można\
142 administrować przy użyciu narzędzia ipset. W zależności od\
143 rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery\
144 portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób\
145 zapewniający maksymalną szybkość przy dopasowywaniu elementu do\
146 zbioru.\
147 \
148 Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP.\
149 \
150 %if %{with kernel}\
151 %files -n kernel%{_alt_kernel}-net-ipset\
152 %defattr(644,root,root,755)\
153 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/xt_*.ko*\
154 %dir /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset\
155 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set.ko*\
156 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set_*.ko*\
157 %endif\
158 \
159 %post   -n kernel%{_alt_kernel}-net-ipset\
160 %depmod %{_kernel_ver}\
161 \
162 %postun -n kernel%{_alt_kernel}-net-ipset\
163 %depmod %{_kernel_ver}\
164 %{nil}
165
166 %define build_kernel_pkg()\
167 %configure \\\
168         --disable-silent-rules \\\
169         --with-kmod=yes \\\
170         --with-kbuild=%{_kernelsrcdir} \\\
171         --with-settype-modules-list=all\
172 \
173 # a hack not to list all modules: list only ip_set, all other are build anyway\
174 %build_kernel_modules -C kernel/net/netfilter -m ipset/ip_set IP_SET_MAX=255 KDIR=$PWD/../..\
175 \
176 for drv in kernel/net/netfilter/ipset/ip_set*.ko ; do\
177 %install_kernel_modules -D installed -m ${drv%.ko} -d kernel/net/ipv4/netfilter/ipset\
178 done\
179 for drv in kernel/net/netfilter/xt_*.ko ; do\
180 %install_kernel_modules -D installed -m ${drv%.ko} -d kernel/net/ipv4/netfilter\
181 done\
182 %{nil}
183
184 %{?with_kernel:%{expand:%create_kernel_packages}}
185
186 %prep
187 %setup -q -n %{pname}-%{version}
188 %patch0 -p1
189
190 %build
191 %{__aclocal}
192 %{__autoconf}
193 %{__autoheader}
194 %{__automake}
195 %if %{with userspace}
196 install -d build-usr
197 cd build-usr
198 ../%configure \
199         bashcompdir=%{bash_compdir} \
200         --enable-bashcompl \
201         --disable-silent-rules \
202         --with-kmod=no \
203         --with-settype-modules-list=all
204
205 %{__make}
206 cd ..
207 %endif
208
209 %{?with_kernel:%{expand:%build_kernel_packages}}
210
211 %install
212 rm -rf $RPM_BUILD_ROOT
213
214 %if %{with userspace}
215 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}/libipset}
216
217 %{__make} -C build-usr install \
218         DESTDIR=$RPM_BUILD_ROOT
219
220 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname}
221 %endif
222
223 %if %{with kernel}
224 install -d $RPM_BUILD_ROOT
225 cp -a installed/* $RPM_BUILD_ROOT
226 %endif
227
228 %clean
229 rm -rf $RPM_BUILD_ROOT
230
231 %post init
232 /sbin/chkconfig --add %{pname}
233
234 %preun init
235 if [ "$1" = "0" ]; then
236         /sbin/chkconfig --del %{pname}
237 fi
238
239 %if %{with userspace}
240 %files
241 %defattr(644,root,root,755)
242 %doc ChangeLog ChangeLog.ippool README UPGRADE
243 %attr(755,root,root) %{_sbindir}/ipset
244 %attr(755,root,root) %{_sbindir}/ipset-translate
245 %attr(755,root,root) %{_libdir}/libipset.so.*.*.*
246 %attr(755,root,root) %ghost %{_libdir}/libipset.so.13
247 %{_mandir}/man8/ipset.8*
248 %{_mandir}/man8/ipset-translate.8*
249
250
251 %files devel
252 %defattr(644,root,root,755)
253 %attr(755,root,root) %{_libdir}/libipset.so
254 %{_libdir}/libipset.la
255 %{_includedir}/libipset
256 %{_pkgconfigdir}/libipset.pc
257 %{_mandir}/man3/libipset.3*
258
259 %files static
260 %defattr(644,root,root,755)
261 %{_libdir}/libipset.a
262
263 %files init
264 %defattr(644,root,root,755)
265 %attr(754,root,root) /etc/rc.d/init.d/ipset
266
267 %files -n bash-completion-ipset
268 %defattr(644,root,root,755)
269 %{bash_compdir}/ipset
270 %endif
This page took 0.100043 seconds and 3 git commands to generate.