Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-updates-src > by-pkgid > f17c63589ecda8939662b6a8fd330aa8 > files > 2

xtables-addons-3.8-1.mga7.src.rpm

%define accountmajor	0
%define libaccount	%mklibname account %{accountmajor}
%define libaccountdevel	%mklibname account -d

Name:		xtables-addons
Version:	3.8
Release:	%mkrel 1
Summary:	Extensions that were not, or are not yet, accepted in the main kernel/iptables packages
Group:		System/Kernel and hardware
License:	GPLv2
URL:		http://xtables-addons.sourceforge.net/
Source0: 	http://downloads.sourceforge.net/xtables-addons/%{name}-%{version}.tar.xz

Provides:	iptables-addons = %{version}-%{release}

BuildRequires:	pkgconfig(xtables) >= 1.4.5
BuildRequires:	kernel >= 3.7
Requires:	kernel >= 3.7
Recommends:	iptaccount
Recommends:	xtables-geoip

%description
Xtables-addons is the successor to patch-o-matic(-ng). Likewise, it contains
extensions that were not, or are not yet, accepted in the main kernel/iptables
packages.

Xtables-addons is different from patch-o-matic in that you do not have to
patch or recompile the kernel, sometimes recompiling iptables is also not
needed. But please see the INSTALL file for the minimum requirements of this
package.

(The name stems from Xtables, which is the protocol-agnostic code part of the
table-based firewalling schema.)


%package -n iptaccount
Summary:	Helper example program for iptables accounting
Group:		System/Kernel and hardware
Requires:	%{libaccount} == %{version}-%{release}

%description -n iptaccount
Helper example program for iptables accounting using the ACCOUNT target.


%package -n xtables-geoip
Summary:	Helper scripts for using geoip in iptables
Group:		System/Kernel and hardware
Requires:       kmod(xt_geoip.ko) = %{version}
Requires:       %{name} = %{version}-%{release}
BuildArch:	noarch

%description -n xtables-geoip
Helper scripts for using geoip in iptables.


%package -n %{libaccount}
Summary:	Library for iptaccount
Group:		System/Kernel and hardware
Requires:       kmod(xt_ACCOUNT.ko) = %{version}
Requires:       %{name} = %{version}-%{release}

%description -n %{libaccount}
Library for iptaccount. iptaccount is a helper example program for iptables
accounting using the ACCOUNT target.


%package -n %{libaccountdevel}
Summary:	Development library for iptaccount
Group:		System/Kernel and hardware
Requires:	%{libaccount} == %{version}-%{release}

%description -n %{libaccountdevel}
Development library for iptaccount. iptaccount is a helper example program
for iptables accounting using the ACCOUNT target.


%package -n dkms-%{name}
Summary:	dkms package for xtables-addons
Group:		System/Kernel and hardware
Provides:       kmod(xt_geoip.ko) = %{version}
Provides:       kmod(xt_ACCOUNT.ko) = %{version}
Requires:	kernel-devel >= 3.7
Requires:	dkms >= 2.0.19-37
Requires(post):	dkms >= 2.0.19-37
Requires(preun):dkms >= 2.0.19-37

%description -n dkms-%{name}
This contains the dkms package building the xtables-addons kernel modules.

Xtables-addons is the successor to patch-o-matic(-ng). Likewise, it contains
extensions that were not, or are not yet, accepted in the main kernel/iptables
packages.

Xtables-addons is different from patch-o-matic in that you do not have to
patch or recompile the kernel, sometimes recompiling iptables is also not
needed. But please see the INSTALL file for the minimum requirements of this
package.

(The name stems from Xtables, which is the protocol-agnostic code part of the
table-based firewalling schema.)


%prep
%setup -q
%autopatch -p1

%build
# don't build the modules
%configure2_5x --without-kbuild
%make

%install
%makeinstall_std

# we don't package .la
rm -f %{buildroot}%{_libdir}/libxt_ACCOUNT_cl.la

# prepare the dkms sources
mkdir -p %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/ACCOUNT %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/pknock
cp extensions/Kbuild extensions/Mbuild mconfig extensions/Makefile* extensions/mac.c extensions/xt_* extensions/compat_* %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}
cp extensions/ACCOUNT/Kbuild extensions/ACCOUNT/Mbuild extensions/ACCOUNT/Makefile* extensions/ACCOUNT/xt_* %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/ACCOUNT
cp extensions/pknock/Kbuild extensions/pknock/Mbuild extensions/pknock/Makefile* extensions/pknock/xt_* %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/pknock

# mconfig is not in parent dir anymore
sed -i 's/${XA_ABSTOPSRCDIR}/${M}/' %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/Kbuild

# remove ipset-6 references to silence make clean errors
sed -i '/ipset-6/ d' %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/Kbuild
sed -i '/ipset-6/ d' %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/Mbuild

cat > %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/dkms.conf << EOF
PACKAGE_NAME="%{name}"
PACKAGE_VERSION="%{version}-%{release}"
AUTOINSTALL="yes"
MAKE[0]="'make' -j\${parallel_jobs} -C \${kernel_source_dir} M=\\\$(pwd)"
CLEAN="make -C \${kernel_source_dir} M=\\\$(pwd) clean"
BUILT_MODULE_LOCATION[0]="ACCOUNT"
DEST_MODULE_LOCATION[0]="/kernel/extra"
BUILT_MODULE_NAME[0]="xt_ACCOUNT"
BUILT_MODULE_LOCATION[1]="pknock"
DEST_MODULE_LOCATION[1]="/kernel/extra"
BUILT_MODULE_NAME[1]="xt_pknock"
EOF

i=2
for mod in compat_xtables xt_CHAOS \
xt_condition xt_DELUDE xt_DHCPMAC xt_DNETMAP xt_fuzzy xt_geoip xt_iface \
xt_IPMARK xt_ipp2p xt_ipv4options xt_length2 xt_LOGMARK xt_lscan xt_psd \
xt_quota2 xt_SYSRQ xt_TARPIT; do
	echo -e "DEST_MODULE_LOCATION[$i]=\"/kernel/extra\"\nBUILT_MODULE_NAME[$i]=\"$mod\"" >> %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/dkms.conf
	(( i = $i + 1 ))
done

cat > README.urpmi <<EOF

NOTE1: Be careful, since the xt_ACCOUNT module seems not to be loaded, if
you have shorewall, you'll need to put this module in shorewalls
modules.xtables file.

NOTE2: if you're using shorewall, you can put the following in the
/etc/shorewall/accounting file:

SECTION PREROUTING
ACCOUNT(down,0.0.0.0/0)		-	eth0	-
ACCOUNT(local,192.168.0.0/24)	-	eth1	-
SECTION POSTROUTING
ACCOUNT(up,0.0.0.0/0)		-	-	eth0
ACCOUNT(local,192.168.0.0/24)	-	-	eth1

(assuming you have a LAN 192.168.0.0/24 on eth1 and internet on eth0)

[]# iptables -l down (will show your total downstream traffic in the src)
[]# iptables -l up (will show your total upstream traffic in the src section)
[]# iptables -l local (will show your up/downstream traffic per ip address)

(special case 0.0.0.0/0 will have all traffic always in src)

EOF

%post -n dkms-%{name}
    set -x
    /usr/sbin/dkms add     -m %{name} -v %{version}-%{release} --rpm_safe_upgrade
if [ -z "$DURING_INSTALL" ] ; then
    /usr/sbin/dkms build   -m %{name} -v %{version}-%{release} --rpm_safe_upgrade &&
    /usr/sbin/dkms install -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --force
    true
fi

%preun -n dkms-%{name}
set -x
/usr/sbin/dkms remove  -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --all
true

%files
%doc LICENSE README INSTALL
/%{_lib}/iptables/libxt_*.so
%{_mandir}/man8/xtables-addons.8.xz

%files -n dkms-%{name}
%{_usr}/src/%{name}-%{version}-%{release}

%files -n iptaccount
%doc README.urpmi
%{_sbindir}/iptaccount
%{_mandir}/man8/iptaccount.8*

%files -n %libaccount
%{_libdir}/libxt_ACCOUNT_cl.so.%{accountmajor}
%{_libdir}/libxt_ACCOUNT_cl.so.%{accountmajor}.*

%files -n %libaccountdevel
%{_libdir}/libxt_ACCOUNT_cl.so

%files -n xtables-geoip
%{_libexecdir}/xtables-addons/xt_geoip_build
%{_libexecdir}/xtables-addons/xt_geoip_dl
%{_mandir}/man1/xt_geoip_build.1*
%{_mandir}/man1/xt_geoip_dl.1*


%changelog
* Wed Feb 12 2020 tmb <tmb> 3.8-1.mga7
+ Revision: 1491295
- update to 3.8
- update to 3.7 (kernel 5.4 support)
- update to 3.5
- fix build with kernel 5.2

* Sun Mar 10 2019 tmb <tmb> 3.3-1.mga7
+ Revision: 1373542
- update to 3.3

* Fri Nov 09 2018 tmb <tmb> 3.2-1.mga7
+ Revision: 1329208
- update to 3.2

* Thu Aug 23 2018 tmb <tmb> 3.1-1.mga7
+ Revision: 1253573
- update to 3.1 (kernel 4.18 support)

* Mon Jul 30 2018 tmb <tmb> 3.0-2.mga7
+ Revision: 1245888
- rebuild with gcc 8.2

* Tue Jun 26 2018 tmb <tmb> 3.0-1.mga7
+ Revision: 1239911
- update to 3.0

* Mon Nov 13 2017 tmb <tmb> 2.13-3.mga7
+ Revision: 1177220
- fix build with 4.14 series kernels

* Sat Sep 02 2017 tmb <tmb> 2.13-2.mga7
+ Revision: 1150678
- rebuild with new gcc/binutils

* Sat Aug 05 2017 tmb <tmb> 2.13-1.mga7
+ Revision: 1135110
- update to 2.13 (kernel 4.12 support)

* Thu Mar 30 2017 tmb <tmb> 2.12-5.mga6
+ Revision: 1095420
- fix dkms post script

* Thu Mar 30 2017 tmb <tmb> 2.12-4.mga6
+ Revision: 1095390
- do trigger dkms build on dkms package update
- classic install: do add the driver to dkms list or it wont be built on boot

* Thu Mar 30 2017 tmb <tmb> 2.12-2.mga6
+ Revision: 1095307
- dont trigger dkms build during classical install

* Thu Mar 09 2017 tmb <tmb> 2.12-1.mga6
+ Revision: 1090933
- update to 2.12

* Sat Jan 28 2017 luigiwalser <luigiwalser> 2.11-4.mga6
+ Revision: 1083737
- rebuild for libxtables (libiptables)

* Sat Dec 24 2016 tmb <tmb> 2.11-3.mga6
+ Revision: 1077258
- fix build with linux 4.9

* Wed Jun 15 2016 tmb <tmb> 2.11-2.mga6
+ Revision: 1021608
- hook into dkms parallel build support

* Mon May 30 2016 tmb <tmb> 2.11-1.mga6
+ Revision: 1019500
- update to 2.11 (kernel 4.6 support)

* Fri Jan 15 2016 luigiwalser <luigiwalser> 2.10-3.mga6
+ Revision: 923209
- rebuild for libxtables (libiptables)

* Sat Dec 05 2015 tmb <tmb> 2.10-2.mga6
+ Revision: 908298
- rebuild with gcc 5.3 final

* Sun Nov 22 2015 tmb <tmb> 2.10-1.mga6
+ Revision: 904813
- 2.10 (supports linux 4.3 and 4.4)

* Wed Sep 30 2015 tmb <tmb> 2.8-1.mga6
+ Revision: 885416
- update to 2.8 (kernel 4.2 support)

* Fri Aug 21 2015 tmb <tmb> 2.7-3.mga6
+ Revision: 867084
- rebuild for new gcc

* Thu Aug 20 2015 tmb <tmb> 2.7-2.mga6
+ Revision: 866790
- rebuild with gcc 5.2.1

* Tue Jul 07 2015 tmb <tmb> 2.7-1.mga6
+ Revision: 852378
- update to 2.7 (kernel 4.1 support)

* Wed Oct 15 2014 umeabot <umeabot> 2.5-6.mga5
+ Revision: 743852
- Second Mageia 5 Mass Rebuild

* Wed Sep 24 2014 tmb <tmb> 2.5-5.mga5
+ Revision: 723896
- adapt to new kmod provides

* Tue Sep 16 2014 umeabot <umeabot> 2.5-4.mga5
+ Revision: 690791
- Mageia 5 Mass Rebuild
+ tv <tv>
- s/uggests:/Recommends:/

* Tue May 13 2014 tmb <tmb> 2.5-3.mga5
+ Revision: 622579
- rebuild with gcc 4.9

* Sun Apr 27 2014 tmb <tmb> 2.5-2.mga5
+ Revision: 618409
- xt_RAWNAT and xt_STEAL does not exist anymore

* Sun Apr 27 2014 tmb <tmb> 2.5-1.mga5
+ Revision: 618400
- update filelists
- update to 2.5

* Sat Oct 19 2013 umeabot <umeabot> 2.3-3.mga4
+ Revision: 531841
- Mageia 4 Mass Rebuild

* Sun Aug 11 2013 tmb <tmb> 2.3-2.mga4
+ Revision: 465461
- rebuild with new gcc

* Mon Jul 15 2013 tmb <tmb> 2.3-1.mga4
+ Revision: 454782
- update to 2.3 (kernel 3.10 support)

* Wed Jun 05 2013 fwang <fwang> 2.2-2.mga4
+ Revision: 437501
- rebuild for new iptables

* Sun Jun 02 2013 tmb <tmb> 2.2-1.mga4
+ Revision: 435167
- update to 2.2 (kernel-3.9 support)

* Mon Jan 14 2013 umeabot <umeabot> 2.1-3.mga3
+ Revision: 387441
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Thu Jan 10 2013 tmb <tmb> 2.1-2.mga3
+ Revision: 344823
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Sat Jan 05 2013 alien <alien> 2.1-1.mga3
+ Revision: 339354
- Update to new version 2.1

* Sat Jan 05 2013 alien <alien> 2.0-2.mga3
+ Revision: 339332
- Move geoip helper scripts into libexecdir and set it noarch
+ fwang <fwang>
- only support 3.7+ now
- new version 2.0 for 3.7 kernels

* Fri Dec 07 2012 tmb <tmb> 1.47.1-5.mga3
+ Revision: 327662
- fix build with kernel-3.7 (P0)

* Sat Nov 17 2012 tmb <tmb> 1.47.1-4.mga3
+ Revision: 319216
- drop uselessly added self-obsolete on dkms-xtables-addons
- drop unwanted require on kernel < 3.7

* Sat Nov 17 2012 fwang <fwang> 1.47.1-3.mga3
+ Revision: 319154
- obsoletes old packages

* Sat Nov 17 2012 fwang <fwang> 1.47.1-2.mga3
+ Revision: 319144
- the makefile in dkms package acturally different

* Thu Nov 15 2012 fwang <fwang> 1.47.1-1.mga3
+ Revision: 318151
- requires kernel < 3.7
- new version 1.47.1

* Thu Nov 15 2012 fwang <fwang> 2.0-1.mga3
+ Revision: 318145
- new version 2.0

* Thu Nov 08 2012 fwang <fwang> 1.45-2.mga3
+ Revision: 316287
- rebuild for new iptables

* Sat Jul 21 2012 alien <alien> 1.45-1.mga3
+ Revision: 273168
- Update to version 1.45
- Remove unneeded patch

* Sun Apr 08 2012 alien <alien> 1.41-3.mga2
+ Revision: 229738
- add documentation on how to use iptaccount

* Sun Apr 08 2012 alien <alien> 1.41-2.mga2
+ Revision: 229698
- geoip and iptaccount require xtables-addons

* Fri Apr 06 2012 alien <alien> 1.41-1.mga2
+ Revision: 229386
- imported package xtables-addons