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

Contents of /net-misc/cfengine/cfengine-2.2.10-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations) (download)
Wed Jul 25 20:28:20 2012 UTC (2 years, 11 months ago) by idl0r
Branch: MAIN
Changes since 1.6: +3 -2 lines
Add missing sys-devel/flex DEPEND

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

1 ago 1.2 # Copyright 1999-2012 Gentoo Foundation
2 robbat2 1.1 # Distributed under the terms of the GNU General Public License v2
3 idl0r 1.7 # $Header: /var/cvsroot/gentoo-x86/net-misc/cfengine/cfengine-2.2.10-r4.ebuild,v 1.6 2012/07/25 20:25:30 idl0r Exp $
4 robbat2 1.1
5     EAPI="2"
6    
7 idl0r 1.5 inherit eutils multilib
8 robbat2 1.1
9     DESCRIPTION="An automated suite of programs for configuring and maintaining
10     Unix-like computers"
11     HOMEPAGE="http://www.cfengine.org/"
12     SRC_URI="http://cfengine.com/source_code/download?file=${P}.tar.gz -> ${P}.tar.gz"
13    
14     LICENSE="GPL-2"
15     SLOT="0"
16 maekke 1.4 KEYWORDS="amd64 arm ~ppc ~s390 ~sparc x86"
17 robbat2 1.1 IUSE="vim-syntax"
18    
19 idl0r 1.6 RDEPEND=">=sys-libs/db-4
20 robbat2 1.1 >=dev-libs/openssl-0.9.7
21     app-portage/portage-utils"
22 idl0r 1.6 DEPEND="${RDEPEND}
23 idl0r 1.7 virtual/yacc
24     sys-devel/flex"
25 robbat2 1.1 PDEPEND="vim-syntax? ( app-vim/cfengine-syntax )"
26    
27     src_prepare() {
28     # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=520696
29     # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=511666
30     # http://bugs.gentoo.org/339808
31     epatch "${FILESDIR}/admit-noclass-520696.patch" \
32     "${FILESDIR}/511666-segfault.patch" \
33     "${FILESDIR}/${P}-snprintf_buffer_overflow.patch"
34    
35     # 2048 causes crashes on some 32-bit hardened kernels, and the warning
36     # messages say to turn it back down.
37     use x86 && sed -ie "s:CF_IFREQ 2048:CF_IFREQ 1024:g" src/cf.defs.h
38     }
39    
40     src_configure() {
41     # Enforce /var/cfengine for historical compatibility
42     econf \
43     --with-workdir=/var/cfengine \
44     --with-berkeleydb=/usr
45    
46     # Fix Makefile to skip doc,inputs, & contrib install to wrong locations
47     sed -i -e 's/\(DIST_SUBDIRS.*\) contrib inputs doc/\1/' Makefile
48     sed -i -e 's/\(SUBDIRS.*\) contrib inputs/\1/' Makefile
49     sed -i -e 's/\(install-data-am.*\) install-docDATA/\1/' Makefile
50    
51     # Fix man pages
52     sed -i -e 's/\/usr\/local/\/usr/' doc/*.8
53     }
54    
55     src_install() {
56     newinitd "${FILESDIR}"/cfservd.rc6 cfservd || die
57     newinitd "${FILESDIR}"/cfenvd.rc6 cfenvd || die
58     newinitd "${FILESDIR}"/cfexecd.rc6 cfexecd || die
59    
60     make DESTDIR="${D}" install || die
61    
62     # Remove static library and libtool file as they are not needed
63     rm "${D}"/usr/$(get_libdir)/*.la
64     rm "${D}"/usr/$(get_libdir)/*.a
65    
66     dodoc AUTHORS ChangeLog README TODO INSTALL
67    
68     # Manually install doc and inputs
69     doman doc/*.8
70     docinto examples
71     doinfo doc/*.info*
72     dodoc inputs/*.example
73    
74     # Create cfengine working directory
75     mkdir -p "${D}"/var/cfengine
76     fperms 700 /var/cfengine
77     keepdir /var/cfengine/bin
78     keepdir /var/cfengine/inputs
79     dodir /var/cfengine/modules
80     }
81    
82     pkg_postinst() {
83     # Copy cfagent into the cfengine tree otherwise cfexecd won't
84     # find it. Most hosts cache their copy of the cfengine
85     # binaries here. This is the default search location for the
86     # binaries.
87    
88     cp -f /usr/sbin/cf{agent,servd,execd} "${ROOT}"/var/cfengine/bin/
89    
90     einfo
91     einfo "NOTE: The cfportage module has been deprecated in favor of the"
92     einfo " upstream 'packages' action."
93     einfo
94     einfo "Init scripts for cfservd, cfenvd, and cfexecd are now provided."
95     einfo
96     einfo "To run cfengine out of cron every half hour modify your crontab:"
97     einfo "0,30 * * * * /usr/sbin/cfexecd -F"
98     einfo
99    
100     elog "You MUST generate the keys for cfengine by running:"
101     elog "emerge --config ${CATEGORY}/${PN}"
102     }
103    
104     pkg_config() {
105     if [ "${ROOT}" == "/" ]; then
106     if [ ! -f "/var/cfengine/ppkeys/localhost.priv" ]; then
107     einfo "Generating keys for localhost."
108     /usr/sbin/cfkey
109     fi
110     else
111     die "cfengine cfkey does not support any value of ROOT other than /."
112     fi
113     }

  ViewVC Help
Powered by ViewVC 1.1.20