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