diff options
author | Daniel Black <dragonheart@gentoo.org> | 2006-07-09 11:18:47 +0000 |
---|---|---|
committer | Daniel Black <dragonheart@gentoo.org> | 2006-07-09 11:18:47 +0000 |
commit | be30f9fbba72ffb3bebb6f5c7bf97b753eb28b57 (patch) | |
tree | 32cfd88a7e85f21e7d27dbad02ac9e6f2c80a78e /net-misc/l7-filter | |
parent | New version from Fedora 5. (diff) | |
download | gentoo-2-be30f9fbba72ffb3bebb6f5c7bf97b753eb28b57.tar.gz gentoo-2-be30f9fbba72ffb3bebb6f5c7bf97b753eb28b57.tar.bz2 gentoo-2-be30f9fbba72ffb3bebb6f5c7bf97b753eb28b57.zip |
remove old versions. Remodeled the uninstall portion of l7-filter to not break so easily (bug #110249)
(Portage version: 2.1.1_pre2-r6)
Diffstat (limited to 'net-misc/l7-filter')
-rw-r--r-- | net-misc/l7-filter/ChangeLog | 7 | ||||
-rw-r--r-- | net-misc/l7-filter/l7-filter-2.2.ebuild | 48 |
2 files changed, 42 insertions, 13 deletions
diff --git a/net-misc/l7-filter/ChangeLog b/net-misc/l7-filter/ChangeLog index 543a0b35502d..cd66176174e5 100644 --- a/net-misc/l7-filter/ChangeLog +++ b/net-misc/l7-filter/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for net-misc/l7-filter # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/l7-filter/ChangeLog,v 1.26 2006/06/04 13:01:26 dragonheart Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/l7-filter/ChangeLog,v 1.27 2006/07/09 11:18:47 dragonheart Exp $ + + 09 Jul 2006; Daniel Black <dragonheart@gentoo.org> -l7-filter-1.5.ebuild, + -l7-filter-2.0.ebuild, -l7-filter-2.1_p1.ebuild, l7-filter-2.2.ebuild: + remove old version. Remodeled the uninstall portion of l7-filter to not + break so easily (bug #110249) thanks to Bartosz Krzeszewski and others *l7-filter-2.2 (04 Jun 2006) diff --git a/net-misc/l7-filter/l7-filter-2.2.ebuild b/net-misc/l7-filter/l7-filter-2.2.ebuild index e7e807dc7304..378fb9ac0117 100644 --- a/net-misc/l7-filter/l7-filter-2.2.ebuild +++ b/net-misc/l7-filter/l7-filter-2.2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/l7-filter/l7-filter-2.2.ebuild,v 1.1 2006/06/04 13:01:26 dragonheart Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/l7-filter/l7-filter-2.2.ebuild,v 1.2 2006/07/09 11:18:47 dragonheart Exp $ inherit linux-info eutils @@ -39,6 +39,8 @@ which_patch() { } pkg_setup() { + linux-info_pkg_setup + pkg_preinstall pkg_postinst } @@ -77,11 +79,11 @@ src_unpack() { FILES=$(patch -t --dry-run -p1 < ${S}/${PATCH} | grep "^patching file" | cut -f 3 -d ' ') for F in ${FILES}; do - if [ -f ${F} ]; + if [ -f "${F}" ]; then - cp -P ${F} ${S}/kernel/${F} + cp -P "${F}" "${S}/kernel/${F}" else - touch ${S}/kernel/${F} + touch "${S}/kernel/${F}" fi done @@ -92,7 +94,7 @@ src_unpack() { # https://bugs.gentoo.org/show_bug.cgi?id=106009#c5 if kernel_is eq 2 6 12 then - epatch ${DISTDIR}/additional_patch_for_2.6.13.diff + epatch "${DISTDIR}"/additional_patch_for_2.6.13.diff fi } @@ -101,33 +103,55 @@ src_compile() { } src_install() { - insinto "${KV_DIR}" + insinto "$(/bin/readlink -f ${KV_DIR})" doins -r kernel/* dodoc CHANGELOG README } +pkg_preinstall() { + if has collision-protect ${FEATURES}; then + ewarn + ewarn "Collisions are expected as this patches kernel code. Disable" + ewarn "FEATURES=collision-protect before use" + die 'incompatible FEATURES=collision-protect' + fi +} pkg_postinst() { ewarn "This may not work with all kernels. If it does not work please enter a bug at bugs.gentoo.org" ewarn "This only patches the current kernel source code. (${KV_DIR})" ewarn "Its up to you to recompile the kernel with the l7 options" ewarn - ewarn 'You will also need to emerge iptables with the "extensions" USE flag' + ewarn 'You will also need to emerge iptables with the "extensions" or' + ewarn '"l7filter" USE flag (depend which version of iptables you emerge)' } +# +# Unpatching of patched files is required to avoid a broken kernel source tree + pkg_prerm() { - if [ -f ${ROOT}/usr/src/linux/include/linux/netfilter_ipv4/ipt_layer7.h ] + # How to determine what version it was installed against? - measily + eval $(/bin/fgrep KV=2 ${ROOT}/var/db/pkg/net-misc/${PF}/environment |\ + /bin/head -1) + KV_DIR=/usr/src/linux-"${KV}" + if [ -d ${KV_DIR} ]; then + ewarn "${KV_DIR} nolonger exists" + return 0; + fi + echo "KV_DIR=$KV_DIR" + if [ -f ${KV_DIR}/include/linux/netfilter_ipv4/ipt_layer7.h ] then einfo 'attempting to unpatch l7-patch from kernel ${KV_FULL}' which_patch if kernel_is eq 2 6 12 then - patch -F 3 -d ${ROOT}/usr/src/linux -R -p1 \ - < ${DISTDIR}/additional_patch_for_2.6.13.diff + + patch -F 3 -d "${KV_DIR}" -R -p1 \ + < "${DISTDIR}"/additional_patch_for_2.6.13.diff fi - cd ${T} + cd "${T}" unpack ${MY_P}.tar.gz EPATCH_SINGLE_MSG="removing previous patch" \ - EPATCH_OPTS="-F 3 -d ${ROOT}/usr/src/linux -R" epatch "${T}/${MY_P}/${PATCH}" + EPATCH_OPTS="-F 3 -d "${KV_DIR}" -R" epatch "${T}/${MY_P}/${PATCH}" fi } |