You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
116 lines
3.2 KiB
116 lines
3.2 KiB
5 years ago
|
# Copyright 1999-2019 Gentoo Authors
|
||
13 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
5 years ago
|
EAPI=7
|
||
13 years ago
|
|
||
|
DESCRIPTION="An automated suite of programs for configuring and maintaining
|
||
|
Unix-like computers"
|
||
|
HOMEPAGE="http://www.cfengine.org/"
|
||
|
SRC_URI="http://cfengine.com/source_code/download?file=${P}.tar.gz -> ${P}.tar.gz"
|
||
|
|
||
|
LICENSE="GPL-2"
|
||
|
SLOT="0"
|
||
5 years ago
|
KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~s390 ~sparc ~x86"
|
||
13 years ago
|
IUSE="vim-syntax"
|
||
|
|
||
5 years ago
|
RDEPEND=">=sys-libs/db-4:=
|
||
|
<dev-libs/openssl-1.1:=
|
||
6 years ago
|
app-portage/portage-utils
|
||
5 years ago
|
net-libs/libnsl:="
|
||
12 years ago
|
DEPEND="${RDEPEND}
|
||
|
virtual/yacc
|
||
|
sys-devel/flex"
|
||
13 years ago
|
PDEPEND="vim-syntax? ( app-vim/cfengine-syntax )"
|
||
|
|
||
|
src_prepare() {
|
||
5 years ago
|
eapply_user
|
||
|
|
||
13 years ago
|
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=520696
|
||
|
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=511666
|
||
9 years ago
|
# https://bugs.gentoo.org/339808
|
||
5 years ago
|
eapply "${FILESDIR}/admit-noclass-520696.patch" \
|
||
13 years ago
|
"${FILESDIR}/511666-segfault.patch" \
|
||
|
"${FILESDIR}/${P}-snprintf_buffer_overflow.patch"
|
||
|
|
||
|
# 2048 causes crashes on some 32-bit hardened kernels, and the warning
|
||
|
# messages say to turn it back down.
|
||
5 years ago
|
if use x86; then
|
||
|
sed -i -e "s:CF_IFREQ 2048:CF_IFREQ 1024:g" src/cf.defs.h || die
|
||
|
fi
|
||
13 years ago
|
}
|
||
|
|
||
|
src_configure() {
|
||
|
# Enforce /var/cfengine for historical compatibility
|
||
|
econf \
|
||
5 years ago
|
--disable-static \
|
||
13 years ago
|
--with-workdir=/var/cfengine \
|
||
|
--with-berkeleydb=/usr
|
||
|
|
||
|
# Fix Makefile to skip doc,inputs, & contrib install to wrong locations
|
||
5 years ago
|
sed -i -e 's/\(DIST_SUBDIRS.*\) contrib inputs doc/\1/' \
|
||
|
-e 's/\(SUBDIRS.*\) contrib inputs/\1/' \
|
||
|
-e 's/\(install-data-am.*\) install-docDATA/\1/' Makefile || die
|
||
13 years ago
|
|
||
|
# Fix man pages
|
||
5 years ago
|
sed -i -e 's@/usr/local@/usr@' doc/*.8 || die
|
||
13 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
5 years ago
|
newinitd "${FILESDIR}"/cfservd.rc6 cfservd
|
||
|
newinitd "${FILESDIR}"/cfenvd.rc6 cfenvd
|
||
|
newinitd "${FILESDIR}"/cfexecd.rc6 cfexecd
|
||
13 years ago
|
|
||
5 years ago
|
emake DESTDIR="${D}" install
|
||
13 years ago
|
|
||
|
# Remove static library and libtool file as they are not needed
|
||
5 years ago
|
rm "${ED}"/usr/$(get_libdir)/*.la || die
|
||
13 years ago
|
|
||
|
dodoc AUTHORS ChangeLog README TODO INSTALL
|
||
|
|
||
|
# Manually install doc and inputs
|
||
|
doman doc/*.8
|
||
|
doinfo doc/*.info*
|
||
5 years ago
|
docinto examples
|
||
13 years ago
|
dodoc inputs/*.example
|
||
|
|
||
|
# Create cfengine working directory
|
||
5 years ago
|
dodir /var/cfengine
|
||
13 years ago
|
fperms 700 /var/cfengine
|
||
|
keepdir /var/cfengine/bin
|
||
|
keepdir /var/cfengine/inputs
|
||
5 years ago
|
keepdir /var/cfengine/modules
|
||
13 years ago
|
}
|
||
|
|
||
|
pkg_postinst() {
|
||
|
# Copy cfagent into the cfengine tree otherwise cfexecd won't
|
||
|
# find it. Most hosts cache their copy of the cfengine
|
||
|
# binaries here. This is the default search location for the
|
||
|
# binaries.
|
||
|
|
||
|
cp -f /usr/sbin/cf{agent,servd,execd} "${ROOT}"/var/cfengine/bin/
|
||
|
|
||
|
einfo
|
||
|
einfo "NOTE: The cfportage module has been deprecated in favor of the"
|
||
|
einfo " upstream 'packages' action."
|
||
|
einfo
|
||
|
einfo "Init scripts for cfservd, cfenvd, and cfexecd are now provided."
|
||
|
einfo
|
||
|
einfo "To run cfengine out of cron every half hour modify your crontab:"
|
||
|
einfo "0,30 * * * * /usr/sbin/cfexecd -F"
|
||
|
einfo
|
||
|
|
||
|
elog "You MUST generate the keys for cfengine by running:"
|
||
|
elog "emerge --config ${CATEGORY}/${PN}"
|
||
|
}
|
||
|
|
||
|
pkg_config() {
|
||
5 years ago
|
if [[ -z ${ROOT} ]]; then
|
||
|
if [[ ! -f ${EPREFIX}/var/cfengine/ppkeys/localhost.priv ]]; then
|
||
13 years ago
|
einfo "Generating keys for localhost."
|
||
5 years ago
|
"${EPREFIX}"/usr/sbin/cfkey
|
||
13 years ago
|
fi
|
||
|
else
|
||
|
die "cfengine cfkey does not support any value of ROOT other than /."
|
||
|
fi
|
||
|
}
|