1 |
# Copyright 1999-2008 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/cfengine/cfengine-2.1.22-r1.ebuild,v 1.6 2008/09/27 16:17:37 armin76 Exp $ |
4 |
|
5 |
inherit eutils |
6 |
|
7 |
DESCRIPTION="An automated suite of programs for configuring and maintaining |
8 |
Unix-like computers" |
9 |
HOMEPAGE="http://www.cfengine.org/" |
10 |
SRC_URI="http://www.cfengine.org/downloads/${P}.tar.gz" |
11 |
|
12 |
LICENSE="GPL-2" |
13 |
SLOT="0" |
14 |
KEYWORDS="amd64 arm ppc sparc x86" |
15 |
IUSE="" |
16 |
|
17 |
DEPEND=">=sys-libs/db-3.2 |
18 |
>=dev-libs/openssl-0.9.7" |
19 |
|
20 |
src_unpack() { |
21 |
unpack ${A} |
22 |
|
23 |
epatch ${FILESDIR}/${P}-package-fix.patch |
24 |
} |
25 |
|
26 |
src_compile() { |
27 |
# Enforce /var/cfengine for historical compatibility |
28 |
econf \ |
29 |
--with-workdir=/var/cfengine \ |
30 |
--with-berkeleydb=/usr || die |
31 |
|
32 |
# Fix Makefile to skip doc,inputs, & contrib install to wrong locations |
33 |
sed -i -e 's/\(DIST_SUBDIRS.*\) contrib inputs doc/\1/' Makefile |
34 |
sed -i -e 's/\(SUBDIRS.*\) contrib inputs/\1/' Makefile |
35 |
sed -i -e 's/\(install-data-am.*\) install-docDATA/\1/' Makefile |
36 |
|
37 |
emake || die |
38 |
} |
39 |
|
40 |
src_install() { |
41 |
newinitd "${FILESDIR}"/cfservd.rc6 cfservd |
42 |
|
43 |
make DESTDIR="${D}" install || die |
44 |
dodoc AUTHORS ChangeLog README TODO INSTALL |
45 |
|
46 |
# Manually install doc and inputs |
47 |
doinfo doc/*.info* |
48 |
dohtml doc/*.html |
49 |
doman doc/*.8 |
50 |
dodoc ${FILESDIR}/cfportage.README |
51 |
docinto examples |
52 |
dodoc inputs/*.example |
53 |
|
54 |
# Create cfengine working directory |
55 |
mkdir -p ${D}/var/cfengine |
56 |
fperms 700 /var/cfengine |
57 |
keepdir /var/cfengine/bin |
58 |
keepdir /var/cfengine/inputs |
59 |
dodir /var/cfengine/modules |
60 |
tar jxf ${FILESDIR}/module-cfportage.tbz2 -C ${D}/var/cfengine/modules |
61 |
fowners root:0 /var/cfengine/modules/module\:cfportage |
62 |
} |
63 |
|
64 |
pkg_postinst() { |
65 |
if [ ! -f "/var/cfengine/ppkeys/localhost.priv" ] |
66 |
then |
67 |
einfo "Generating keys for localhost." |
68 |
/usr/sbin/cfkey |
69 |
fi |
70 |
|
71 |
# Copy cfagent into the cfengine tree otherwise cfexecd won't |
72 |
# find it. Most hosts cache their copy of the cfengine |
73 |
# binaries here. This is the default search location for the |
74 |
# binaries. |
75 |
|
76 |
cp /usr/sbin/cf{agent,servd,execd} /var/cfengine/bin/ |
77 |
|
78 |
einfo |
79 |
einfo "Now an init script for cfservd is provided." |
80 |
einfo |
81 |
einfo "To run cfengine out of cron every half hour modify your crontab:" |
82 |
einfo "0,30 * * * * /usr/sbin/cfexecd -F" |
83 |
einfo |
84 |
} |