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

Contents of /net-firewall/ipset/ipset-6.9.1-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Oct 12 14:13:35 2011 UTC (3 years ago) by pva
Branch: MAIN
Changes since 1.1: +4 -6 lines
On second thought drop USE=ipv6: userspace should work is the same independently of USE=ipv6 and kernel side will depend on kernel configuration.

(Portage version: 2.1.10.25/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-6.9.1-r2.ebuild,v 1.1 2011/10/12 13:26:16 pva Exp $
4
5 EAPI="4"
6 inherit autotools linux-info linux-mod
7
8 # Maintainer: with version bump take a look on:
9 # http://git.netfilter.org/cgi-bin/gitweb.cgi?p=ipset.git;a=commit;h=70fdf030545f00888bcebb5fca8243a6dccca95b
10
11 DESCRIPTION="IPset tool for iptables, successor to ippool."
12 HOMEPAGE="http://ipset.netfilter.org/"
13 SRC_URI="http://ipset.netfilter.org/${P}.tar.bz2"
14
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="modules"
19
20 RDEPEND=">=net-firewall/iptables-1.4.4
21 net-libs/libmnl"
22 DEPEND="${RDEPEND}"
23
24 # configurable from outside, e.g. /etc/make.conf
25 IP_NF_SET_MAX=${IP_NF_SET_MAX:-256}
26
27 BUILD_TARGETS="modules"
28 MODULE_NAMES_ARG="kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/ipset"
29 MODULE_NAMES="xt_set(kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/)"
30 for i in ip_set{,_bitmap_{ip{,mac},port},_hash_{ip{,port{,ip,net}},net,net{port,iface}},_list_set}; do
31 MODULE_NAMES+=" ${i}(${MODULE_NAMES_ARG})"
32 done
33
34 check_header_patch() {
35 if ! $(grep -q NFNL_SUBSYS_IPSET "${KV_DIR}/include/linux/netfilter/nfnetlink.h"); then
36 eerror "Sorry, but you have to patch kernel sources with the following patch:"
37 eerror " # cd ${KV_DIR}"
38 eerror " # patch -i ${S}/netlink.patch -p1"
39 eerror "You should recompile and run new kernel to avoid runtime errors."
40 die "Unpatched kernel"
41 fi
42 }
43
44 pkg_setup() {
45 get_version
46 CONFIG_CHECK="NETFILTER"
47 ERROR_NETFILTER="ipset requires NETFILTER support in your kernel."
48
49 build_modules=0
50 if use modules; then
51 kernel_is -lt 2 6 35 && die "${PN} requires kernel greater then 2.6.35."
52 if linux_config_src_exists && linux_chkconfig_builtin "MODULES" ; then
53 if linux_chkconfig_present "IP_NF_SET" || \
54 linux_chkconfig_present "IP_SET"; then #274577
55 eerror "There is IP{,_NF}_SET or NETFILTER_XT_SET support in your kernel."
56 eerror "Please either build ipset with modules USE flag disabled"
57 eerror "or rebuild kernel without IP_SET support and make sure"
58 eerror "there is NO kernel ip_set* modules in /lib/modules/<you_kernel>/... ."
59 die "USE=modules and in-kernel ipset support detected."
60 else
61 einfo "Modular kernel detected. Gonna build kernel modules..."
62 build_modules=1
63 fi
64 else
65 eerror "Nonmodular kernel detected, but USE=modules. Either build"
66 eerror "modular kernel (without IP_SET) or disable USE=modules"
67 die "Nonmodular kernel detected, will not build kernel modules"
68 fi
69 fi
70 [[ ${build_modules} -eq 1 ]] && linux-mod_pkg_setup
71 }
72
73 src_prepare() {
74 [[ ${build_modules} -eq 1 ]] && check_header_patch
75 eautoreconf
76 }
77
78 src_configure() {
79 econf \
80 --with-maxsets=${IP_NF_SET_MAX} \
81 --libdir="${EPREFIX}"/$(get_libdir) \
82 --with-ksource="${KV_DIR}" \
83 --with-kbuild="${KV_OUT_DIR}"
84 }
85
86 src_compile() {
87 einfo "Building userspace"
88 emake
89
90 if [[ ${build_modules} -eq 1 ]]; then
91 einfo "Building kernel modules"
92 set_arch_to_kernel
93 emake modules
94 fi
95 }
96
97 src_install() {
98 einfo "Installing userspace"
99 emake DESTDIR="${D}" install
100
101 if [[ ${build_modules} -eq 1 ]]; then
102 einfo "Installing kernel modules"
103 linux-mod_src_install
104 fi
105
106 newinitd ${FILESDIR}/ipset.initd-r1 ${PN}
107 keepdir /var/lib/ipset
108 find "${ED}" \( -name '*.la' -o -name '*.a' \) -exec rm -f '{}' +
109 }

  ViewVC Help
Powered by ViewVC 1.1.20