/[gentoo-x86]/net-misc/cfengine/cfengine-3.3.4.ebuild
Gentoo

Contents of /net-misc/cfengine/cfengine-3.3.4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Aug 24 18:53:16 2012 UTC (7 years, 3 months ago) by idl0r
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Version bump

(Portage version: 2.2.0_alpha121/cvs/Linux x86_64)

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/cfengine/cfengine-3.3.4.ebuild,v 1.1 2012/06/24 19:59:54 idl0r Exp $
4
5 EAPI="4"
6
7 MY_PV="${PV//_beta/b}"
8 MY_PV="${MY_PV/_p/p}"
9 MY_P="${PN}-${MY_PV}"
10
11 DESCRIPTION="An automated suite of programs for configuring and maintaining
12 Unix-like computers"
13 HOMEPAGE="http://www.cfengine.org/"
14 SRC_URI="http://cfengine.com/source-code/download?file=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
15
16 LICENSE="GPL-3"
17 SLOT="3"
18 KEYWORDS="~amd64 ~arm ~ppc ~s390 ~sparc ~x86"
19
20 IUSE="examples html libvirt mysql postgres +qdbm selinux tests tokyocabinet vim-syntax"
21
22 DEPEND=">=sys-libs/db-4
23 mysql? ( virtual/mysql )
24 postgres? ( dev-db/postgresql-base )
25 selinux? ( sys-libs/libselinux )
26 tokyocabinet? ( dev-db/tokyocabinet )
27 qdbm? ( dev-db/qdbm )
28 libvirt? ( app-emulation/libvirt )
29 >=dev-libs/openssl-0.9.7
30 dev-libs/libpcre"
31 RDEPEND="${DEPEND}"
32 PDEPEND="vim-syntax? ( app-vim/cfengine-syntax )"
33
34 REQUIRED_USE="qdbm? ( !tokyocabinet )
35 tokyocabinet? ( !qdbm )
36 !tokyocabinet? ( qdbm )
37 !qdbm? ( tokyocabinet )"
38
39 S="${WORKDIR}/${MY_P}"
40
41 src_configure() {
42 # Enforce /var/cfengine for historical compatibility
43 econf \
44 --enable-fhs \
45 --docdir=/usr/share/doc/${PF} \
46 --with-workdir=/var/cfengine \
47 --with-pcre \
48 $(use_with qdbm) \
49 $(use_with tokyocabinet) \
50 $(use_with postgres postgresql) \
51 $(use_with mysql) \
52 $(use_with libvirt) \
53 $(use_enable selinux)
54
55 # Fix Makefile to skip inputs, see below "examples"
56 #sed -i -e 's/\(SUBDIRS.*\) inputs/\1/' Makefile || die
57
58 # We install documentation through portage
59 sed -i -e 's/\(install-data-am.*\) install-docDATA/\1/' Makefile || die
60 }
61
62 src_install() {
63 newinitd "${FILESDIR}"/cf-serverd.rc6 cf-serverd || die
64 newinitd "${FILESDIR}"/cf-monitord.rc6 cf-monitord || die
65 newinitd "${FILESDIR}"/cf-execd.rc6 cf-execd || die
66
67 emake DESTDIR="${D}" install || die
68
69 # Evil workaround for now..
70 mv "${D}"/usr/share/doc/${PN}/ "${D}"/usr/share/doc/${PF}
71
72 dodoc AUTHORS
73
74 if ! use examples; then
75 rm -rf "${D}"/usr/share/doc/${PF}/example*
76 fi
77
78 # Create cfengine working directory
79 dodir /var/cfengine/bin
80 fperms 700 /var/cfengine
81
82 # Copy cfagent into the cfengine tree otherwise cfexecd won't
83 # find it. Most hosts cache their copy of the cfengine
84 # binaries here. This is the default search location for the
85 # binaries.
86 for bin in know promises agent monitord serverd execd runagent key report; do
87 dosym /usr/sbin/cf-$bin /var/cfengine/bin/cf-$bin || die
88 done
89
90 if use html; then
91 docinto html
92 dohtml -r docs/ || die
93 fi
94 }
95
96 pkg_postinst() {
97 echo
98 elog "NOTE: BDB (BerkelyDB) support has been removed as of ${PN}-3.3.0"
99 echo
100 einfo "Init scripts for cf-serverd, cf-monitord, and cf-execd are provided."
101 einfo
102 einfo "To run cfengine out of cron every half hour modify your crontab:"
103 einfo "0,30 * * * * /usr/sbin/cf-execd -F"
104 echo
105
106 elog "If you run cfengine the very first time, you MUST generate the keys for cfengine by running:"
107 elog "emerge --config ${CATEGORY}/${PN}"
108
109 # Fix old cf-servd, remove it after some releases.
110 local found=0
111 for fname in $(find /etc/runlevels/ -type f -or -type l -name 'cf-servd'); do
112 found=1
113 rm $fname
114 ln -s /etc/init.d/cf-serverd $(echo $fname | sed 's:cf-servd:cf-serverd:')
115 done
116
117 if [ "${found}" -eq 1 ]; then
118 echo
119 elog "/etc/init.d/cf-servd has been renamed to /etc/init.d/cf-serverd"
120 fi
121 }
122
123 pkg_config() {
124 if [ "${ROOT}" == "/" ]; then
125 if [ ! -f "/var/cfengine/ppkeys/localhost.priv" ]; then
126 einfo "Generating keys for localhost."
127 /usr/sbin/cf-key
128 fi
129 else
130 die "cfengine cfkey does not support any value of ROOT other than /."
131 fi
132 }

  ViewVC Help
Powered by ViewVC 1.1.20