1 |
# Copyright 1999-2012 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/apt-cacher-ng/apt-cacher-ng-0.6.12.ebuild,v 1.1 2012/01/17 04:45:21 jer Exp $ |
4 |
|
5 |
EAPI="4" |
6 |
|
7 |
inherit eutils cmake-utils |
8 |
|
9 |
DESCRIPTION="Yet another implementation of an HTTP proxy for Debian/Ubuntu software packages written in C++" |
10 |
HOMEPAGE="http://www.unix-ag.uni-kl.de/~bloch/acng/" |
11 |
LICENSE="as-is" |
12 |
SLOT="0" |
13 |
SRC_URI="mirror://debian/pool/main/a/${PN}/${PN}_${PV}.orig.tar.xz" |
14 |
|
15 |
KEYWORDS="~amd64 ~x86" |
16 |
IUSE="doc fuse lzma tcpd" |
17 |
|
18 |
COMMON_DEPEND=" |
19 |
app-arch/bzip2 |
20 |
sys-libs/zlib |
21 |
" |
22 |
DEPEND=" |
23 |
${COMMON_DEPEND} |
24 |
app-arch/xz-utils |
25 |
dev-util/cmake |
26 |
" |
27 |
RDEPEND=" |
28 |
${COMMON_DEPEND} |
29 |
lzma? ( app-arch/xz-utils ) |
30 |
fuse? ( sys-fs/fuse ) |
31 |
tcpd? ( sys-apps/tcp-wrappers ) |
32 |
dev-lang/perl |
33 |
" |
34 |
|
35 |
pkg_setup() { |
36 |
# add new user & group for daemon |
37 |
enewgroup ${PN} |
38 |
enewuser ${PN} -1 -1 -1 ${PN} |
39 |
} |
40 |
|
41 |
src_configure(){ |
42 |
mycmakeargs="-DCMAKE_INSTALL_PREFIX=/usr" |
43 |
if use fuse; then |
44 |
mycmakeargs="-DHAVE_FUSE_26=yes ${mycmakeargs}" |
45 |
else |
46 |
mycmakeargs="-DHAVE_FUSE_26=no ${mycmakeargs}" |
47 |
fi |
48 |
if use lzma; then |
49 |
mycmakeargs="-DHAVE_LZMA=yes ${mycmakeargs}" |
50 |
else |
51 |
mycmakeargs="-DHAVE_LZMA=no ${mycmakeargs}" |
52 |
fi |
53 |
if use tcpd; then |
54 |
mycmakeargs="-DHAVE_LIBWRAP=yes ${mycmakeargs}" |
55 |
else |
56 |
mycmakeargs="-DHAVE_LIBWRAP=no ${mycmakeargs}" |
57 |
fi |
58 |
|
59 |
cmake-utils_src_configure |
60 |
} |
61 |
|
62 |
src_install() { |
63 |
pushd ${CMAKE_BUILD_DIR} |
64 |
dosbin ${PN} |
65 |
if use fuse; then |
66 |
dobin acngfs |
67 |
fi |
68 |
popd |
69 |
|
70 |
newinitd "${FILESDIR}"/initd ${PN} |
71 |
newconfd "${FILESDIR}"/confd ${PN} |
72 |
|
73 |
insinto /etc/logrotate.d |
74 |
newins "${FILESDIR}"/logrotate ${PN} |
75 |
|
76 |
doman doc/man/${PN}* |
77 |
if use fuse; then |
78 |
doman doc/man/acngfs* |
79 |
fi |
80 |
|
81 |
# Documentation |
82 |
dodoc README TODO VERSION INSTALL ChangeLog |
83 |
if use doc; then |
84 |
dodoc doc/*.pdf |
85 |
dohtml doc/html/* |
86 |
docinto examples/conf |
87 |
dodoc conf/* |
88 |
fi |
89 |
|
90 |
# perl daily cron script |
91 |
dosbin expire-caller.pl |
92 |
exeinto /etc/cron.daily |
93 |
newexe "${FILESDIR}"/cron.daily ${PN} |
94 |
|
95 |
# default configuration |
96 |
insinto /etc/${PN} |
97 |
newins conf/acng.conf ${PN}.conf |
98 |
doins $( echo conf/* | sed 's|conf/acng.conf||g' ) |
99 |
|
100 |
dodir /var/cache/${PN} |
101 |
dodir /var/log/${PN} |
102 |
# Some directories must exists |
103 |
keepdir /var/log/${PN} |
104 |
keepdir /var/run/${PN} |
105 |
fowners -R ${PN}:${PN} \ |
106 |
/etc/${PN} \ |
107 |
/var/log/${PN} \ |
108 |
/var/cache/${PN} \ |
109 |
/var/run/${PN} |
110 |
} |