1 |
pva 10/04/29 09:31:02 |
2 |
|
3 |
Added: metadata.xml ChangeLog xtables-addons-1.25.ebuild |
4 |
Log: |
5 |
Initial import, ebuild by me. Fixes bug #250407, thank Nathan McSween for report and others who tested this package. |
6 |
(Portage version: 2.1.8.3/cvs/Linux x86_64) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 net-firewall/xtables-addons/metadata.xml |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-firewall/xtables-addons/metadata.xml?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-firewall/xtables-addons/metadata.xml?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: metadata.xml |
15 |
=================================================================== |
16 |
<?xml version="1.0" encoding="UTF-8"?> |
17 |
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
18 |
<pkgmetadata> |
19 |
<herd>no-herd</herd> |
20 |
<maintainer> |
21 |
<email>pva@g.o</email> |
22 |
<name>Peter Volkov</name> |
23 |
</maintainer> |
24 |
<longdescription> |
25 |
Xtables-addons is the successor to patch-o-matic(-ng). Likewise, it contains |
26 |
extensions that were not, or are not yet, accepted in the main kernel/iptables |
27 |
packages. |
28 |
|
29 |
Xtables-addons is different from patch-o-matic in that you do not have to patch |
30 |
or recompile the kernel, sometimes recompiling iptables is also not needed. But |
31 |
please see the INSTALL file for the minimum requirements of this package. |
32 |
</longdescription> |
33 |
</pkgmetadata> |
34 |
|
35 |
|
36 |
|
37 |
1.1 net-firewall/xtables-addons/ChangeLog |
38 |
|
39 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-firewall/xtables-addons/ChangeLog?rev=1.1&view=markup |
40 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-firewall/xtables-addons/ChangeLog?rev=1.1&content-type=text/plain |
41 |
|
42 |
Index: ChangeLog |
43 |
=================================================================== |
44 |
# ChangeLog for net-firewall/xtables-addons |
45 |
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 |
46 |
# $Header: /var/cvsroot/gentoo-x86/net-firewall/xtables-addons/ChangeLog,v 1.1 2010/04/29 09:31:02 pva Exp $ |
47 |
|
48 |
*xtables-addons-1.25 (29 Apr 2010) |
49 |
|
50 |
29 Apr 2010; Peter Volkov <pva@g.o> +xtables-addons-1.25.ebuild, |
51 |
+metadata.xml: |
52 |
Initial import, ebuild by me. Fixes bug #250407, thank Nathan McSween for |
53 |
report and others who tested this package. |
54 |
|
55 |
|
56 |
|
57 |
|
58 |
1.1 net-firewall/xtables-addons/xtables-addons-1.25.ebuild |
59 |
|
60 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-firewall/xtables-addons/xtables-addons-1.25.ebuild?rev=1.1&view=markup |
61 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-firewall/xtables-addons/xtables-addons-1.25.ebuild?rev=1.1&content-type=text/plain |
62 |
|
63 |
Index: xtables-addons-1.25.ebuild |
64 |
=================================================================== |
65 |
# Copyright 1999-2010 Gentoo Foundation |
66 |
# Distributed under the terms of the GNU General Public License v2 |
67 |
# $Header: /var/cvsroot/gentoo-x86/net-firewall/xtables-addons/xtables-addons-1.25.ebuild,v 1.1 2010/04/29 09:31:02 pva Exp $ |
68 |
|
69 |
EAPI="2" |
70 |
|
71 |
inherit eutils linux-mod |
72 |
|
73 |
DESCRIPTION="extensions not yet accepted in the main kernel/iptables (patch-o-matic(-ng) successor)" |
74 |
HOMEPAGE="http://xtables-addons.sourceforge.net/" |
75 |
SRC_URI="mirror://sourceforge/xtables-addons/${P}.tar.bz2" |
76 |
|
77 |
LICENSE="GPL-2" |
78 |
SLOT="0" |
79 |
KEYWORDS="~amd64 ~x86" |
80 |
IUSE="modules" |
81 |
|
82 |
MODULES="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark echo dhcpmac delude chaos account" |
83 |
|
84 |
for mod in ${MODULES}; do |
85 |
IUSE="${IUSE} xtables_addons_${mod}" |
86 |
done |
87 |
|
88 |
RDEPEND="virtual/modutils |
89 |
>=net-firewall/iptables-1.4.3 |
90 |
>virtual/linux-sources-2.6.22 |
91 |
xtables_addons_ipset? ( !net-firewall/ipset )" |
92 |
|
93 |
DEPEND="${RDEPEND}" |
94 |
|
95 |
pkg_setup() { |
96 |
if use modules; then |
97 |
get_version |
98 |
check_modules_supported |
99 |
# CONFIG_IP_NF_CONNTRACK{,_MARK} doesn't exist in >virtual/linux-sources-2.6.22 |
100 |
CONFIG_CHECK="NF_CONNTRACK NF_CONNTRACK_MARK" |
101 |
linux-mod_pkg_setup |
102 |
|
103 |
if ! linux_chkconfig_present IPV6; then |
104 |
SKIP_IPV6_MODULES="ip6table_rawpost" |
105 |
fi |
106 |
fi |
107 |
} |
108 |
|
109 |
# Helper for maintainer: cheks if all possible MODULES are listed. |
110 |
XA_qa_check() { |
111 |
local all_modules |
112 |
all_modules=$(sed -n '/^build_/{s/build_\(.*\)=.*/\L\1/;G;s/\n/ /;s/ $//;h}; ${x;p}' "${S}/mconfig") |
113 |
if [[ ${all_modules} != ${MODULES} ]]; then |
114 |
ewarn "QA: Modules in mconfig differ from \$MODULES in ebuild." |
115 |
ewarn "Please, update MODULES in ebuild." |
116 |
ewarn "'${all_modules}'" |
117 |
fi |
118 |
} |
119 |
|
120 |
# Is there any use flag set? |
121 |
XA_has_something_to_build() { |
122 |
local mod |
123 |
for mod in ${MODULES}; do |
124 |
use xtables_addons_${mod} && return |
125 |
done |
126 |
|
127 |
eerror "All modules are disabled. What do you want me to build?" |
128 |
eerror "Please, set XTABLES_ADDONS to any combination of" |
129 |
eerror "${MODULES}" |
130 |
die "All modules are disabled." |
131 |
} |
132 |
|
133 |
# Parse Kbuid files and generates list of sources |
134 |
XA_get_module_name() { |
135 |
[[ $# != 1 ]] && die "XA_get_sources_for_mod: needs exactly one argument." |
136 |
local mod objdir build_mod sources_list |
137 |
mod=${1} |
138 |
objdir=${S}/extensions |
139 |
build_mod=$(sed -n "s/\(build_${mod}\)=.*/\1/Ip" "${S}/mconfig") |
140 |
sources_list=$(sed -n "/^obj-[$][{]${build_mod}[}]/\ |
141 |
{s:obj-[^+]\+ [+]=[[:space:]]*::;s:[.]o::g;p}" \ |
142 |
"${objdir}/Kbuild") |
143 |
|
144 |
if [[ -d ${S}/extensions/${sources_list} ]]; then |
145 |
objdir=${S}/extensions/${sources_list} |
146 |
sources_list=$(sed -n "/^obj-m/\ |
147 |
{s:obj-[^+]\+ [+]=[[:space:]]*::;s:[.]o::g;p}" \ |
148 |
"${objdir}/Kbuild") |
149 |
fi |
150 |
for mod_src in ${sources_list}; do |
151 |
has ${mod_src} ${SKIP_IPV6_MODULES} || \ |
152 |
echo " ${mod_src}(xtables_addons:${S}/extensions:${objdir})" |
153 |
done |
154 |
} |
155 |
|
156 |
src_prepare() { |
157 |
XA_qa_check |
158 |
XA_has_something_to_build |
159 |
|
160 |
local mod module_name |
161 |
if use modules; then |
162 |
MODULE_NAMES="compat_xtables(xtables_addons:${S}/extensions:)" |
163 |
fi |
164 |
for mod in ${MODULES}; do |
165 |
if use xtables_addons_${mod}; then |
166 |
sed "s/\(build_${mod}=\).*/\1m/I" -i mconfig || die |
167 |
if use modules; then |
168 |
for module_name in $(XA_get_module_name ${mod}); do |
169 |
MODULE_NAMES+=" ${module_name}" |
170 |
done |
171 |
fi |
172 |
else |
173 |
sed "s/\(build_${mod}=\).*/\1n/I" -i mconfig || die |
174 |
fi |
175 |
done |
176 |
|
177 |
sed -e 's/depmod -a/true/' -i Makefile.{in,am} || die |
178 |
sed -e '/^all-local:/{s: modules::}' \ |
179 |
-e '/^install-exec-local:/{s: modules_install::}' \ |
180 |
-i extensions/Makefile.{in,am} || die |
181 |
} |
182 |
|
183 |
src_configure() { |
184 |
unset ARCH # .. or it'll look for /arch/amd64/Makefile in linux sources |
185 |
export KBUILD_EXTMOD=${S} # Avoid build in /usr/src/linux #250407 |
186 |
econf --prefix=/ \ |
187 |
--libexecdir=/lib/ \ |
188 |
--with-kbuild="${KV_DIR}" |
189 |
} |
190 |
|
191 |
src_compile() { |
192 |
emake CFLAGS="${CFLAGS}" CC="$(tc-getCC)" || die |
193 |
use modules && BUILD_TARGETS="modules" linux-mod_src_compile |
194 |
} |
195 |
|
196 |
src_install() { |
197 |
emake DESTDIR="${D}" install || die |
198 |
use modules && linux-mod_src_install |
199 |
dodoc README doc/* || die |
200 |
find "${D}" -type f -name '*.la' -exec rm -rf '{}' '+' |
201 |
} |