diff options
author | Peter Volkov <pva@gentoo.org> | 2011-10-12 13:26:16 +0000 |
---|---|---|
committer | Peter Volkov <pva@gentoo.org> | 2011-10-12 13:26:16 +0000 |
commit | a810c271d2bc8464c64e4158f4af7c69e0cab45e (patch) | |
tree | 26f743dbc843ccc293b3aafdb452c5aae106e180 /net-firewall/ipset | |
parent | Version bump, drop old. (diff) | |
download | historical-a810c271d2bc8464c64e4158f4af7c69e0cab45e.tar.gz historical-a810c271d2bc8464c64e4158f4af7c69e0cab45e.tar.bz2 historical-a810c271d2bc8464c64e4158f4af7c69e0cab45e.zip |
Fix init script, bug #386151 wrt Alexey Shvetsov. Require CONFIG_IP6_NF_IPTABLES only if USE=ipv6, bug #385445 wrt John Brendler.
Package-Manager: portage-2.1.10.25/cvs/Linux x86_64
Diffstat (limited to 'net-firewall/ipset')
-rw-r--r-- | net-firewall/ipset/ChangeLog | 9 | ||||
-rw-r--r-- | net-firewall/ipset/Manifest | 16 | ||||
-rw-r--r-- | net-firewall/ipset/files/ipset.initd | 6 | ||||
-rw-r--r-- | net-firewall/ipset/files/ipset.initd-r1 | 53 | ||||
-rw-r--r-- | net-firewall/ipset/ipset-6.9.1-r2.ebuild | 111 |
5 files changed, 190 insertions, 5 deletions
diff --git a/net-firewall/ipset/ChangeLog b/net-firewall/ipset/ChangeLog index 77f674530372..7fed3705e64e 100644 --- a/net-firewall/ipset/ChangeLog +++ b/net-firewall/ipset/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-firewall/ipset # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-firewall/ipset/ChangeLog,v 1.54 2011/10/02 13:07:53 pva Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-firewall/ipset/ChangeLog,v 1.55 2011/10/12 13:26:16 pva Exp $ + +*ipset-6.9.1-r2 (12 Oct 2011) + + 12 Oct 2011; Peter Volkov <pva@gentoo.org> +ipset-6.9.1-r2.ebuild, + +files/ipset.initd-r1, files/ipset.initd: + Fix init script, bug #386151 wrt Alexey Shvetsov. Require + CONFIG_IP6_NF_IPTABLES only if USE=ipv6, bug #385445 wrt John Brendler. *ipset-6.9.1-r1 (02 Oct 2011) diff --git a/net-firewall/ipset/Manifest b/net-firewall/ipset/Manifest index 283fa40265c3..4852bd1e7598 100644 --- a/net-firewall/ipset/Manifest +++ b/net-firewall/ipset/Manifest @@ -1,10 +1,22 @@ -AUX ipset.initd 1153 RMD160 09cbccf02a36021f761b3aecb3b09df4f4ef6d3b SHA1 49ddedd8cc678e8740af9259a4f3c7844b5b5ab3 SHA256 d43fb0120f376cb5bb221bab3b40d8949af25253dc304d8938960cbd296bdac8 +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +AUX ipset.initd 1213 RMD160 8633508d05ba592326c2962f1366704c91fd4a3f SHA1 964b5b58461f0f56bc29cc400fb465769ceba115 SHA256 bbc09cd718ad49b2df1a23faeda97d7337e8fd1ebbfdde4286f1d7d6c079528d +AUX ipset.initd-r1 1219 RMD160 7a9d5c079dd16f48c88e09a682f96fbd5e03476b SHA1 88a808984496ae8e22bb34a3105f965e7bd6dfb8 SHA256 ca7141461964f4e1ab6fd8ca22c2abcf6629b8a635eae9f9fd2e9771716f2f28 DIST ipset-4.5.tar.bz2 72428 RMD160 eb986eee5daa5f49be5df0eeb7f09c595b415ee1 SHA1 696a5cd96459c8fb028f0dfb9927a5c4f183d28b SHA256 f94200f39398f90b60633b5fa45f0c327d5915e2c5a68e6c90fcb8ea13be6994 DIST ipset-6.8.tar.bz2 122954 RMD160 94ee3177540743153013b04e560839596dde1aad SHA1 0f4abb79fe8a65088f687e8a274aaddb542bc86a SHA256 d7b499ee961cd92ba5f0f698e5de49909d8b2c6697ff5aea3a1535e183f9b809 DIST ipset-6.9.1.tar.bz2 123268 RMD160 068e5e37e761374089e53815b0ddca9ffd1894bb SHA1 781d5ad6a9e4d5bf6f8ccad3dfee8a578ed06c2a SHA256 db099044022f767046ec89c77de01ad6f0faf7f50f8f42b886c3c71ac5994abe EBUILD ipset-4.5.ebuild 2840 RMD160 bae015ed7f806cee6c6c8cb411815afff8bdfae4 SHA1 94cd6b8724e0f403f5d9969cd2de4a5ac2ab1abf SHA256 96e2d91d9a1f27abe2e44f380705536e4894fd27e4c9a684ebd4540d24da0ca0 EBUILD ipset-6.8.ebuild 3250 RMD160 6e9ffa7ff745b7a0ae2053222f449d1553cb5f32 SHA1 e8efe33efc46bec20d20cf33b34e9aa124ae0660 SHA256 adc276a151d484a522464376d127cd4437acdef5bd7a871fcea79c65fa7a1c9c EBUILD ipset-6.9.1-r1.ebuild 3391 RMD160 be1e553f741c5760279ecd7ab4b6d0f581c8c798 SHA1 1a82ea52d786103142f3e88b73ee55e09ffea9d0 SHA256 1ccf3ae26d73600ebc5e7fe316eb6d3b049887cc64bac078226c0b1e3fe22eac +EBUILD ipset-6.9.1-r2.ebuild 3479 RMD160 560a79911b3342932d0be44dff097c8061434d77 SHA1 f6b98e52d258a987437dcd23416ecd98c9992e99 SHA256 659397ee29fd7cc5dcca358d27b5026eb3bb3dddf2c2318743866fbc73fb843e EBUILD ipset-6.9.1.ebuild 3249 RMD160 4a32a1a7ceb39a8a986d4e1f0217799522185ee0 SHA1 e63a469a55f3b60191822e09d21b4def1e16b7c9 SHA256 990e629564a4849fb8aafb3344d11132298d3bb20b0653ff28b2b145dec750c5 -MISC ChangeLog 9617 RMD160 f0f11790723bf4af2d2f7305f246ef909407434e SHA1 6a360617d64ef0932540bf85e14bd91bc9e3be30 SHA256 9f4dfbb1625eda560c1529ded1d01c4160ae7deae4aa818c13f236024afeaa32 +MISC ChangeLog 9896 RMD160 84835fb8e91a9609634082a7695682623a236745 SHA1 95ada396083a43e66dace409caf6a6ef88ca10e3 SHA256 65c4497a2703f556d604e7b34df3f7c9cd0904567b9c8d39a6aeba606a8c1c85 MISC metadata.xml 261 RMD160 011c351b20b4b062f3d8018435a1b0b8eb1693ce SHA1 4d43ddf52da446a21a2565ebd52272d19dfaa767 SHA256 66f8679fb88591451a2fb75caa068efe24aa933bdf312ed6337eb74f933ac9a6 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.17 (GNU/Linux) + +iF4EAREIAAYFAk6VlQ4ACgkQGrk+8vGYmweM8QD+NxdD3VXP3fOCbs/NiTwwE4rK +E9u1oURNwyDSS87exOAA/1v8dG+UlyOvrG3pYlEorBVv8GpgcekrzvuwBvcNsBlq +=f1i6 +-----END PGP SIGNATURE----- diff --git a/net-firewall/ipset/files/ipset.initd b/net-firewall/ipset/files/ipset.initd index 6aa1a8532d50..15c6f9c1f251 100644 --- a/net-firewall/ipset/files/ipset.initd +++ b/net-firewall/ipset/files/ipset.initd @@ -1,9 +1,11 @@ #!/sbin/runscript # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-firewall/ipset/files/ipset.initd,v 1.1 2011/10/02 13:07:53 pva Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-firewall/ipset/files/ipset.initd,v 1.2 2011/10/12 13:26:16 pva Exp $ -opts="save" +extra_started_commands="save" + +IPSET_SAVE=${IPSET_SAVE:-/var/lib/ipset} depend() { before iptables ip6tables diff --git a/net-firewall/ipset/files/ipset.initd-r1 b/net-firewall/ipset/files/ipset.initd-r1 new file mode 100644 index 000000000000..2f0b2c67cac0 --- /dev/null +++ b/net-firewall/ipset/files/ipset.initd-r1 @@ -0,0 +1,53 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-firewall/ipset/files/ipset.initd-r1,v 1.1 2011/10/12 13:26:16 pva Exp $ + +extra_commands="save" + +IPSET_SAVE=${IPSET_SAVE:-/var/lib/ipset/rules-save} + +depend() { + before iptables ip6tables + use logger +} + +checkconfig() { + if [ ! -f "${IPSET_SAVE}" ] ; then + eerror "Not starting ${SVCNAME}. First create some rules then run:" + eerror "/etc/init.d/${SVCNAME} save" + return 1 + fi + return 0 +} + +start() { + checkconfig || return 1 + ebegin "Loading ipset session" + ipset restore < "${IPSET_SAVE}" + eend $? +} + +stop() { + # check if there are any references to current sets + if ! ipset list | gawk '($1 == "References:" && $2 > 0) { exit 1 }'; then + eerror "ipset is in use, can't stop" + return 1 + fi + + if [ "${SAVE_ON_STOP}" = "yes" ] ; then + save || return 1 + fi + + ebegin "Removing kernel IP sets" + ipset destroy + eend $? +} + +save() { + ebegin "Saving ipset session" + touch "${IPSET_SAVE}" + chmod 0600 "${IPSET_SAVE}" + ipset save > "${IPSET_SAVE}" + eend $? +} diff --git a/net-firewall/ipset/ipset-6.9.1-r2.ebuild b/net-firewall/ipset/ipset-6.9.1-r2.ebuild new file mode 100644 index 000000000000..0b82ecf471b6 --- /dev/null +++ b/net-firewall/ipset/ipset-6.9.1-r2.ebuild @@ -0,0 +1,111 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $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 $ + +EAPI="4" +inherit autotools linux-info linux-mod + +# Maintainer: with version bump take a look on: +# http://git.netfilter.org/cgi-bin/gitweb.cgi?p=ipset.git;a=commit;h=70fdf030545f00888bcebb5fca8243a6dccca95b + +DESCRIPTION="IPset tool for iptables, successor to ippool." +HOMEPAGE="http://ipset.netfilter.org/" +SRC_URI="http://ipset.netfilter.org/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="ipv6 modules" + +RDEPEND=">=net-firewall/iptables-1.4.4 + net-libs/libmnl" +DEPEND="${RDEPEND}" + +# configurable from outside, e.g. /etc/make.conf +IP_NF_SET_MAX=${IP_NF_SET_MAX:-256} + +BUILD_TARGETS="modules" +MODULE_NAMES_ARG="kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/ipset" +MODULE_NAMES="xt_set(kernel/net/netfilter/ipset/:${S}/kernel/net/netfilter/)" +for i in ip_set{,_bitmap_{ip{,mac},port},_hash_{ip{,port{,ip,net}},net,net{port,iface}},_list_set}; do + MODULE_NAMES+=" ${i}(${MODULE_NAMES_ARG})" +done + +check_header_patch() { + if ! $(grep -q NFNL_SUBSYS_IPSET "${KV_DIR}/include/linux/netfilter/nfnetlink.h"); then + eerror "Sorry, but you have to patch kernel sources with the following patch:" + eerror " # cd ${KV_DIR}" + eerror " # patch -i ${S}/netlink.patch -p1" + eerror "You should recompile and run new kernel to avoid runtime errors." + die "Unpatched kernel" + fi +} + +pkg_setup() { + get_version + CONFIG_CHECK="NETFILTER" + use ipv6 && CONFIG_CHECK+=" IP6_NF_IPTABLES" + ERROR_NETFILTER="ipset requires NETFILTER support in your kernel." + ERROR_IP6_NF_IPTABLES="ipset requires IP6_NF_IPTABLES support in your kernel." + + build_modules=0 + if use modules; then + kernel_is -lt 2 6 35 && die "${PN} requires kernel greater then 2.6.35." + if linux_config_src_exists && linux_chkconfig_builtin "MODULES" ; then + if linux_chkconfig_present "IP_NF_SET" || \ + linux_chkconfig_present "IP_SET"; then #274577 + eerror "There is IP{,_NF}_SET or NETFILTER_XT_SET support in your kernel." + eerror "Please either build ipset with modules USE flag disabled" + eerror "or rebuild kernel without IP_SET support and make sure" + eerror "there is NO kernel ip_set* modules in /lib/modules/<you_kernel>/... ." + die "USE=modules and in-kernel ipset support detected." + else + einfo "Modular kernel detected. Gonna build kernel modules..." + build_modules=1 + fi + else + eerror "Nonmodular kernel detected, but USE=modules. Either build" + eerror "modular kernel or disable USE=modules" + die "Nonmodular kernel detected, will not build kernel modules" + fi + fi + linux-mod_pkg_setup +} + +src_prepare() { + [[ ${build_modules} -eq 1 ]] && check_header_patch + eautoreconf +} + +src_configure() { + econf \ + --with-maxsets=${IP_NF_SET_MAX} \ + --libdir="${EPREFIX}"/$(get_libdir) \ + --with-ksource="${KV_DIR}" \ + --with-kbuild="${KV_OUT_DIR}" +} + +src_compile() { + einfo "Building userspace" + emake + + if [[ ${build_modules} -eq 1 ]]; then + einfo "Building kernel modules" + set_arch_to_kernel + emake modules + fi +} + +src_install() { + einfo "Installing userspace" + emake DESTDIR="${D}" install + + if [[ ${build_modules} -eq 1 ]]; then + einfo "Installing kernel modules" + linux-mod_src_install + fi + + newinitd ${FILESDIR}/ipset.initd-r1 ${PN} + keepdir /var/lib/ipset + find "${ED}" \( -name '*.la' -o -name '*.a' \) -exec rm -f '{}' + +} |