/[gentoo-x86]/net-firewall/ipset/ipset-4.5.ebuild
Gentoo

Contents of /net-firewall/ipset/ipset-4.5.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Fri Sep 16 13:26:44 2011 UTC (3 years, 3 months ago) by chainsaw
Branch: MAIN
Changes since 1.3: +2 -2 lines
Marked stable on AMD64 based on arch testing by Ian "idella4" Delaney & Tomáš "Mepho" Pružina in bug #381613.

(Portage version: 2.1.10.16/cvs/Linux x86_64)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-firewall/ipset/ipset-4.5.ebuild,v 1.3 2011/09/15 09:46:25 nativemad Exp $
4
5 EAPI="2"
6
7 inherit eutils versionator toolchain-funcs linux-mod
8
9 DESCRIPTION="IPset tool for iptables, successor to ippool."
10 HOMEPAGE="http://ipset.netfilter.org/"
11 SRC_URI="http://ipset.netfilter.org/${P}.tar.bz2"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="amd64 x86"
16 IUSE="modules"
17
18 RDEPEND=">=net-firewall/iptables-1.4.4"
19 DEPEND="${RDEPEND}"
20
21 # configurable from outside
22 [ -z "${IP_NF_SET_MAX}" ] && IP_NF_SET_MAX=256
23 [ -z "${IP_NF_SET_HASHSIZE}" ] && IP_NF_SET_HASHSIZE=1024
24 BUILD_PARAMS="IP_NF_SET_MAX=$IP_NF_SET_MAX IP_NF_SET_HASHSIZE=${IP_NF_SET_HASHSIZE}"
25 # module fun
26 BUILD_TARGETS="all"
27 MODULE_NAMES_ARG="kernel/net/ipv4/netfilter:${S}/kernel"
28 MODULE_NAMES=""
29 for i in ip_set{,_{setlist,{ip,port,macip}map,{ip,net,ipport,ipportip,ipportnet}hash,iptree{,map}}} \
30 ipt_{SET,set}; do
31 MODULE_NAMES="${MODULE_NAMES} ${i}(${MODULE_NAMES_ARG})"
32 done
33 # sanity
34 CONFIG_CHECK="NETFILTER"
35 ERROR_CFG="ipset requires netfilter support in your kernel."
36
37 pkg_setup() {
38 get_version
39
40 build_modules=0
41 if use modules; then
42 if linux_config_src_exists && linux_chkconfig_builtin "MODULES" ; then
43 if linux_chkconfig_builtin "IP_NF_SET"; then #274577
44 einfo "Modular kernel detected but IP_NF_SET=y, will not build kernel modules"
45 else
46 build_modules=1
47 einfo "Modular kernel detected, will build kernel modules"
48 fi
49 else
50 einfo "Nonmodular kernel detected, will not build kernel modules"
51 fi
52 fi
53
54 [[ ${build_modules} -eq 1 ]] && linux-mod_pkg_setup
55 myconf="${myconf} PREFIX="
56 myconf="${myconf} LIBDIR=/$(get_libdir)"
57 myconf="${myconf} BINDIR=/sbin"
58 myconf="${myconf} MANDIR=/usr/share/man"
59 myconf="${myconf} INCDIR=/usr/include"
60 myconf="${myconf} NO_EXTRA_WARN_FLAGS=yes"
61 export myconf
62 }
63
64 src_prepare() {
65 sed -i \
66 -e 's/KERNELDIR/(KERNELDIR)/g' \
67 -e 's/^(\?KERNEL_\?DIR.*/KERNELDIR ?= /' \
68 -e '/^all::/iV ?= 0' \
69 -e '/^all::/iKBUILD_OUTPUT ?=' \
70 -e '/$(MAKE)/{s/$@/ V=$(V) KBUILD_OUTPUT=$(KBUILD_OUTPUT) modules/}' \
71 "${S}"/kernel/Makefile
72 }
73
74 src_compile() {
75 einfo "Building userspace"
76 emake \
77 CC="$(tc-getCC)" \
78 COPT_FLAGS="${CFLAGS}" \
79 LDFLAGS="${LDFLAGS}" \
80 ${myconf} \
81 binaries || die "failed to build"
82
83 if [[ ${build_modules} -eq 1 ]]; then
84 einfo "Building kernel modules"
85 cd "${S}/kernel"
86 export KERNELDIR="${KERNEL_DIR}"
87 linux-mod_src_compile || die "failed to build modules"
88 fi
89 }
90
91 src_install() {
92 einfo "Installing userspace"
93 emake DESTDIR="${D}" ${myconf} binaries_install || die "failed to package"
94
95 if [[ ${build_modules} -eq 1 ]]; then
96 einfo "Installing kernel modules"
97 cd "${S}/kernel"
98 export KERNELDIR="${KERNEL_DIR}"
99 linux-mod_src_install
100 fi
101 }

  ViewVC Help
Powered by ViewVC 1.1.20