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