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