]> Pileus Git - ~andy/sunrise/blob - net-misc/apt-cacher-ng/apt-cacher-ng-0.5.14.ebuild
net-misc/apt-cacher-ng: Version bump wrt #356319. Migrated to cmake-utils.
[~andy/sunrise] / net-misc / apt-cacher-ng / apt-cacher-ng-0.5.14.ebuild
1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=3
6 inherit cmake-utils eutils
7
8 DESCRIPTION="Yet another implementation of a HTTP proxy for Debian/Ubuntu software packages written in C++"
9 HOMEPAGE="http://www.unix-ag.uni-kl.de/~bloch/acng/"
10 SRC_URI="mirror://debian/pool/main/a/${PN}/${PN}_${PV}.tar.gz"
11
12 LICENSE="as-is"
13 SLOT="0"
14 KEYWORDS="~x86"
15 IUSE="doc examples fuse lzma"
16
17 DEPEND="app-arch/bzip2
18         sys-libs/zlib
19         lzma? (
20                 || ( app-arch/xz-utils
21                         app-arch/lzma-utils )
22         )"
23 RDEPEND="${DEPEND}
24         dev-lang/perl
25         fuse? ( sys-fs/fuse )"
26
27 pkg_setup() {
28         # Add a new user & group for the daemon.
29         enewgroup ${PN}
30         enewuser ${PN} -1 -1 -1 ${PN}
31 }
32
33 src_configure() {
34         mycmakeargs=(
35                 # avoid forcing in LDFLAGS
36                 -DHAVE_WL_AS_NEEDED=OFF
37                 # assert for possible boost automagic
38                 -DHAVE_BOOST_SMARTPTR=OFF
39
40                 $(cmake-utils_use_has lzma LZMA)
41                 $(cmake-utils_use_has fuse FUSE_26)
42         )
43
44         cmake-utils_src_configure
45 }
46
47 src_install() {
48         dosbin "${CMAKE_BUILD_DIR}"/${PN} || die
49         doman doc/man/${PN}.8 || die
50         if use fuse; then
51                 dobin "${CMAKE_BUILD_DIR}"/acngfs || die
52                 doman doc/man/acngfs.8 || die
53         fi
54
55         newinitd "${FILESDIR}"/initd ${PN} || die
56         newconfd "${FILESDIR}"/confd ${PN} || die
57
58         # for logrotate
59         insinto /etc/logrotate.d
60         newins "${FILESDIR}"/logrotate ${PN} || die
61
62         # Documentation
63         dodoc ChangeLog doc/README TODO || die
64         if use doc; then
65                 dodoc doc/*.pdf || die
66                 dohtml doc/html/* || die
67         fi
68
69         if use examples; then
70                 docinto example
71                 dodoc conf/* || die
72         fi
73
74         # perl daily cron script
75         dosbin expire-caller.pl || die
76         exeinto /etc/cron.daily
77         newexe "${FILESDIR}"/cron.daily ${PN} || die
78
79         # default configuration
80         insinto /etc/${PN}
81         newins conf/acng.conf ${PN}.conf || die
82         newins conf/report.html acng-report.html || die
83
84         # Some directories must exist
85         keepdir /var/log/${PN}
86         keepdir /var/run/${PN}
87
88         fowners ${PN}:${PN} \
89                 /etc/${PN} \
90                 /etc/${PN}/${PN}.conf \
91                 /etc/${PN}/acng-report.html \
92                 /var/log/${PN} \
93                 /var/run/${PN} || die
94 }
95
96 pkg_postinst() {
97         elog "Do not forget about edit configuration file and read manuals!"
98         elog "   Default file : /etc/${PN}/${PN}.conf"
99         elog "   Manual page  : man 8 apt-cache-ng"
100         elog "   Documentation: /usr/share/doc/${PF}"
101         if use fuse; then
102                 elog "You have choose to build fuse httpfs named 'acngfs'."
103                 elog "It's can be used to mount apt cache on server to client"
104                 elog "filesystem."
105                 elog "   Manual page  : man 8 acngfs"
106         fi
107         elog "Please note: this ebuild installs /etc/cron.daily/${PN} cron job."
108 }