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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun Oct 2 13:07:53 2011 UTC (3 years, 2 months ago) by pva
Branch: MAIN
Drop confusing message about netlink.patch, bug #382221 by John Brendler. Add init script by Andrew Savchenko, bug #181045 by Caleb Cushing.

(Portage version: 2.1.10.20/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.ebuild,v 1.1 2011/09/07 06:58:45 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 CONFIG_CHECK="NETFILTER IP6_NF_IPTABLES"
34 ERROR_NETFILTER="ipset requires NETFILTER support in your kernel."
35 ERROR_IP6_NF_IPTABLES="ipset requires IP6_NF_IPTABLES support in your kernel."
36
37 check_header_patch() {
38 if ! $(grep -q NFNL_SUBSYS_IPSET "${KV_DIR}/include/linux/netfilter/nfnetlink.h"); then
39 eerror "Sorry, but you have to patch kernel sources with the following patch:"
40 eerror " # cd ${KV_DIR}"
41 eerror " # patch -i ${S}/netlink.patch -p1"
42 eerror "You do not need to recompile your kernel."
43 die "Unpatched kernel"
44 fi
45 }
46
47 pkg_setup() {
48 get_version
49
50 build_modules=0
51 if use modules; then
52 kernel_is -lt 2 6 35 && die "${PN} requires kernel greater then 2.6.35."
53 if linux_config_src_exists && linux_chkconfig_builtin "MODULES" ; then
54 if linux_chkconfig_present "IP_NF_SET" || \
55 linux_chkconfig_present "IP_SET"; then #274577
56 eerror "There is IP{,_NF}_SET or NETFILTER_XT_SET support in your kernel."
57 eerror "Please either build ipset with modules USE flag disabled"
58 eerror "or rebuild kernel without IP_SET support and make sure"
59 eerror "there is NO kernel ip_set* modules in /lib/modules/<you_kernel>/... ."
60 die "USE=modules and in-kernel ipset support detected."
61 else
62 einfo "Modular kernel detected. Gonna build kernel modules..."
63 build_modules=1
64 fi
65 else
66 eerror "Nonmodular kernel detected, but USE=modules. Either build"
67 eerror "modular kernel or disable USE=modules"
68 die "Nonmodular kernel detected, will not build kernel modules"
69 fi
70 fi
71 linux-mod_pkg_setup
72 }
73
74 src_prepare() {
75 [[ ${build_modules} -eq 1 ]] && check_header_patch
76 eautoreconf
77 }
78
79 src_configure() {
80 econf \
81 --with-maxsets=${IP_NF_SET_MAX} \
82 --libdir="${EPREFIX}"/$(get_libdir) \
83 --with-ksource="${KV_DIR}" \
84 --with-kbuild="${KV_OUT_DIR}"
85 }
86
87 src_compile() {
88 einfo "Building userspace"
89 emake
90
91 if [[ ${build_modules} -eq 1 ]]; then
92 einfo "Building kernel modules"
93 set_arch_to_kernel
94 emake modules
95 fi
96 }
97
98 src_install() {
99 einfo "Installing userspace"
100 emake DESTDIR="${D}" install
101
102 if [[ ${build_modules} -eq 1 ]]; then
103 einfo "Installing kernel modules"
104 linux-mod_src_install
105 fi
106
107 newinitd ${FILESDIR}/ipset.initd ${PN}
108 find "${ED}" \( -name '*.la' -o -name '*.a' \) -exec rm -f '{}' +
109 }

  ViewVC Help
Powered by ViewVC 1.1.20