]> git.pld-linux.org Git - packages/ipset.git/blame - ipset.spec
- complete alt_kernel support (src.rpm to include alt kernel brand)
[packages/ipset.git] / ipset.spec
CommitLineData
bc9c8d01 1#
3bc59268
PS
2# Conditional build:
3%bcond_without dist_kernel # allow non-distribution kernel
4%bcond_without kernel # don't build kernel modules
5%bcond_without userspace # don't build userspace tools
6%bcond_with verbose # verbose build (V=1)
7
d33761e1 8%if %{without kernel}
3bc59268
PS
9%undefine with_dist_kernel
10%endif
3bc59268
PS
11%if "%{_alt_kernel}" != "%{nil}"
12%undefine with_userspace
13%endif
d33761e1
ER
14%if %{without userspace}
15# nothing to be placed to debuginfo package
16%define _enable_debug_packages 0
17%endif
3bc59268 18
d33761e1 19%define rel 1
5b36c760 20%define pname ipset
bc9c8d01 21Summary: IP sets utility
cb832b79 22Summary(pl.UTF-8): Narzędzie do zarządzania zbiorami IP
bc9c8d01 23Name: ipset
3bc59268 24Version: 2.4.3
3bc59268 25Release: %{rel}
bc9c8d01
JK
26License: GPL
27Group: Networking/Admin
5b36c760 28Source0: http://ipset.netfilter.org/%{pname}-%{version}.tar.bz2
3bc59268 29# Source0-md5: 3c97324d04562a8bc25b0177100673ee
5b36c760 30Source1: %{pname}.init
bc9c8d01 31URL: http://ipset.netfilter.org/
3bc59268
PS
32%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
33%{?with_userspace:BuildRequires: linux-libc-headers >= 7:2.6.22.1-2}
34BuildRequires: perl-base
35BuildRequires: rpmbuild(macros) >= 1.379
36Requires(post,postun): /sbin/depmod
bc9c8d01
JK
37BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
bc9c8d01
JK
39%description
40IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
41can be administered by the ipset utility. Depending on the type,
42currently an IP set may store IP addresses, (TCP/UDP) port numbers or
43IP addresses with MAC addresses in a way, which ensures lightning
44speed when matching an entry against a set.
45
00760b7e
JR
46%description -l pl.UTF-8
47Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
48administrować przy użyciu narzędzia ipset. W zależności od rodzaju
49aktualnie zbiór IP może przechowywać adresy IP, numery portów
50(TCP/UDP) lub adresy IP z adresami MAC - w sposób zapewniający
51maksymalną szybkość przy dopasowywaniu elementu do zbioru.
9e9bc01b 52
40d655f1 53%package devel
e791bf9d 54Summary: Header files for ipset interface
cb832b79 55Summary(pl.UTF-8): Pliki nagłówkowe do interfejsu ipset
f62f2152 56Group: Development/Libraries
40d655f1 57
58%description devel
3bc59268 59Header files for IPset interface.
40d655f1 60
00760b7e 61%description devel -l pl.UTF-8
3bc59268 62Pliki nagłówkowe do interfejsu IPset.
40d655f1 63
12667538 64%package init
3bc59268 65Summary: IPset init (RedHat style)
12667538 66Group: Networking/Admin
12667538 67Requires(post,preun): /sbin/chkconfig
5b36c760 68Requires: %{pname}
af1d549a 69Requires: rc-scripts
12667538
PS
70
71%description init
3bc59268
PS
72IPset initialization script.
73
74%package -n kernel%{_alt_kernel}-net-ipset
75Summary: IPset kernel modules
76Summary(pl.UTF-8): Moduły jądra oferujące wsparcie dla zbiorów IP
77Release: %{rel}@%{_kernel_ver_str}
78License: GPL
79Group: Base/Kernel
80%{?with_dist_kernel:%requires_releq_kernel}
81Requires(post,postun): /sbin/depmod
82
83%description -n kernel%{_alt_kernel}-net-ipset
84IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
85can be administered by the ipset utility. Depending on the type,
86currently an IP set may store IP addresses, (TCP/UDP) port numbers or
87IP addresses with MAC addresses in a way, which ensures lightning
88speed when matching an entry against a set.
89
90This package contains kernel modules.
91
92%description -n kernel%{_alt_kernel}-net-ipset -l pl.UTF-8
93Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
94administrować przy użyciu narzędzia ipset. W zależności od rodzaju
95aktualnie zbiór IP może przechowywać adresy IP, numery portów
96(TCP/UDP) lub adresy IP z adresami MAC - w sposób zapewniający
97maksymalną szybkość przy dopasowywaniu elementu do zbioru.
98
99Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP.
12667538 100
bc9c8d01 101%prep
5b36c760 102%setup -q -n %{pname}-%{version}
3bc59268
PS
103mv kernel/{Kbuild,Makefile}
104
105# maximum number of ipsets.
106%{__sed} -i 's:$(IP_NF_SET_MAX):256:' kernel/Makefile
107# hash size for bindings of IP sets.
108%{__sed} -i 's:$(IP_NF_SET_HASHSIZE):1024:' kernel/Makefile
109# these options can be overriden by module parameters.
bc9c8d01
JK
110
111%build
3bc59268 112%if %{with userspace}
bfe86908 113%{__make} binaries \
114 CC="%{__cc}" \
bc9c8d01
JK
115 PREFIX="%{_prefix}" \
116 LIBDIR="%{_libdir}" \
117 MANDIR="%{_mandir}" \
118 BINDIR="%{_sbindir}" \
bc9c8d01 119 COPT_FLAGS:="%{rpmcflags}"
3bc59268
PS
120%endif
121
122%if %{with kernel}
123# ugly hack for satisfy rpm build macro. in fact all modules will be build.
124%build_kernel_modules -C kernel -m ip_set
125%endif
bc9c8d01
JK
126
127%install
128rm -rf $RPM_BUILD_ROOT
3bc59268
PS
129
130%if %{with userspace}
12667538 131install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}}
bc9c8d01 132
bfe86908 133%{__make} binaries_install \
bc9c8d01
JK
134 DESTDIR="$RPM_BUILD_ROOT" \
135 PREFIX="%{_prefix}" \
136 LIBDIR="%{_libdir}" \
137 MANDIR="%{_mandir}" \
eeafeb5f 138 BINDIR="%{_sbindir}"
e791bf9d
JB
139
140install *.h $RPM_BUILD_ROOT%{_includedir}
5b36c760 141install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname}
3bc59268
PS
142%endif
143
144%if %{with kernel}
145cd kernel
146%install_kernel_modules -m ip_set -d kernel/net/ipv4/netfilter
147install ip_set_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
148install ipt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
149cd -
150%endif
12667538 151
bc9c8d01
JK
152%clean
153rm -rf $RPM_BUILD_ROOT
154
12667538 155%post init
5b36c760 156/sbin/chkconfig --add %{pname}
12667538
PS
157
158%preun init
159if [ "$1" = "0" ]; then
5b36c760 160 /sbin/chkconfig --del %{pname}
12667538
PS
161fi
162
3bc59268
PS
163%post -n kernel%{_alt_kernel}-net-ipset
164%depmod %{_kernel_ver}
165
166%postun -n kernel%{_alt_kernel}-net-ipset
167%depmod %{_kernel_ver}
168
169%if %{with userspace}
bc9c8d01
JK
170%files
171%defattr(644,root,root,755)
172%doc ChangeLog ChangeLog.ippool TODO
173%attr(755,root,root) %{_sbindir}/*
174%dir %{_libdir}/ipset
175%attr(755,root,root) %{_libdir}/ipset/*.so
176%{_mandir}/man8/*
40d655f1 177
178%files devel
179%defattr(644,root,root,755)
180%{_includedir}/*.h
12667538
PS
181
182%files init
183%defattr(644,root,root,755)
184%attr(754,root,root) /etc/rc.d/init.d/*
3bc59268
PS
185%endif
186
187%if %{with kernel}
188%files -n kernel%{_alt_kernel}-net-ipset
189%defattr(644,root,root,755)
190/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/*.ko*
191%endif
This page took 0.060818 seconds and 4 git commands to generate.