]> git.pld-linux.org Git - packages/ipset.git/blob - ipset.spec
- release 3
[packages/ipset.git] / ipset.spec
1 #
2 # TODO:
3 #       - patch our kernel to provide the needed API and update
4 #         the dependencies here
5 #
6 # Conditional build:
7 %bcond_without  dist_kernel     # allow non-distribution kernel
8 %bcond_without  kernel          # don't build kernel modules
9 %bcond_without  userspace       # don't build userspace tools
10 %bcond_with     verbose         # verbose build (V=1)
11
12 %if %{without kernel}
13 %undefine       with_dist_kernel
14 %endif
15 %if "%{_alt_kernel}" != "%{nil}"
16 %undefine       with_userspace
17 %endif
18 %if %{without userspace}
19 # nothing to be placed to debuginfo package
20 %define         _enable_debug_packages  0
21 %endif
22
23 %define         rel     3
24 %define         pname   ipset
25 Summary:        IP sets utility
26 Summary(pl.UTF-8):      Narzędzie do zarządzania zbiorami IP
27 Name:           %{pname}%{_alt_kernel}
28 Version:        6.8
29 Release:        %{rel}
30 License:        GPL v2
31 Group:          Networking/Admin
32 #Source0Download: http://ipset.netfilter.org/install.html
33 Source0:        http://ipset.netfilter.org/%{pname}-%{version}.tar.bz2
34 # Source0-md5:  575a365d430023a578350ca5de787b84
35 Source1:        %{pname}.init
36 Patch0:         %{pname}-config_dist.patch
37 Patch1:         %{pname}-no_kernel.patch
38 Patch2:         %{pname}-hash-net-if-fix.patch
39 URL:            http://ipset.netfilter.org/
40 BuildRequires:  autoconf >= 2.50
41 BuildRequires:  automake
42 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.38.6}
43 BuildRequires:  libmnl-devel
44 BuildRequires:  libtool
45 %{?with_userspace:BuildRequires:        linux-libc-headers >= 7:2.6.38.6}
46 BuildRequires:  pkgconfig
47 BuildRequires:  rpmbuild(macros) >= 1.583
48 Suggests:       kernel-net-ipset
49 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50
51 # unresolved ipset_errcode, defined in the ipset binary
52 %define         skip_post_check_so      libipset\.so.*
53
54 %description
55 IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
56 can be administered by the ipset utility. Depending on the type,
57 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
58 IP addresses with MAC addresses in a way, which ensures lightning
59 speed when matching an entry against a set.
60
61 %description -l pl.UTF-8
62 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
63 administrować przy użyciu narzędzia ipset. W zależności od
64 rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery
65 portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób
66 zapewniający maksymalną szybkość przy dopasowywaniu elementu do
67 zbioru.
68
69 %package devel
70 Summary:        Header files for ipset interface
71 Summary(pl.UTF-8):      Pliki nagłówkowe do interfejsu ipset
72 Group:          Development/Libraries
73 Requires:       %{name} = %{version}-%{release}
74 Requires:       libmnl-devel
75
76 %description devel
77 Header files for IPset interface.
78
79 %description devel -l pl.UTF-8
80 Pliki nagłówkowe do interfejsu IPset.
81
82 %package static
83 Summary:        Static ipset interface library
84 Summary(pl.UTF-8):      Biblioteka statyczna interfejsu ipset
85 Group:          Development/Libraries
86 Requires:       %{name}-devel = %{version}-%{release}
87
88 %description static
89 Static IPset interface library.
90
91 %description static -l pl.UTF-8
92 Biblioteka statyczna interfejsu IPset.
93
94 %package init
95 Summary:        IPset init script
96 Summary(pl.UTF-8):      Skrypt startowy IPset
97 Group:          Networking/Admin
98 Requires(post,preun):   /sbin/chkconfig
99 Requires:       %{pname} = %{version}-%{release}
100 Requires:       rc-scripts
101
102 %description init
103 IPset initialization script.
104
105 %description init -l pl.UTF-8
106 Skrypt startowy IPset.
107
108 %package -n kernel%{_alt_kernel}-net-ipset
109 Summary:        IPset kernel modules
110 Summary(pl.UTF-8):      Moduły jądra oferujące wsparcie dla zbiorów IP
111 Release:        %{rel}@%{_kernel_ver_str}
112 Group:          Base/Kernel
113 %{?with_dist_kernel:%requires_releq_kernel}
114 Requires(post,postun):  /sbin/depmod
115
116 %description -n kernel%{_alt_kernel}-net-ipset
117 IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
118 can be administered by the ipset utility. Depending on the type,
119 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
120 IP addresses with MAC addresses in a way, which ensures lightning
121 speed when matching an entry against a set.
122
123 This package contains kernel modules.
124
125 %description -n kernel%{_alt_kernel}-net-ipset -l pl.UTF-8
126 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
127 administrować przy użyciu narzędzia ipset. W zależności od
128 rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery
129 portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób
130 zapewniający maksymalną szybkość przy dopasowywaniu elementu do
131 zbioru.
132
133 Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP.
134
135 %prep
136 %setup -q -n %{pname}-%{version}
137 %if %{with kernel}
138 %{?with_dist_kernel:%patch0 -p1}
139 %else
140 %patch1 -p1
141 %endif
142 %patch2 -p1
143
144 %build
145 %{__libtoolize}
146 %{__aclocal} -I m4
147 %{__autoconf}
148 %{__autoheader}
149 %{__automake}
150 %configure \
151         --with-kbuild=%{_kernelsrcdir}
152
153 %if %{with userspace}
154 %{__make}
155 %endif
156
157 %if %{with kernel}
158 # a hack not to list all modules: list only ip_set, all other are build anyway
159 %build_kernel_modules -C kernel/net/netfilter -m ipset/ip_set IP_SET_MAX=255 KDIR=$PWD/../..
160 %endif
161
162 %install
163 rm -rf $RPM_BUILD_ROOT
164
165 %if %{with userspace}
166 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}/libipset}
167
168 %{__make} install \
169         DESTDIR=$RPM_BUILD_ROOT
170 cp include/libipset/*.h $RPM_BUILD_ROOT%{_includedir}/libipset
171
172 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname}
173 %endif
174
175 %if %{with kernel}
176 cd kernel/net/netfilter
177 %install_kernel_modules -m ipset/ip_set -d kernel/net/ipv4/netfilter/ipset
178 install -p ipset/ip_set_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset
179 install -p xt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
180 cd -
181 %endif
182
183 %clean
184 rm -rf $RPM_BUILD_ROOT
185
186 %post init
187 /sbin/chkconfig --add %{pname}
188
189 %preun init
190 if [ "$1" = "0" ]; then
191         /sbin/chkconfig --del %{pname}
192 fi
193
194 %post   -n kernel%{_alt_kernel}-net-ipset
195 %depmod %{_kernel_ver}
196
197 %postun -n kernel%{_alt_kernel}-net-ipset
198 %depmod %{_kernel_ver}
199
200 %if %{with userspace}
201 %files
202 %defattr(644,root,root,755)
203 %doc ChangeLog ChangeLog.ippool README UPGRADE
204 %attr(755,root,root) %{_sbindir}/ipset
205 %attr(755,root,root) %{_libdir}/libipset.so.*.*.*
206 %attr(755,root,root) %ghost %{_libdir}/libipset.so.1
207 %{_mandir}/man8/ipset.8*
208
209 %files devel
210 %defattr(644,root,root,755)
211 %attr(755,root,root) %{_libdir}/libipset.so
212 %{_libdir}/libipset.la
213 %{_includedir}/libipset
214
215 %files static
216 %defattr(644,root,root,755)
217 %{_libdir}/libipset.a
218
219 %files init
220 %defattr(644,root,root,755)
221 %attr(754,root,root) /etc/rc.d/init.d/ipset
222 %endif
223
224 %if %{with kernel}
225 %files -n kernel%{_alt_kernel}-net-ipset
226 %defattr(644,root,root,755)
227 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/xt_*.ko*
228 %dir /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset
229 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set.ko*
230 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set_*.ko*
231 %endif
This page took 0.319325 seconds and 4 git commands to generate.