X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=ipset.spec;h=2b6c46f09e7e49be12942a0443b2a23d2e9a56b1;hb=0d2fc4308a552e44248173d7cf51726c09b15f0b;hp=8e5d096cf71ec59fe8513a8f0b570c59bd260a52;hpb=8faa4249ebbda6f517cc56a70661c3350ca61800;p=packages%2Fipset.git diff --git a/ipset.spec b/ipset.spec index 8e5d096..2b6c46f 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,4 +1,8 @@ # +# TODO: +# - patch our kernel to provide the needed API and update +# the dependencies here +# # Conditional build: %bcond_without dist_kernel # allow non-distribution kernel %bcond_without kernel # don't build kernel modules @@ -16,26 +20,36 @@ %define _enable_debug_packages 0 %endif -%define rel 14 +%define rel 10 %define pname ipset Summary: IP sets utility Summary(pl.UTF-8): Narzędzie do zarządzania zbiorami IP Name: %{pname}%{_alt_kernel} -Version: 4.4 +Version: 6.12.1 Release: %{rel} -License: GPL +License: GPL v2 Group: Networking/Admin +#Source0Download: http://ipset.netfilter.org/install.html Source0: http://ipset.netfilter.org/%{pname}-%{version}.tar.bz2 -# Source0-md5: e21e9d9dfb8a01fc0122323ff1d6cbdb +# Source0-md5: 80df500a4d93cb14e1373ae290716cda Source1: %{pname}.init -Patch0: shadow-args.patch +Patch0: %{pname}-no_kernel.patch +Patch1: %{pname}-hash-net-if-fix.patch URL: http://ipset.netfilter.org/ -%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2} -%{?with_userspace:BuildRequires: linux-libc-headers >= 7:2.6.22.1-2} -BuildRequires: rpmbuild(macros) >= 1.379 +BuildRequires: autoconf >= 2.50 +BuildRequires: automake +%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.38.6} +BuildRequires: libmnl-devel >= 1 +BuildRequires: libtool >= 2:2.0 +%{?with_userspace:BuildRequires: linux-libc-headers >= 7:2.6.38.6} +BuildRequires: pkgconfig +BuildRequires: rpmbuild(macros) >= 1.583 Suggests: kernel-net-ipset BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) +# unresolved ipset_errcode, defined in the ipset binary +%define skip_post_check_so libipset\.so.* + %description IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which can be administered by the ipset utility. Depending on the type, @@ -45,15 +59,18 @@ speed when matching an entry against a set. %description -l pl.UTF-8 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można -administrować przy użyciu narzędzia ipset. W zależności od rodzaju -aktualnie zbiór IP może przechowywać adresy IP, numery portów -(TCP/UDP) lub adresy IP z adresami MAC - w sposób zapewniający -maksymalną szybkość przy dopasowywaniu elementu do zbioru. +administrować przy użyciu narzędzia ipset. W zależności od +rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery +portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób +zapewniający maksymalną szybkość przy dopasowywaniu elementu do +zbioru. %package devel Summary: Header files for ipset interface Summary(pl.UTF-8): Pliki nagłówkowe do interfejsu ipset Group: Development/Libraries +Requires: %{name} = %{version}-%{release} +Requires: libmnl-devel >= 1 %description devel Header files for IPset interface. @@ -61,6 +78,18 @@ Header files for IPset interface. %description devel -l pl.UTF-8 Pliki nagłówkowe do interfejsu IPset. +%package static +Summary: Static ipset interface library +Summary(pl.UTF-8): Biblioteka statyczna interfejsu ipset +Group: Development/Libraries +Requires: %{name}-devel = %{version}-%{release} + +%description static +Static IPset interface library. + +%description static -l pl.UTF-8 +Biblioteka statyczna interfejsu IPset. + %package init Summary: IPset init script Summary(pl.UTF-8): Skrypt startowy IPset @@ -94,69 +123,56 @@ This package contains kernel modules. %description -n kernel%{_alt_kernel}-net-ipset -l pl.UTF-8 Zbiory IP to szkielet w jądrze Linuksa 2.4.x i 2.6.x, którym można -administrować przy użyciu narzędzia ipset. W zależności od rodzaju -aktualnie zbiór IP może przechowywać adresy IP, numery portów -(TCP/UDP) lub adresy IP z adresami MAC - w sposób zapewniający -maksymalną szybkość przy dopasowywaniu elementu do zbioru. +administrować przy użyciu narzędzia ipset. W zależności od +rodzaju aktualnie zbiór IP może przechowywać adresy IP, numery +portów (TCP/UDP) lub adresy IP z adresami MAC - w sposób +zapewniający maksymalną szybkość przy dopasowywaniu elementu do +zbioru. Ten pakiet zawiera moduły jądra oferujące wsparcie dla zbiorów IP. %prep %setup -q -n %{pname}-%{version} -%patch0 -p1 -mv kernel/{Kbuild,Makefile} - -# these options can be overriden by module parameters. -# maximum number of ipsets. -%{__sed} -i 's:$(IP_NF_SET_MAX):256:' kernel/Makefile -# hash size for bindings of IP sets. -%{__sed} -i 's:$(IP_NF_SET_HASHSIZE):1024:' kernel/Makefile - -%if "%{cc_version}" < "3.4" -%{__sed} -i -e 's/-Wextra//' Makefile -%{__sed} -i -e 's/-Winit-self//' Makefile -%{__sed} -i -e 's/-Wold-style-definition//' Makefile -%{__sed} -i -e 's/-Wno-missing-field-initializers//' Makefile -%endif +%{!?with_kernel:%patch0 -p1} +%patch1 -p1 %build +%{__libtoolize} +%{__aclocal} -I m4 +%{__autoconf} +%{__autoheader} +%{__automake} +%configure \ + --disable-silent-rules \ + --with-kbuild=%{_kernelsrcdir} + %if %{with userspace} -%{__make} binaries \ - CC="%{__cc}" \ - PREFIX="%{_prefix}" \ - LIBDIR="%{_libdir}" \ - MANDIR="%{_mandir}" \ - BINDIR="%{_sbindir}" \ - COPT_FLAGS:="%{rpmcflags}" +%{__make} %endif %if %{with kernel} -# ugly hack for satisfy rpm build macro. in fact all modules will be built. -%build_kernel_modules -C kernel -m ip_set +# a hack not to list all modules: list only ip_set, all other are build anyway +%build_kernel_modules -C kernel/net/netfilter -m ipset/ip_set IP_SET_MAX=255 KDIR=$PWD/../.. %endif %install rm -rf $RPM_BUILD_ROOT %if %{with userspace} -install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}} +install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_includedir}/libipset} -%{__make} binaries_install \ - DESTDIR="$RPM_BUILD_ROOT" \ - PREFIX="%{_prefix}" \ - LIBDIR="%{_libdir}" \ - MANDIR="%{_mandir}" \ - BINDIR="%{_sbindir}" +%{__make} install \ + DESTDIR=$RPM_BUILD_ROOT +cp include/libipset/*.h $RPM_BUILD_ROOT%{_includedir}/libipset -cp -a *.h $RPM_BUILD_ROOT%{_includedir} install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{pname} %endif %if %{with kernel} -cd kernel -%install_kernel_modules -m ip_set -d kernel/net/ipv4/netfilter -install -p ip_set_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter -install -p ipt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter +cd kernel/net/netfilter +%install_kernel_modules -m ipset/ip_set -d kernel/net/ipv4/netfilter/ipset +install -p ipset/ip_set_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset +install -p xt_*.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter cd - %endif @@ -180,16 +196,21 @@ fi %if %{with userspace} %files %defattr(644,root,root,755) -%doc ChangeLog ChangeLog.ippool TODO +%doc ChangeLog ChangeLog.ippool README UPGRADE %attr(755,root,root) %{_sbindir}/ipset -%dir %{_libdir}/ipset -%attr(755,root,root) %{_libdir}/ipset/libipset_*.so +%attr(755,root,root) %{_libdir}/libipset.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libipset.so.2 %{_mandir}/man8/ipset.8* %files devel %defattr(644,root,root,755) -%{_includedir}/ipset.h -%{_includedir}/libipt_set.h +%attr(755,root,root) %{_libdir}/libipset.so +%{_libdir}/libipset.la +%{_includedir}/libipset + +%files static +%defattr(644,root,root,755) +%{_libdir}/libipset.a %files init %defattr(644,root,root,755) @@ -199,7 +220,8 @@ fi %if %{with kernel} %files -n kernel%{_alt_kernel}-net-ipset %defattr(644,root,root,755) -/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ip_set*.ko* -/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipt_set*.ko* -/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipt_SET*.ko* +/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/xt_*.ko* +%dir /lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset +/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set.ko* +/lib/modules/%{_kernel_ver}/kernel/net/ipv4/netfilter/ipset/ip_set_*.ko* %endif