]> git.pld-linux.org Git - packages/ipset.git/blob - ipset.spec
0510cc883b07557e763c40ee172040ba32ff2b83
[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     23
20 %define         pname   ipset
21 Summary:        IP sets utility
22 Summary(pl.UTF-8):      Narzędzie do zarządzania zbiorami IP
23 Name:           %{pname}%{_alt_kernel}
24 Version:        4.4
25 Release:        %{rel}
26 License:        GPL
27 Group:          Networking/Admin
28 Source0:        http://ipset.netfilter.org/%{pname}-%{version}.tar.bz2
29 # Source0-md5:  e21e9d9dfb8a01fc0122323ff1d6cbdb
30 Source1:        %{pname}.init
31 Patch0:         shadow-args.patch
32 URL:            http://ipset.netfilter.org/
33 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
34 %{?with_userspace:BuildRequires:        linux-libc-headers >= 7:2.6.22.1-2}
35 BuildRequires:  rpmbuild(macros) >= 1.379
36 Suggests:       kernel-net-ipset
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 Group:          Base/Kernel
83 %{?with_dist_kernel:%requires_releq_kernel}
84 Requires(post,postun):  /sbin/depmod
85
86 %description -n kernel%{_alt_kernel}-net-ipset
87 IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which
88 can be administered by the ipset utility. Depending on the type,
89 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
90 IP addresses with MAC addresses in a way, which ensures lightning
91 speed when matching an entry against a set.
92
93 This package contains kernel modules.
94
95 %description -n kernel%{_alt_kernel}-net-ipset -l pl.UTF-8
96 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można
97 administrować przy użyciu narzędzia ipset. W zależności od rodzaju
98 aktualnie zbiór IP może przechowywać adresy IP, numery portów
99 (TCP/UDP) lub adresy IP z adresami MAC - w sposób zapewniający
100 maksymalną szybkość przy dopasowywaniu elementu do zbioru.
101
102 Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP.
103
104 %prep
105 %setup -q -n %{pname}-%{version}
106 %patch0 -p1
107 mv kernel/{Kbuild,Makefile}
108
109 # these options can be overriden by module parameters.
110 # maximum number of ipsets.
111 %{__sed} -i 's:$(IP_NF_SET_MAX):256:' kernel/Makefile
112 # hash size for bindings of IP sets.
113 %{__sed} -i 's:$(IP_NF_SET_HASHSIZE):1024:' kernel/Makefile
114
115 %if "%{cc_version}" < "3.4"
116 %{__sed} -i -e 's/-Wextra//' Makefile
117 %{__sed} -i -e 's/-Winit-self//' Makefile
118 %{__sed} -i -e 's/-Wold-style-definition//' Makefile
119 %{__sed} -i -e 's/-Wno-missing-field-initializers//' Makefile
120 %endif
121
122 %build
123 %if %{with userspace}
124 %{__make} binaries \
125         CC="%{__cc}" \
126         PREFIX="%{_prefix}" \
127         LIBDIR="%{_libdir}" \
128         MANDIR="%{_mandir}" \
129         BINDIR="%{_sbindir}" \
130         COPT_FLAGS:="%{rpmcflags}"
131 %endif
132
133 %if %{with kernel}
134 # ugly hack for satisfy rpm build macro. in fact all modules will be built.
135 %build_kernel_modules -C kernel -m ip_set
136 %endif
137
138 %install
139 rm -rf $RPM_BUILD_ROOT
140
141 %if %{with userspace}
142 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}}
143
144 %{__make} binaries_install \
145         DESTDIR="$RPM_BUILD_ROOT" \
146         PREFIX="%{_prefix}" \
147         LIBDIR="%{_libdir}" \
148         MANDIR="%{_mandir}" \
149         BINDIR="%{_sbindir}"
150
151 cp -a *.h $RPM_BUILD_ROOT%{_includedir}
152 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname}
153 %endif
154
155 %if %{with kernel}
156 cd kernel
157 %install_kernel_modules -m ip_set -d kernel/net/ipv4/netfilter
158 install -p ip_set_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
159 install -p ipt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter
160 cd -
161 %endif
162
163 %clean
164 rm -rf $RPM_BUILD_ROOT
165
166 %post init
167 /sbin/chkconfig --add %{pname}
168
169 %preun init
170 if [ "$1" = "0" ]; then
171         /sbin/chkconfig --del %{pname}
172 fi
173
174 %post   -n kernel%{_alt_kernel}-net-ipset
175 %depmod %{_kernel_ver}
176
177 %postun -n kernel%{_alt_kernel}-net-ipset
178 %depmod %{_kernel_ver}
179
180 %if %{with userspace}
181 %files
182 %defattr(644,root,root,755)
183 %doc ChangeLog ChangeLog.ippool TODO
184 %attr(755,root,root) %{_sbindir}/ipset
185 %dir %{_libdir}/ipset
186 %attr(755,root,root) %{_libdir}/ipset/libipset_*.so
187 %{_mandir}/man8/ipset.8*
188
189 %files devel
190 %defattr(644,root,root,755)
191 %{_includedir}/ipset.h
192 %{_includedir}/libipt_set.h
193
194 %files init
195 %defattr(644,root,root,755)
196 %attr(754,root,root) /etc/rc.d/init.d/ipset
197 %endif
198
199 %if %{with kernel}
200 %files -n kernel%{_alt_kernel}-net-ipset
201 %defattr(644,root,root,755)
202 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ip_set*.ko*
203 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipt_set*.ko*
204 /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipt_SET*.ko*
205 %endif
This page took 0.253551 seconds and 2 git commands to generate.