commit:     a786bf0592e537ff939e17466940a06c79f84320
Author:     John Helmert III <ajak <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 21 23:19:40 2021 +0000
Commit:     John Helmert III <ajak <AT> gentoo <DOT> org>
CommitDate: Sat Aug 21 23:20:51 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a786bf05

net-misc/apt-cacher-ng: propagate some fixes to live ebuild

Signed-off-by: John Helmert III <ajak <AT> gentoo.org>

 net-misc/apt-cacher-ng/apt-cacher-ng-9999.ebuild | 31 ++++++++++++++----------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/net-misc/apt-cacher-ng/apt-cacher-ng-9999.ebuild 
b/net-misc/apt-cacher-ng/apt-cacher-ng-9999.ebuild
index c69b956cb3c..317ac95f9c3 100644
--- a/net-misc/apt-cacher-ng/apt-cacher-ng-9999.ebuild
+++ b/net-misc/apt-cacher-ng/apt-cacher-ng-9999.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit cmake git-r3
+inherit cmake git-r3 tmpfiles
 
 DESCRIPTION="Yet another caching HTTP proxy for Debian/Ubuntu software 
packages"
 HOMEPAGE="https://www.unix-ag.uni-kl.de/~bloch/acng/
@@ -13,7 +13,7 @@ EGIT_BRANCH="upstream/sid"
 
 LICENSE="BSD-4 ZLIB public-domain"
 SLOT="0"
-IUSE="doc fuse tcpd"
+IUSE="doc fuse systemd tcpd"
 
 DEPEND="acct-user/apt-cacher-ng
        acct-group/apt-cacher-ng
@@ -22,6 +22,7 @@ DEPEND="acct-user/apt-cacher-ng
        dev-libs/openssl:0=
        sys-libs/zlib
        fuse? ( sys-fs/fuse:0 )
+       systemd? ( sys-apps/systemd )
        tcpd? ( sys-apps/tcp-wrappers )"
 BDEPEND="virtual/pkgconfig"
 RDEPEND="${DEPEND}
@@ -41,10 +42,11 @@ src_prepare() {
        # Make sure we install everything the same way it used to be after
        # switching from mostly custom src_install to relying on build system
        # installation
-       sed -ie "/install/s/LIBDIR/CFGDIR/" conf/CMakeLists.txt || die
-       sed -ie '/install.*acng\.conf/s/)$/ RENAME '"${PN}"'.conf)/' 
conf/CMakeLists.txt || die
-       sed -ie '/file/s/)$/ "*hooks" "backends_debian")/' conf/CMakeLists.txt 
|| die
+       sed -e "/install/s/LIBDIR/CFGDIR/" \
+               -e '/install.*acng\.conf/s/)$/ RENAME '"${PN}"'.conf)/' \
+               -e '/file/s/)$/ "*hooks" "backends_debian")/' -i 
conf/CMakeLists.txt || die
        sed -ie "/INSTALL.*acngtool/s/LIBDIR/CMAKE_INSTALL_SBINDIR/" 
source/CMakeLists.txt || die
+
        cmake_src_prepare
 }
 
@@ -52,22 +54,21 @@ src_configure() {
        local mycmakeargs=(
                "-DHAVE_FUSE_25=$(usex fuse)"
                "-DHAVE_LIBWRAP=$(usex tcpd)"
-               # Unconditionally install systemd service file
-               "-DSDINSTALL=1"
+               "-DSDINSTALL=$(usex systemd)"
        )
 
-       if tc-ld-is-gold; then
-               mycmakeargs+=( "-DUSE_GOLD=yes" )
-       else
-               mycmakeargs+=( "-DUSE_GOLD=no" )
-       fi
-
        cmake_src_configure
 
        sed -ie '/LogDir/s|/var/tmp|/var/log/'"${PN}"'|g' 
"${BUILD_DIR}"/conf/acng.conf || die
 }
 
 src_install() {
+       # README is a symlink to doc/README and README automatically gets
+       # installed, leading to a broken symlink installed. Fix this by removing
+       # the symlink then installing the actual README. 
https://bugs.gentoo.org/770046
+       rm README || die
+       dodoc doc/README
+
        newinitd "${FILESDIR}/initd-r3" "${PN}"
        newconfd "${FILESDIR}/confd-r2" "${PN}"
 
@@ -93,3 +94,7 @@ src_install() {
 
        cmake_src_install
 }
+
+pkg_postinst() {
+       tmpfiles_process "${PN}.conf"
+}

Reply via email to