From b1bab70c44f772993901189cfe8eab4324db544e Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 9 Jan 2018 15:54:39 -0500 Subject: net-analyzer/arpwatch: new revision to fix the upgrade path. All revisions before -r10 install /var/lib/arpwatch with the wrong ownership. The -r10 revision fixes that for new installs, but doesn't modify ${ROOT}/var/lib/arpwatch for upgraders. This new -r11 adds a pkg_postinst function to correct the issue for upgraders. The revision also changes one "dodir" back to "keepdir", fixing a mistake that I made in -r10. Closes: https://bugs.gentoo.org/554222 Package-Manager: Portage-2.3.13, Repoman-2.3.3 --- net-analyzer/arpwatch/arpwatch-2.1.15-r10.ebuild | 69 ------------------- net-analyzer/arpwatch/arpwatch-2.1.15-r11.ebuild | 86 ++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 69 deletions(-) delete mode 100644 net-analyzer/arpwatch/arpwatch-2.1.15-r10.ebuild create mode 100644 net-analyzer/arpwatch/arpwatch-2.1.15-r11.ebuild (limited to 'net-analyzer') diff --git a/net-analyzer/arpwatch/arpwatch-2.1.15-r10.ebuild b/net-analyzer/arpwatch/arpwatch-2.1.15-r10.ebuild deleted file mode 100644 index 986da0386f7d..000000000000 --- a/net-analyzer/arpwatch/arpwatch-2.1.15-r10.ebuild +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 -inherit user versionator - -PATCH_VER="0.8" -MY_P="${PN}-$(replace_version_separator 2 'a')" - -DESCRIPTION="An ethernet monitor program that keeps track of ethernet/IP address pairings" -HOMEPAGE="http://ee.lbl.gov/" -SRC_URI=" - ftp://ftp.ee.lbl.gov/${MY_P}.tar.gz - https://dev.gentoo.org/~jer/arpwatch-patchset-${PATCH_VER}.tar.xz -" - -LICENSE="BSD GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86 ~x86-fbsd" -IUSE="selinux" - -DEPEND=" - net-libs/libpcap - sys-libs/ncurses:* -" -RDEPEND=" - ${DEPEND} - selinux? ( sec-policy/selinux-arpwatch ) -" - -S="${WORKDIR}/${MY_P}" - -pkg_setup() { - # We need to create /var/lib/arpwatch with this group, so it must - # exist during src_install. - enewgroup arpwatch -} - -pkg_postinst() { - # The user, however, is not needed until runtime. - enewuser arpwatch -1 -1 -1 arpwatch -} - -src_prepare() { - local patchdir="${WORKDIR}/arpwatch-patchset" - - eapply "${patchdir}"/*.patch - eapply_user - - cp "${patchdir}"/*.8 ./ || die "failed to copy man pages from ${patchdir}" -} - -src_install () { - dosbin arpwatch arpsnmp arp2ethers massagevendor arpfetch bihourly.sh - doman arpwatch.8 arpsnmp.8 arp2ethers.8 massagevendor.8 arpfetch.8 bihourly.8 - - insinto /usr/share/arpwatch - doins ethercodes.dat - - insinto /usr/share/arpwatch/awk - doins duplicates.awk euppertolower.awk p.awk e.awk d.awk - - diropts --group=arpwatch --mode=770 - dodir /var/lib/arpwatch - dodoc README CHANGES - - newinitd "${FILESDIR}"/arpwatch.initd-r1 arpwatch - newconfd "${FILESDIR}"/arpwatch.confd-r1 arpwatch -} diff --git a/net-analyzer/arpwatch/arpwatch-2.1.15-r11.ebuild b/net-analyzer/arpwatch/arpwatch-2.1.15-r11.ebuild new file mode 100644 index 000000000000..758ebf7b0548 --- /dev/null +++ b/net-analyzer/arpwatch/arpwatch-2.1.15-r11.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit user versionator + +PATCH_VER="0.8" +MY_P="${PN}-$(replace_version_separator 2 'a')" + +DESCRIPTION="An ethernet monitor program that keeps track of ethernet/IP address pairings" +HOMEPAGE="http://ee.lbl.gov/" +SRC_URI=" + ftp://ftp.ee.lbl.gov/${MY_P}.tar.gz + https://dev.gentoo.org/~jer/arpwatch-patchset-${PATCH_VER}.tar.xz +" + +LICENSE="BSD GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86 ~x86-fbsd" +IUSE="selinux" + +DEPEND=" + net-libs/libpcap + sys-libs/ncurses:* +" +RDEPEND=" + ${DEPEND} + selinux? ( sec-policy/selinux-arpwatch ) +" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + # We need to create /var/lib/arpwatch with this group, so it must + # exist during src_install. + enewgroup arpwatch +} + +pkg_postinst() { + # The user, however, is not needed until runtime. + enewuser arpwatch -1 -1 -1 arpwatch +} + +src_prepare() { + local patchdir="${WORKDIR}/arpwatch-patchset" + + eapply "${patchdir}"/*.patch + eapply_user + + cp "${patchdir}"/*.8 ./ || die "failed to copy man pages from ${patchdir}" +} + +src_install () { + dosbin arpwatch arpsnmp arp2ethers massagevendor arpfetch bihourly.sh + doman arpwatch.8 arpsnmp.8 arp2ethers.8 massagevendor.8 arpfetch.8 bihourly.8 + + insinto /usr/share/arpwatch + doins ethercodes.dat + + insinto /usr/share/arpwatch/awk + doins duplicates.awk euppertolower.awk p.awk e.awk d.awk + + diropts --group=arpwatch --mode=770 + keepdir /var/lib/arpwatch + dodoc README CHANGES + + newinitd "${FILESDIR}"/arpwatch.initd-r1 arpwatch + newconfd "${FILESDIR}"/arpwatch.confd-r1 arpwatch +} + +pkg_postinst() { + # Previous revisions installed /var/lib/arpwatch with the wrong + # ownership. Instead of the intended arpwatch:root, it was left as + # root:root. If we find any such mis-owned directories, we fix them, + # and then set the permission bits how we want them in *this* + # revision. + # + # The "--from" flag ensures that we only fix directories that need + # fixing, and the "&& chmod" ensures that we only adjust the + # permissions if the owner also needed fixing. + chown --from=root:root \ + --no-dereference \ + :arpwatch \ + "${ROOT}"/var/lib/arpwatch && \ + chmod 770 "${ROOT}"/var/lib/arpwatch +} -- cgit v1.2.3-65-gdbad