Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/cfengine/, net-misc/cfengine/files/
Date: Fri, 04 Oct 2019 19:10:36
Message-Id: 1570216069.929c4f7fc061017b6c5aba9ec43ec23961d293bd.mgorny@gentoo
1 commit: 929c4f7fc061017b6c5aba9ec43ec23961d293bd
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 4 19:07:12 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 4 19:07:49 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=929c4f7f
7
8 net-misc/cfengine: Bump 2.2.10 to EAPI 7
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 net-misc/cfengine/cfengine-2.2.10-r5.ebuild | 115 +++++++++++++++++++++
13 .../cfengine-2.2.10-snprintf_buffer_overflow.patch | 4 +-
14 2 files changed, 117 insertions(+), 2 deletions(-)
15
16 diff --git a/net-misc/cfengine/cfengine-2.2.10-r5.ebuild b/net-misc/cfengine/cfengine-2.2.10-r5.ebuild
17 new file mode 100644
18 index 00000000000..22bdd71cfd9
19 --- /dev/null
20 +++ b/net-misc/cfengine/cfengine-2.2.10-r5.ebuild
21 @@ -0,0 +1,115 @@
22 +# Copyright 1999-2019 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=7
26 +
27 +DESCRIPTION="An automated suite of programs for configuring and maintaining
28 +Unix-like computers"
29 +HOMEPAGE="http://www.cfengine.org/"
30 +SRC_URI="http://cfengine.com/source_code/download?file=${P}.tar.gz -> ${P}.tar.gz"
31 +
32 +LICENSE="GPL-2"
33 +SLOT="0"
34 +KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~s390 ~sparc ~x86"
35 +IUSE="vim-syntax"
36 +
37 +RDEPEND=">=sys-libs/db-4:=
38 + <dev-libs/openssl-1.1:=
39 + app-portage/portage-utils
40 + net-libs/libnsl:="
41 +DEPEND="${RDEPEND}
42 + virtual/yacc
43 + sys-devel/flex"
44 +PDEPEND="vim-syntax? ( app-vim/cfengine-syntax )"
45 +
46 +src_prepare() {
47 + eapply_user
48 +
49 + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=520696
50 + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=511666
51 + # https://bugs.gentoo.org/339808
52 + eapply "${FILESDIR}/admit-noclass-520696.patch" \
53 + "${FILESDIR}/511666-segfault.patch" \
54 + "${FILESDIR}/${P}-snprintf_buffer_overflow.patch"
55 +
56 + # 2048 causes crashes on some 32-bit hardened kernels, and the warning
57 + # messages say to turn it back down.
58 + if use x86; then
59 + sed -i -e "s:CF_IFREQ 2048:CF_IFREQ 1024:g" src/cf.defs.h || die
60 + fi
61 +}
62 +
63 +src_configure() {
64 + # Enforce /var/cfengine for historical compatibility
65 + econf \
66 + --disable-static \
67 + --with-workdir=/var/cfengine \
68 + --with-berkeleydb=/usr
69 +
70 + # Fix Makefile to skip doc,inputs, & contrib install to wrong locations
71 + sed -i -e 's/\(DIST_SUBDIRS.*\) contrib inputs doc/\1/' \
72 + -e 's/\(SUBDIRS.*\) contrib inputs/\1/' \
73 + -e 's/\(install-data-am.*\) install-docDATA/\1/' Makefile || die
74 +
75 + # Fix man pages
76 + sed -i -e 's@/usr/local@/usr@' doc/*.8 || die
77 +}
78 +
79 +src_install() {
80 + newinitd "${FILESDIR}"/cfservd.rc6 cfservd
81 + newinitd "${FILESDIR}"/cfenvd.rc6 cfenvd
82 + newinitd "${FILESDIR}"/cfexecd.rc6 cfexecd
83 +
84 + emake DESTDIR="${D}" install
85 +
86 + # Remove static library and libtool file as they are not needed
87 + rm "${ED}"/usr/$(get_libdir)/*.la || die
88 +
89 + dodoc AUTHORS ChangeLog README TODO INSTALL
90 +
91 + # Manually install doc and inputs
92 + doman doc/*.8
93 + doinfo doc/*.info*
94 + docinto examples
95 + dodoc inputs/*.example
96 +
97 + # Create cfengine working directory
98 + dodir /var/cfengine
99 + fperms 700 /var/cfengine
100 + keepdir /var/cfengine/bin
101 + keepdir /var/cfengine/inputs
102 + keepdir /var/cfengine/modules
103 +}
104 +
105 +pkg_postinst() {
106 + # Copy cfagent into the cfengine tree otherwise cfexecd won't
107 + # find it. Most hosts cache their copy of the cfengine
108 + # binaries here. This is the default search location for the
109 + # binaries.
110 +
111 + cp -f /usr/sbin/cf{agent,servd,execd} "${ROOT}"/var/cfengine/bin/
112 +
113 + einfo
114 + einfo "NOTE: The cfportage module has been deprecated in favor of the"
115 + einfo " upstream 'packages' action."
116 + einfo
117 + einfo "Init scripts for cfservd, cfenvd, and cfexecd are now provided."
118 + einfo
119 + einfo "To run cfengine out of cron every half hour modify your crontab:"
120 + einfo "0,30 * * * * /usr/sbin/cfexecd -F"
121 + einfo
122 +
123 + elog "You MUST generate the keys for cfengine by running:"
124 + elog "emerge --config ${CATEGORY}/${PN}"
125 +}
126 +
127 +pkg_config() {
128 + if [[ -z ${ROOT} ]]; then
129 + if [[ ! -f ${EPREFIX}/var/cfengine/ppkeys/localhost.priv ]]; then
130 + einfo "Generating keys for localhost."
131 + "${EPREFIX}"/usr/sbin/cfkey
132 + fi
133 + else
134 + die "cfengine cfkey does not support any value of ROOT other than /."
135 + fi
136 +}
137
138 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
139 index dee9b797f6a..80a3a542974 100644
140 --- a/net-misc/cfengine/files/cfengine-2.2.10-snprintf_buffer_overflow.patch
141 +++ b/net-misc/cfengine/files/cfengine-2.2.10-snprintf_buffer_overflow.patch
142 @@ -1,5 +1,5 @@
143 ---- src/instrument.c.old 2010-10-15 22:20:58.014091858 +0200
144 -+++ src/instrument.c 2010-10-15 22:21:34.132271440 +0200
145 +--- a/src/instrument.c.old 2010-10-15 22:20:58.014091858 +0200
146 ++++ b/src/instrument.c 2010-10-15 22:21:34.132271440 +0200
147 @@ -542,7 +542,7 @@ while (dbcp->c_get(dbcp, &key, &value, D
148
149 tthen = (time_t)then;