summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2013-12-05 02:45:25 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2013-12-05 02:45:25 +0000
commit89833f350637d3c5a9b7dfc5d533cccc217b0015 (patch)
tree4a3b1ca92526ef18a9bcaa34fb1460d02d2acee2 /net-misc/apt-cacher-ng
parentfixed cross-device link issue (bug #493178) (diff)
downloadgentoo-2-89833f350637d3c5a9b7dfc5d533cccc217b0015.tar.gz
gentoo-2-89833f350637d3c5a9b7dfc5d533cccc217b0015.tar.bz2
gentoo-2-89833f350637d3c5a9b7dfc5d533cccc217b0015.zip
Add in Gentoo mirror support to apt-cacher-ng, patch submitted to upstream as well.
(Portage version: 2.2.7/cvs/Linux x86_64, unsigned Manifest commit)
Diffstat (limited to 'net-misc/apt-cacher-ng')
-rw-r--r--net-misc/apt-cacher-ng/ChangeLog9
-rw-r--r--net-misc/apt-cacher-ng/apt-cacher-ng-0.7.20-r1.ebuild119
-rw-r--r--net-misc/apt-cacher-ng/files/apt-cacher-ng-0.7.19-gentoo.diff47
3 files changed, 174 insertions, 1 deletions
diff --git a/net-misc/apt-cacher-ng/ChangeLog b/net-misc/apt-cacher-ng/ChangeLog
index 6b551c2506c1..0a0a1e6446a0 100644
--- a/net-misc/apt-cacher-ng/ChangeLog
+++ b/net-misc/apt-cacher-ng/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-misc/apt-cacher-ng
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/apt-cacher-ng/ChangeLog,v 1.30 2013/11/24 15:17:04 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/apt-cacher-ng/ChangeLog,v 1.31 2013/12/05 02:45:24 robbat2 Exp $
+
+*apt-cacher-ng-0.7.20-r1 (05 Dec 2013)
+
+ 05 Dec 2013; Robin H. Johnson <robbat2@gentoo.org>
+ +apt-cacher-ng-0.7.20-r1.ebuild, +files/apt-cacher-ng-0.7.19-gentoo.diff:
+ Add in Gentoo mirror support to apt-cacher-ng, patch submitted to upstream as
+ well.
*apt-cacher-ng-0.7.20 (24 Nov 2013)
diff --git a/net-misc/apt-cacher-ng/apt-cacher-ng-0.7.20-r1.ebuild b/net-misc/apt-cacher-ng/apt-cacher-ng-0.7.20-r1.ebuild
new file mode 100644
index 000000000000..1eaa69d9494a
--- /dev/null
+++ b/net-misc/apt-cacher-ng/apt-cacher-ng-0.7.20-r1.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/apt-cacher-ng/apt-cacher-ng-0.7.20-r1.ebuild,v 1.1 2013/12/05 02:45:24 robbat2 Exp $
+
+EAPI=5
+inherit cmake-utils user eutils
+
+DESCRIPTION="Yet another implementation of an HTTP proxy for Debian/Ubuntu software packages written in C++"
+HOMEPAGE="
+ http://www.unix-ag.uni-kl.de/~bloch/acng/
+ http://packages.qa.debian.org/a/apt-cacher-ng.html
+"
+LICENSE="BSD-4 ZLIB public-domain"
+SLOT="0"
+SRC_URI="mirror://debian/pool/main/a/${PN}/${PN}_${PV}.orig.tar.xz"
+
+KEYWORDS="~amd64 ~x86"
+IUSE="doc fuse lzma tcpd"
+
+COMMON_DEPEND="
+ app-arch/bzip2
+ sys-libs/zlib
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ app-arch/xz-utils
+ dev-util/cmake
+"
+RDEPEND="
+ ${COMMON_DEPEND}
+ lzma? ( app-arch/xz-utils )
+ fuse? ( sys-fs/fuse )
+ tcpd? ( sys-apps/tcp-wrappers )
+ dev-lang/perl
+"
+
+pkg_setup() {
+ # add new user & group for daemon
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 -1 ${PN}
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/apt-cacher-ng-0.7.19-gentoo.diff
+}
+
+src_configure(){
+ mycmakeargs="-DCMAKE_INSTALL_PREFIX=/usr"
+ if use fuse; then
+ mycmakeargs="-DHAVE_FUSE_26=yes ${mycmakeargs}"
+ else
+ mycmakeargs="-DHAVE_FUSE_26=no ${mycmakeargs}"
+ fi
+ if use lzma; then
+ mycmakeargs="-DHAVE_LZMA=yes ${mycmakeargs}"
+ else
+ mycmakeargs="-DHAVE_LZMA=no ${mycmakeargs}"
+ fi
+ if use tcpd; then
+ mycmakeargs="-DHAVE_LIBWRAP=yes ${mycmakeargs}"
+ else
+ mycmakeargs="-DHAVE_LIBWRAP=no ${mycmakeargs}"
+ fi
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ pushd ${CMAKE_BUILD_DIR}
+ dosbin ${PN}
+ if use fuse; then
+ dobin acngfs
+ fi
+ popd
+
+ newinitd "${FILESDIR}"/initd ${PN}
+ newconfd "${FILESDIR}"/confd ${PN}
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/logrotate ${PN}
+
+ doman doc/man/${PN}*
+ if use fuse; then
+ doman doc/man/acngfs*
+ fi
+
+ # Documentation
+ dodoc README TODO VERSION INSTALL ChangeLog
+ if use doc; then
+ dodoc doc/*.pdf
+ dohtml doc/html/*
+ docinto examples/conf
+ dodoc conf/*
+ fi
+
+ # perl daily cron script
+ dosbin expire-caller.pl
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/cron.daily ${PN}
+
+ # default configuration
+ insinto /etc/${PN}
+ newins conf/acng.conf ${PN}.conf
+ doins $( echo conf/* | sed 's|conf/acng.conf||g' )
+
+ dodir /var/cache/${PN}
+ dodir /var/log/${PN}
+ # Some directories must exists
+ keepdir /var/log/${PN}
+ fowners -R ${PN}:${PN} \
+ /etc/${PN} \
+ /var/log/${PN} \
+ /var/cache/${PN}
+}
+
+pkg_postinst() {
+ einfo "Gentoo mirroring support has been added to ${PN}"
+ einfo "To use it, you should run /etc/apt-cacher-ng/gentoo_mirrors.sh at least once"
+}
diff --git a/net-misc/apt-cacher-ng/files/apt-cacher-ng-0.7.19-gentoo.diff b/net-misc/apt-cacher-ng/files/apt-cacher-ng-0.7.19-gentoo.diff
new file mode 100644
index 000000000000..63831a89ef2e
--- /dev/null
+++ b/net-misc/apt-cacher-ng/files/apt-cacher-ng-0.7.19-gentoo.diff
@@ -0,0 +1,47 @@
+Support Gentoo mirrors in apt-cacher-ng
+
+Please note the use of a script to build the gentoo_mirrors file live; this
+should probably be done when each release is being built.
+
+The geo-balanced http://distfiles.gentoo.org/ mirror is NOT included in the
+mirrors3.xml source, so it gets added manually.
+
+The first 3 sed expresssions aren't actually required, but are useful in making
+the output list understandable.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+
+diff -Nuar --exclude '*.gz' apt-cacher-ng-0.7.19.orig/conf/acng.conf apt-cacher-ng-0.7.19/conf/acng.conf
+--- apt-cacher-ng-0.7.19.orig/conf/acng.conf 2013-07-28 11:09:43.000000000 -0700
++++ apt-cacher-ng-0.7.19/conf/acng.conf 2013-12-03 19:55:07.000000000 -0800
+@@ -44,6 +44,7 @@
+ Remap-fedora: file:fedora_mirrors # Fedora Linux
+ Remap-epel: file:epel_mirrors # Fedora EPEL
+ Remap-slrep: file:sl_mirrors # Scientific Linux
++Remap-gentoo: file:gentoo_mirrors.gz http://distfiles.gentoo.org/ /gentoo ; file:backends_gentoo # Gentoo Archives
+
+ # This is usually not needed for security.debian.org because it's always the
+ # same DNS hostname. However, it might be enabled in order to use hooks,
+diff -Nuar --exclude '*.gz' apt-cacher-ng-0.7.19.orig/conf/backends_gentoo.default apt-cacher-ng-0.7.19/conf/backends_gentoo.default
+--- apt-cacher-ng-0.7.19.orig/conf/backends_gentoo.default 1969-12-31 16:00:00.000000000 -0800
++++ apt-cacher-ng-0.7.19/conf/backends_gentoo.default 2013-12-03 19:46:38.000000000 -0800
+@@ -0,0 +1,4 @@
++# This is a configuration file. All lines starting with # are ignored.
++
++# gentoo mirrors use geodns to dispatch to the nearest location
++http://distfiles.gentoo.org/
+diff -Nuar --exclude '*.gz' apt-cacher-ng-0.7.19.orig/conf/gentoo_mirrors.sh apt-cacher-ng-0.7.19/conf/gentoo_mirrors.sh
+--- apt-cacher-ng-0.7.19.orig/conf/gentoo_mirrors.sh 1969-12-31 16:00:00.000000000 -0800
++++ apt-cacher-ng-0.7.19/conf/gentoo_mirrors.sh 2013-12-04 18:20:07.000000000 -0800
+@@ -0,0 +1,11 @@
++#!/bin/sh
++# This fetchs the live Gentoo mirrors list
++# robbat2@gentoo.org - 2013/Dec/03
++OUTFILE=/etc/apt-cacher-ng/gentoo_mirrors
++wget --save-headers -q http://www.gentoo.org/main/en/mirrors3.xml -O - \
++ |sed -n \
++ -e '/^[A-Z]/{s,^,#,g;p}' \
++ -e '/<mirrorgroup/{s,^,\n#,g;p}' \
++ -e '/<name/{s,^,#,g;p}' \
++ -e '/<uri/{/protocol="http"/{s/.*<uri[^>]\+>//g;s/<\/uri>//g;p}}' \
++ | gzip -9 >${OUTFILE}.gz