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