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