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