public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-misc/cfengine/, net-misc/cfengine/files/
@ 2019-10-04 19:10 Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2019-10-04 19:10 UTC (permalink / raw
  To: gentoo-commits

commit:     929c4f7fc061017b6c5aba9ec43ec23961d293bd
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  4 19:07:12 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Oct  4 19:07:49 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=929c4f7f

net-misc/cfengine: Bump 2.2.10 to EAPI 7

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 net-misc/cfengine/cfengine-2.2.10-r5.ebuild        | 115 +++++++++++++++++++++
 .../cfengine-2.2.10-snprintf_buffer_overflow.patch |   4 +-
 2 files changed, 117 insertions(+), 2 deletions(-)

diff --git a/net-misc/cfengine/cfengine-2.2.10-r5.ebuild b/net-misc/cfengine/cfengine-2.2.10-r5.ebuild
new file mode 100644
index 00000000000..22bdd71cfd9
--- /dev/null
+++ b/net-misc/cfengine/cfengine-2.2.10-r5.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+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"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="vim-syntax"
+
+RDEPEND=">=sys-libs/db-4:=
+	<dev-libs/openssl-1.1:=
+	app-portage/portage-utils
+	net-libs/libnsl:="
+DEPEND="${RDEPEND}
+	virtual/yacc
+	sys-devel/flex"
+PDEPEND="vim-syntax? ( app-vim/cfengine-syntax )"
+
+src_prepare() {
+	eapply_user
+
+	# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=520696
+	# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=511666
+	# https://bugs.gentoo.org/339808
+	eapply "${FILESDIR}/admit-noclass-520696.patch" \
+		"${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.
+	if use x86; then
+		sed -i -e "s:CF_IFREQ 2048:CF_IFREQ 1024:g" src/cf.defs.h || die
+	fi
+}
+
+src_configure() {
+	# Enforce /var/cfengine for historical compatibility
+	econf \
+		--disable-static \
+		--with-workdir=/var/cfengine \
+		--with-berkeleydb=/usr
+
+	# Fix Makefile to skip doc,inputs, & contrib install to wrong locations
+	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
+
+	# Fix man pages
+	sed -i -e 's@/usr/local@/usr@' doc/*.8 || die
+}
+
+src_install() {
+	newinitd "${FILESDIR}"/cfservd.rc6 cfservd
+	newinitd "${FILESDIR}"/cfenvd.rc6 cfenvd
+	newinitd "${FILESDIR}"/cfexecd.rc6 cfexecd
+
+	emake DESTDIR="${D}" install
+
+	# Remove static library and libtool file as they are not needed
+	rm "${ED}"/usr/$(get_libdir)/*.la || die
+
+	dodoc AUTHORS ChangeLog README TODO INSTALL
+
+	# Manually install doc and inputs
+	doman doc/*.8
+	doinfo doc/*.info*
+	docinto examples
+	dodoc inputs/*.example
+
+	# Create cfengine working directory
+	dodir /var/cfengine
+	fperms 700 /var/cfengine
+	keepdir /var/cfengine/bin
+	keepdir /var/cfengine/inputs
+	keepdir /var/cfengine/modules
+}
+
+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() {
+	if [[ -z ${ROOT} ]]; then
+		if [[ ! -f ${EPREFIX}/var/cfengine/ppkeys/localhost.priv ]]; then
+			einfo "Generating keys for localhost."
+			"${EPREFIX}"/usr/sbin/cfkey
+		fi
+	else
+		die "cfengine cfkey does not support any value of ROOT other than /."
+	fi
+}

diff --git a/net-misc/cfengine/files/cfengine-2.2.10-snprintf_buffer_overflow.patch b/net-misc/cfengine/files/cfengine-2.2.10-snprintf_buffer_overflow.patch
index dee9b797f6a..80a3a542974 100644
--- a/net-misc/cfengine/files/cfengine-2.2.10-snprintf_buffer_overflow.patch
+++ b/net-misc/cfengine/files/cfengine-2.2.10-snprintf_buffer_overflow.patch
@@ -1,5 +1,5 @@
---- src/instrument.c.old	2010-10-15 22:20:58.014091858 +0200
-+++ src/instrument.c	2010-10-15 22:21:34.132271440 +0200
+--- a/src/instrument.c.old	2010-10-15 22:20:58.014091858 +0200
++++ b/src/instrument.c	2010-10-15 22:21:34.132271440 +0200
 @@ -542,7 +542,7 @@ while (dbcp->c_get(dbcp, &key, &value, D
     
     tthen = (time_t)then;


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-misc/cfengine/, net-misc/cfengine/files/
@ 2020-01-07  2:03 Robin H. Johnson
  0 siblings, 0 replies; 2+ messages in thread
From: Robin H. Johnson @ 2020-01-07  2:03 UTC (permalink / raw
  To: gentoo-commits

commit:     4edd04b727e428dbe617c8a56d304ca23e00cf79
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  7 02:03:21 2020 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Tue Jan  7 02:03:45 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4edd04b7

net-misc/cfengine: string parsing fix for infra

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 net-misc/cfengine/cfengine-2.2.10-r6.ebuild        | 116 +++++++++++++++++++++
 .../files/cfengine-2.2.10-lsbrelease.patch         |  24 +++++
 2 files changed, 140 insertions(+)

diff --git a/net-misc/cfengine/cfengine-2.2.10-r6.ebuild b/net-misc/cfengine/cfengine-2.2.10-r6.ebuild
new file mode 100644
index 00000000000..87d5fa9341e
--- /dev/null
+++ b/net-misc/cfengine/cfengine-2.2.10-r6.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+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"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="vim-syntax"
+
+RDEPEND=">=sys-libs/db-4:=
+	<dev-libs/openssl-1.1:=
+	app-portage/portage-utils
+	net-libs/libnsl:="
+DEPEND="${RDEPEND}
+	virtual/yacc
+	sys-devel/flex"
+PDEPEND="vim-syntax? ( app-vim/cfengine-syntax )"
+
+src_prepare() {
+	eapply_user
+
+	# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=520696
+	# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=511666
+	# https://bugs.gentoo.org/339808
+	eapply "${FILESDIR}/admit-noclass-520696.patch" \
+		"${FILESDIR}/511666-segfault.patch" \
+		"${FILESDIR}/${P}-snprintf_buffer_overflow.patch" \
+		"${FILESDIR}/${PN}-2.2.10-lsbrelease.patch"
+
+	# 2048 causes crashes on some 32-bit hardened kernels, and the warning
+	# messages say to turn it back down.
+	if use x86; then
+		sed -i -e "s:CF_IFREQ 2048:CF_IFREQ 1024:g" src/cf.defs.h || die
+	fi
+}
+
+src_configure() {
+	# Enforce /var/cfengine for historical compatibility
+	econf \
+		--disable-static \
+		--with-workdir=/var/cfengine \
+		--with-berkeleydb=/usr
+
+	# Fix Makefile to skip doc,inputs, & contrib install to wrong locations
+	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
+
+	# Fix man pages
+	sed -i -e 's@/usr/local@/usr@' doc/*.8 || die
+}
+
+src_install() {
+	newinitd "${FILESDIR}"/cfservd.rc6 cfservd
+	newinitd "${FILESDIR}"/cfenvd.rc6 cfenvd
+	newinitd "${FILESDIR}"/cfexecd.rc6 cfexecd
+
+	emake DESTDIR="${D}" install
+
+	# Remove static library and libtool file as they are not needed
+	rm "${ED}"/usr/$(get_libdir)/*.la || die
+
+	dodoc AUTHORS ChangeLog README TODO INSTALL
+
+	# Manually install doc and inputs
+	doman doc/*.8
+	doinfo doc/*.info*
+	docinto examples
+	dodoc inputs/*.example
+
+	# Create cfengine working directory
+	dodir /var/cfengine
+	fperms 700 /var/cfengine
+	keepdir /var/cfengine/bin
+	keepdir /var/cfengine/inputs
+	keepdir /var/cfengine/modules
+}
+
+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() {
+	if [[ -z ${ROOT} ]]; then
+		if [[ ! -f ${EPREFIX}/var/cfengine/ppkeys/localhost.priv ]]; then
+			einfo "Generating keys for localhost."
+			"${EPREFIX}"/usr/sbin/cfkey
+		fi
+	else
+		die "cfengine cfkey does not support any value of ROOT other than /."
+	fi
+}

diff --git a/net-misc/cfengine/files/cfengine-2.2.10-lsbrelease.patch b/net-misc/cfengine/files/cfengine-2.2.10-lsbrelease.patch
new file mode 100644
index 00000000000..6f8dfa04d8f
--- /dev/null
+++ b/net-misc/cfengine/files/cfengine-2.2.10-lsbrelease.patch
@@ -0,0 +1,24 @@
+Newer GCC mis-compiles the lsb_release reader function.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+
+--- cfengine-2.2.10/src/misc.c	2009-02-10 21:55:36.000000000 -0800
++++ cfengine-2.2.10/src/misc.c	2020-01-06 17:58:07.049226386 -0800
+@@ -1187,6 +1187,7 @@ if ((fp = cfpopen(VBUFF, "r")) == NULL)
+ 
+ if (ReadLine(VBUFF, CF_BUFSIZE, fp))
+    {
++   Debug4("(%s)",VBUFF);
+    char * buffer = VBUFF;
+    strsep(&buffer, ":");
+    
+@@ -1198,7 +1199,8 @@ if (ReadLine(VBUFF, CF_BUFSIZE, fp))
+    info = buffer;
+    while((*buffer != '\0') && !isspace(*buffer))
+       {
+-      *buffer = tolower(*buffer++);
++      *buffer = tolower(*buffer);
++      buffer++;
+       }
+    
+    *buffer = '\0';


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-07  2:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-04 19:10 [gentoo-commits] repo/gentoo:master commit in: net-misc/cfengine/, net-misc/cfengine/files/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2020-01-07  2:03 Robin H. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox