]> git.pld-linux.org Git - packages/ipset.git/blame - ipset.spec
- add upstream patch to fix building with linux 4.7
[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
a62cbe33 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}
7ae2f2bc 30Version: 6.29
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
7ae2f2bc 36# Source0-md5: fd8ea35997115c5c630eee22f0beecec
5b36c760 37Source1: %{pname}.init
a62cbe33 38Patch0: %{pname}-Backports-for-the-nla_put_net64-API-changes.patch
bc9c8d01 39URL: http://ipset.netfilter.org/
6312651c 40BuildRequires: autoconf >= 2.50
7e0de454 41BuildRequires: automake
8aa8458e 42BuildRequires: libmnl-devel >= 1
64473438 43BuildRequires: libltdl-devel >= 2:2.0
db888aec 44BuildRequires: libtool >= 2:2.0
6312651c 45%{?with_userspace:BuildRequires: linux-libc-headers >= 7:2.6.38.6}
2bf78421 46BuildRequires: pkgconfig
31575a1c
JR
47BuildRequires: rpmbuild(macros) >= 1.701
48%{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
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
13648ed2
JK
64administrować przy użyciu narzędzia ipset. W zależności od
65rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery
66portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób
67zapewniający maksymalną szybkość przy dopasowywaniu elementu do
68zbioru.
9e9bc01b 69
40d655f1 70%package devel
e791bf9d 71Summary: Header files for ipset interface
cb832b79 72Summary(pl.UTF-8): Pliki nagłówkowe do interfejsu ipset
f62f2152 73Group: Development/Libraries
6312651c 74Requires: %{name} = %{version}-%{release}
8aa8458e 75Requires: libmnl-devel >= 1
40d655f1 76
77%description devel
3bc59268 78Header files for IPset interface.
40d655f1 79
00760b7e 80%description devel -l pl.UTF-8
3bc59268 81Pliki nagłówkowe do interfejsu IPset.
40d655f1 82
13648ed2
JK
83%package static
84Summary: Static ipset interface library
85Summary(pl.UTF-8): Biblioteka statyczna interfejsu ipset
86Group: Development/Libraries
87Requires: %{name}-devel = %{version}-%{release}
88
89%description static
90Static IPset interface library.
91
92%description static -l pl.UTF-8
93Biblioteka statyczna interfejsu IPset.
94
12667538 95%package init
a264566a
JB
96Summary: IPset init script
97Summary(pl.UTF-8): Skrypt startowy IPset
12667538 98Group: Networking/Admin
12667538 99Requires(post,preun): /sbin/chkconfig
a264566a 100Requires: %{pname} = %{version}-%{release}
af1d549a 101Requires: rc-scripts
12667538
PS
102
103%description init
3bc59268
PS
104IPset initialization script.
105
a264566a
JB
106%description init -l pl.UTF-8
107Skrypt startowy IPset.
108
22898ccc
JR
109%define kernel_pkg()\
110%package -n kernel%{_alt_kernel}-net-ipset\
111Summary: IPset kernel modules\
112Summary(pl.UTF-8): Moduły jądra oferujące wsparcie dla zbiorów IP\
113Release: %{rel}@%{_kernel_ver_str}\
114Group: Base/Kernel\
22898ccc 115Requires(post,postun): /sbin/depmod\
31575a1c
JR
116%requires_releq_kernel\
117Requires(postun): %releq_kernel\
22898ccc
JR
118\
119%description -n kernel%{_alt_kernel}-net-ipset\
120IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which\
121can be administered by the ipset utility. Depending on the type,\
122currently an IP set may store IP addresses, (TCP/UDP) port numbers or\
123IP addresses with MAC addresses in a way, which ensures lightning\
124speed when matching an entry against a set.\
125\
126This package contains kernel modules.\
127\
128%description -n kernel%{_alt_kernel}-net-ipset -l pl.UTF-8\
129Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można\
130administrować przy użyciu narzędzia ipset. W zależności od\
131rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery\
132portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób\
133zapewniający maksymalną szybkość przy dopasowywaniu elementu do\
134zbioru.\
135\
136Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP.\
137\
138%if %{with kernel}\
139%files -n kernel%{_alt_kernel}-net-ipset\
140%defattr(644,root,root,755)\
141/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/xt_*.ko*\
142%dir /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset\
143/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set.ko*\
144/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set_*.ko*\
145%endif\
146\
147%post -n kernel%{_alt_kernel}-net-ipset\
148%depmod %{_kernel_ver}\
149\
150%postun -n kernel%{_alt_kernel}-net-ipset\
151%depmod %{_kernel_ver}\
152%{nil}
153
154%define build_kernel_pkg()\
155%configure \\\
156 --disable-silent-rules \\\
157 --with-kmod=yes \\\
158 --with-kbuild=%{_kernelsrcdir} \\\
159 --with-settype-modules-list=all\
160\
161# a hack not to list all modules: list only ip_set, all other are build anyway\
162%build_kernel_modules -C kernel/net/netfilter -m ipset/ip_set IP_SET_MAX=255 KDIR=$PWD/../..\
163\
164for drv in kernel/net/netfilter/ipset/ip_set*.ko ; do\
165%install_kernel_modules -D installed -m ${drv%.ko} -d kernel/net/ipv4/netfilter/ipset\
166done\
167for drv in kernel/net/netfilter/xt_*.ko ; do\
168%install_kernel_modules -D installed -m ${drv%.ko} -d kernel/net/ipv4/netfilter\
169done\
170%{nil}
171
31575a1c 172%{?with_kernel:%{expand:%create_kernel_packages}}
12667538 173
bc9c8d01 174%prep
5b36c760 175%setup -q -n %{pname}-%{version}
a62cbe33 176%patch0 -p1
fffbab59 177
bc9c8d01 178%build
a62cbe33
JR
179%{__aclocal}
180%{__autoconf}
181%{__autoheader}
182%{__automake}
22898ccc 183%if %{with userspace}
7e0de454 184%configure \
db888aec 185 --disable-silent-rules \
22898ccc 186 --with-kmod=no \
1e8acbaa 187 --with-settype-modules-list=all
7e0de454 188
13648ed2 189%{__make}
3bc59268
PS
190%endif
191
31575a1c 192%{?with_kernel:%{expand:%build_kernel_packages}}
bc9c8d01
JK
193
194%install
195rm -rf $RPM_BUILD_ROOT
3bc59268
PS
196
197%if %{with userspace}
13648ed2 198install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}/libipset}
bc9c8d01 199
13648ed2
JK
200%{__make} install \
201 DESTDIR=$RPM_BUILD_ROOT
202cp include/libipset/*.h $RPM_BUILD_ROOT%{_includedir}/libipset
e791bf9d 203
fffbab59 204install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname}
3bc59268
PS
205%endif
206
207%if %{with kernel}
22898ccc
JR
208install -d $RPM_BUILD_ROOT
209cp -a installed/* $RPM_BUILD_ROOT
3bc59268 210%endif
12667538 211
bc9c8d01
JK
212%clean
213rm -rf $RPM_BUILD_ROOT
214
12667538 215%post init
5b36c760 216/sbin/chkconfig --add %{pname}
12667538
PS
217
218%preun init
219if [ "$1" = "0" ]; then
5b36c760 220 /sbin/chkconfig --del %{pname}
12667538
PS
221fi
222
3bc59268 223%if %{with userspace}
bc9c8d01
JK
224%files
225%defattr(644,root,root,755)
13648ed2 226%doc ChangeLog ChangeLog.ippool README UPGRADE
de6c94a7 227%attr(755,root,root) %{_sbindir}/ipset
6312651c 228%attr(755,root,root) %{_libdir}/libipset.so.*.*.*
22898ccc 229%attr(755,root,root) %ghost %{_libdir}/libipset.so.3
de6c94a7 230%{_mandir}/man8/ipset.8*
40d655f1 231
232%files devel
233%defattr(644,root,root,755)
13648ed2 234%attr(755,root,root) %{_libdir}/libipset.so
6312651c
JB
235%{_libdir}/libipset.la
236%{_includedir}/libipset
1e8acbaa 237%{_pkgconfigdir}/libipset.pc
13648ed2
JK
238
239%files static
240%defattr(644,root,root,755)
241%{_libdir}/libipset.a
12667538
PS
242
243%files init
244%defattr(644,root,root,755)
a264566a 245%attr(754,root,root) /etc/rc.d/init.d/ipset
3bc59268 246%endif
This page took 0.105053 seconds and 4 git commands to generate.