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