]> git.pld-linux.org Git - packages/ipset.git/blame - ipset.spec
- added fixes from upstream git to allow building with kernel 5.13, rel 2
[packages/ipset.git] / ipset.spec
CommitLineData
bc9c8d01 1#
13648ed2
JK
2# TODO:
3# - patch our kernel to provide the needed API and update
4# the dependencies here
5#
3bc59268 6# Conditional build:
3bc59268
PS
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
22898ccc
JR
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}
17exit 1
18%endif
19
d33761e1
ER
20%if %{without userspace}
21# nothing to be placed to debuginfo package
22%define _enable_debug_packages 0
23%endif
3bc59268 24
67259089 25%define rel 2
5b36c760 26%define pname ipset
bc9c8d01 27Summary: IP sets utility
cb832b79 28Summary(pl.UTF-8): Narzędzie do zarządzania zbiorami IP
c5b122e9 29Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
0c7b3260 30Version: 7.11
c5b122e9 31Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
6312651c 32License: GPL v2
bc9c8d01 33Group: Networking/Admin
6312651c 34#Source0Download: http://ipset.netfilter.org/install.html
5b36c760 35Source0: http://ipset.netfilter.org/%{pname}-%{version}.tar.bz2
0c7b3260 36# Source0-md5: 7c17aca72bcf852f5bc95582aaa60408
5b36c760 37Source1: %{pname}.init
67259089 38Patch0: git.patch
bc9c8d01 39URL: http://ipset.netfilter.org/
5f144668 40BuildRequires: autoconf >= 2.63
7e0de454 41BuildRequires: automake
64473438 42BuildRequires: libltdl-devel >= 2:2.0
67259089 43BuildRequires: libmnl-devel >= 1
db888aec 44BuildRequires: libtool >= 2:2.0
6312651c 45%{?with_userspace:BuildRequires: linux-libc-headers >= 7:2.6.38.6}
2bf78421 46BuildRequires: pkgconfig
31575a1c 47BuildRequires: rpmbuild(macros) >= 1.701
d2abbe0b 48%{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.24}}
2a7f4757 49Suggests: kernel-net-ipset
bc9c8d01
JK
50BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51
13648ed2
JK
52# unresolved ipset_errcode, defined in the ipset binary
53%define skip_post_check_so libipset\.so.*
54
bc9c8d01
JK
55%description
56IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
57can be administered by the ipset utility. Depending on the type,
58currently an IP set may store IP addresses, (TCP/UDP) port numbers or
59IP addresses with MAC addresses in a way, which ensures lightning
60speed when matching an entry against a set.
61
00760b7e
JR
62%description -l pl.UTF-8
63Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
67259089
JR
64administrować przy użyciu narzędzia ipset. W zależności od rodzaju
65aktualnie 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
67maksymalną szybkość przy dopasowywaniu elementu do zbioru.
9e9bc01b 68
40d655f1 69%package devel
e791bf9d 70Summary: Header files for ipset interface
cb832b79 71Summary(pl.UTF-8): Pliki nagłówkowe do interfejsu ipset
f62f2152 72Group: Development/Libraries
6312651c 73Requires: %{name} = %{version}-%{release}
8aa8458e 74Requires: libmnl-devel >= 1
40d655f1 75
76%description devel
3bc59268 77Header files for IPset interface.
40d655f1 78
00760b7e 79%description devel -l pl.UTF-8
3bc59268 80Pliki nagłówkowe do interfejsu IPset.
40d655f1 81
13648ed2
JK
82%package static
83Summary: Static ipset interface library
84Summary(pl.UTF-8): Biblioteka statyczna interfejsu ipset
85Group: Development/Libraries
86Requires: %{name}-devel = %{version}-%{release}
87
88%description static
89Static IPset interface library.
90
91%description static -l pl.UTF-8
92Biblioteka statyczna interfejsu IPset.
93
12667538 94%package init
a264566a
JB
95Summary: IPset init script
96Summary(pl.UTF-8): Skrypt startowy IPset
12667538 97Group: Networking/Admin
12667538 98Requires(post,preun): /sbin/chkconfig
a264566a 99Requires: %{pname} = %{version}-%{release}
af1d549a 100Requires: rc-scripts
12667538
PS
101
102%description init
3bc59268
PS
103IPset initialization script.
104
a264566a
JB
105%description init -l pl.UTF-8
106Skrypt startowy IPset.
107
ab2b1724
JB
108%package -n bash-completion-ipset
109Summary: Bash completion for ipset command
110Summary(pl.UTF-8): Bashowe dopełnianie parametrów polecenia ipset
111Group: Applications/Shells
112Requires: %{pname} = %{version}-%{release}
113Requires: bash-completion >= 2.0
114
115%description -n bash-completion-ipset
116Bash completion for ipset command.
117
118%description -n bash-completion-ipset -l pl.UTF-8
119Bashowe dopełnianie parametrów polecenia ipset.
120
22898ccc
JR
121%define kernel_pkg()\
122%package -n kernel%{_alt_kernel}-net-ipset\
123Summary: IPset kernel modules\
124Summary(pl.UTF-8): Moduły jądra oferujące wsparcie dla zbiorów IP\
125Release: %{rel}@%{_kernel_ver_str}\
126Group: Base/Kernel\
22898ccc 127Requires(post,postun): /sbin/depmod\
31575a1c
JR
128%requires_releq_kernel\
129Requires(postun): %releq_kernel\
22898ccc
JR
130\
131%description -n kernel%{_alt_kernel}-net-ipset\
132IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which\
133can be administered by the ipset utility. Depending on the type,\
134currently an IP set may store IP addresses, (TCP/UDP) port numbers or\
135IP addresses with MAC addresses in a way, which ensures lightning\
136speed when matching an entry against a set.\
137\
138This package contains kernel modules.\
139\
140%description -n kernel%{_alt_kernel}-net-ipset -l pl.UTF-8\
141Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można\
142administrować przy użyciu narzędzia ipset. W zależności od\
143rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery\
144portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób\
145zapewniający maksymalną szybkość przy dopasowywaniu elementu do\
146zbioru.\
147\
148Ten 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\
176for 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\
178done\
179for drv in kernel/net/netfilter/xt_*.ko ; do\
180%install_kernel_modules -D installed -m ${drv%.ko} -d kernel/net/ipv4/netfilter\
181done\
182%{nil}
183
31575a1c 184%{?with_kernel:%{expand:%create_kernel_packages}}
12667538 185
bc9c8d01 186%prep
5b36c760 187%setup -q -n %{pname}-%{version}
67259089 188%patch0 -p1
fffbab59 189
bc9c8d01 190%build
a62cbe33
JR
191%{__aclocal}
192%{__autoconf}
193%{__autoheader}
194%{__automake}
22898ccc 195%if %{with userspace}
ab2b1724
JB
196install -d build-usr
197cd build-usr
198../%configure \
199 bashcompdir=%{bash_compdir} \
200 --enable-bashcompl \
db888aec 201 --disable-silent-rules \
22898ccc 202 --with-kmod=no \
1e8acbaa 203 --with-settype-modules-list=all
7e0de454 204
13648ed2 205%{__make}
ab2b1724 206cd ..
3bc59268
PS
207%endif
208
31575a1c 209%{?with_kernel:%{expand:%build_kernel_packages}}
bc9c8d01
JK
210
211%install
212rm -rf $RPM_BUILD_ROOT
3bc59268
PS
213
214%if %{with userspace}
13648ed2 215install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}/libipset}
bc9c8d01 216
ab2b1724 217%{__make} -C build-usr install \
13648ed2 218 DESTDIR=$RPM_BUILD_ROOT
e791bf9d 219
fffbab59 220install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname}
3bc59268
PS
221%endif
222
223%if %{with kernel}
22898ccc
JR
224install -d $RPM_BUILD_ROOT
225cp -a installed/* $RPM_BUILD_ROOT
3bc59268 226%endif
12667538 227
bc9c8d01
JK
228%clean
229rm -rf $RPM_BUILD_ROOT
230
12667538 231%post init
5b36c760 232/sbin/chkconfig --add %{pname}
12667538
PS
233
234%preun init
235if [ "$1" = "0" ]; then
5b36c760 236 /sbin/chkconfig --del %{pname}
12667538
PS
237fi
238
3bc59268 239%if %{with userspace}
bc9c8d01
JK
240%files
241%defattr(644,root,root,755)
13648ed2 242%doc ChangeLog ChangeLog.ippool README UPGRADE
de6c94a7 243%attr(755,root,root) %{_sbindir}/ipset
67259089 244%attr(755,root,root) %{_sbindir}/ipset-translate
6312651c 245%attr(755,root,root) %{_libdir}/libipset.so.*.*.*
21871c33 246%attr(755,root,root) %ghost %{_libdir}/libipset.so.13
de6c94a7 247%{_mandir}/man8/ipset.8*
67259089
JR
248%{_mandir}/man8/ipset-translate.8*
249
40d655f1 250
251%files devel
252%defattr(644,root,root,755)
13648ed2 253%attr(755,root,root) %{_libdir}/libipset.so
6312651c
JB
254%{_libdir}/libipset.la
255%{_includedir}/libipset
1e8acbaa 256%{_pkgconfigdir}/libipset.pc
67259089 257%{_mandir}/man3/libipset.3*
13648ed2
JK
258
259%files static
260%defattr(644,root,root,755)
261%{_libdir}/libipset.a
12667538
PS
262
263%files init
264%defattr(644,root,root,755)
a264566a 265%attr(754,root,root) /etc/rc.d/init.d/ipset
ab2b1724
JB
266
267%files -n bash-completion-ipset
268%defattr(644,root,root,755)
269%{bash_compdir}/ipset
3bc59268 270%endif
This page took 0.111061 seconds and 4 git commands to generate.