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