Gentoo Archives: gentoo-commits

From: Hans de Graaff <graaff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/puppet/
Date: Sat, 02 Sep 2017 07:19:57
Message-Id: 1504336788.42d2b86d1a0aceb4462708f0090a0a1b8bc0fb86.graaff@gentoo
1 commit: 42d2b86d1a0aceb4462708f0090a0a1b8bc0fb86
2 Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 2 07:14:52 2017 +0000
4 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 2 07:19:48 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=42d2b86d
7
8 app-admin/puppet: install missing locales, fixing bug 629382; add ruby24
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.2
11
12 app-admin/puppet/puppet-4.10.6-r1.ebuild | 194 +++++++++++++++++++++++++++++++
13 app-admin/puppet/puppet-5.1.0-r1.ebuild | 144 +++++++++++++++++++++++
14 2 files changed, 338 insertions(+)
15
16 diff --git a/app-admin/puppet/puppet-4.10.6-r1.ebuild b/app-admin/puppet/puppet-4.10.6-r1.ebuild
17 new file mode 100644
18 index 00000000000..61b202bc48c
19 --- /dev/null
20 +++ b/app-admin/puppet/puppet-4.10.6-r1.ebuild
21 @@ -0,0 +1,194 @@
22 +# Copyright 1999-2017 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI="6"
26 +
27 +USE_RUBY="ruby21 ruby22 ruby23"
28 +
29 +#RUBY_FAKEGEM_RECIPE_TEST="rspec3"
30 +
31 +RUBY_FAKEGEM_EXTRAINSTALL="locales"
32 +
33 +inherit xemacs-elisp-common eutils user ruby-fakegem versionator
34 +
35 +DESCRIPTION="A system automation and configuration management software."
36 +HOMEPAGE="http://puppetlabs.com/"
37 +SRC_URI="http://downloads.puppetlabs.com/puppet/${P}.tar.gz"
38 +
39 +LICENSE="Apache-2.0 GPL-2"
40 +SLOT="0"
41 +KEYWORDS="~amd64 ~arm ~hppa ~ppc ~x86"
42 +IUSE="augeas diff doc emacs experimental ldap rrdtool selinux shadow sqlite vim-syntax xemacs"
43 +RESTRICT="test"
44 +
45 +ruby_add_rdepend "
46 + dev-ruby/hiera
47 + >=dev-ruby/rgen-0.6.5
48 + dev-ruby/json:=
49 + >=dev-ruby/facter-3.0.0
50 + augeas? ( dev-ruby/ruby-augeas )
51 + diff? ( dev-ruby/diff-lcs )
52 + doc? ( dev-ruby/rdoc )
53 + ldap? ( dev-ruby/ruby-ldap )
54 + shadow? ( dev-ruby/ruby-shadow )
55 + sqlite? ( dev-ruby/sqlite3 )
56 + virtual/ruby-ssl"
57 +
58 +# ruby_add_bdepend "
59 +# test? (
60 +# dev-ruby/mocha:0.14
61 +# =dev-ruby/rack-1*
62 +# dev-ruby/rspec-its
63 +# dev-ruby/rspec-collection_matchers
64 +# >=dev-ruby/vcr-2.9:2
65 +# >=dev-ruby/webmock-1.24:0
66 +# )"
67 +
68 +DEPEND+=" ${DEPEND}
69 + xemacs? ( app-editors/xemacs )"
70 +RDEPEND+=" ${RDEPEND}
71 + rrdtool? ( >=net-analyzer/rrdtool-1.2.23[ruby] )
72 + selinux? (
73 + sys-libs/libselinux[ruby]
74 + sec-policy/selinux-puppet
75 + )
76 + vim-syntax? ( >=app-vim/puppet-syntax-3.0.1 )
77 + >=app-portage/eix-0.18.0"
78 +PDEPEND="emacs? ( >=app-emacs/puppet-mode-0.3-r1 )"
79 +
80 +SITEFILE="50${PN}-mode-gentoo.el"
81 +
82 +pkg_setup() {
83 + enewgroup puppet
84 + enewuser puppet -1 -1 /var/lib/puppet puppet
85 +}
86 +
87 +all_ruby_prepare() {
88 + # Avoid spec that require unpackaged json-schema.
89 + rm spec/lib/matchers/json.rb $( grep -Rl matchers/json spec) || die
90 +
91 + # can't be run within portage.
92 + epatch "${FILESDIR}/puppet-fix-tests-4.7.0.patch"
93 +
94 + # fix systemd path
95 + epatch "${FILESDIR}/puppet-systemd.patch"
96 +
97 + if use experimental; then
98 + epatch "${FILESDIR}/43e2c935252b995134ce353e5e6312cf77aea480.patch"
99 + fi
100 +
101 + # Use working version of mocha
102 + sed -i -e '1igem "mocha", "~>0.14.0"; gem "rack", "~>1.0"' spec/spec_helper.rb || die
103 +
104 + # Avoid specs that can only run in the puppet.git repository. This
105 + # should be narrowed down to the specific specs.
106 + rm spec/integration/parser/compiler_spec.rb || die
107 +
108 + # Avoid failing specs that need further investigation.
109 + sed -i -e '/should resolve external facts/,/^ end/ s:^:#:' \
110 + spec/integration/indirector/facts/facter_spec.rb || die
111 + sed -i -e "/describe 'cfacter'/,/^ end/ s:^:#:" spec/unit/defaults_spec.rb || die
112 + rm -f spec/unit/indirector/ldap_spec.rb \
113 + spec/unit/parser/functions/create_resources_spec.rb || die
114 +
115 + # Avoid specs that rely on tools from other OSs
116 + rm -f spec/unit/provider/package/{dnf,tdnf,yum}_spec.rb \
117 + spec/unit/provider/user/directoryservice_spec.rb || die
118 +
119 + # Avoid specs that depend on hiera-eyaml to avoid circular
120 + # dependencies
121 + rm -f spec/unit/functions/lookup_spec.rb || die
122 +
123 + # Avoid specs that fail due to an unpackaged file
124 + sed -i -e '/when loading pp resource types using auto loading/,/^ end/ s:^:#:' spec/unit/pops/loaders/loaders_spec.rb || die
125 +}
126 +
127 +all_ruby_compile() {
128 + if use xemacs ; then
129 + # Create a separate version for xemacs to be able to install
130 + # emacs and xemacs in parallel.
131 + mkdir ext/xemacs
132 + cp ext/emacs/* ext/xemacs/
133 + xemacs-elisp-compile ext/xemacs/puppet-mode.el
134 + fi
135 +}
136 +
137 +each_ruby_install() {
138 + each_fakegem_install
139 +# dosym "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${P}" "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${PN}"
140 +}
141 +
142 +all_ruby_install() {
143 + all_fakegem_install
144 +
145 + # systemd stuffs
146 + insinto /usr/lib/systemd/system
147 + doins "${WORKDIR}/all/${P}/ext/systemd/puppet.service"
148 +
149 + # tmpfiles stuff
150 + insinto /usr/lib/tmpfiles.d
151 + newins "${FILESDIR}/tmpfiles.d" "puppet.conf"
152 +
153 + # openrc init stuff
154 + newinitd "${FILESDIR}"/puppet.init-4.x puppet
155 + newinitd "${FILESDIR}"/puppetmaster.init-4.x puppetmaster
156 + newconfd "${FILESDIR}"/puppetmaster.confd puppetmaster
157 +
158 + keepdir /etc/puppetlabs/puppet/ssl
159 +
160 + keepdir /var/lib/puppet/facts
161 + keepdir /var/lib/puppet/files
162 + fowners -R puppet:puppet /var/lib/puppet
163 +
164 + fperms 0750 /var/lib/puppet
165 +
166 + fperms 0750 /etc/puppetlabs
167 + fperms 0750 /etc/puppetlabs/puppet
168 + fperms 0750 /etc/puppetlabs/puppet/ssl
169 + fowners -R :puppet /etc/puppetlabs
170 + fowners -R :puppet /var/lib/puppet
171 +
172 + if use xemacs ; then
173 + xemacs-elisp-install ${PN} ext/xemacs/puppet-mode.el*
174 + xemacs-elisp-site-file-install "${FILESDIR}/${SITEFILE}"
175 + fi
176 +
177 + if use ldap ; then
178 + insinto /etc/openldap/schema; doins ext/ldap/puppet.schema
179 + fi
180 +
181 + # ext and examples files
182 + for f in $(find ext examples -type f) ; do
183 + docinto "$(dirname ${f})"; dodoc "${f}"
184 + done
185 +}
186 +
187 +pkg_postinst() {
188 + elog
189 + elog "Please, *don't* include the --ask option in EMERGE_EXTRA_OPTS as this could"
190 + elog "cause puppet to hang while installing packages."
191 + elog
192 + elog "Portage Puppet module with Gentoo-specific resources:"
193 + elog "http://forge.puppetlabs.com/gentoo/portage"
194 + elog
195 +
196 + local v
197 + for v in ${REPLACING_VERSIONS}; do
198 + if [ "$(get_major_version $v)" = "3" ]; then
199 + elog
200 + elog "If you're upgrading from 3.x then please move everything in /etc/puppet to"
201 + elog "/etc/puppetlabs/puppet"
202 + elog "Also, puppet now uses config directories for modules and manifests."
203 + elog "See https://docs.puppetlabs.com/puppet/4.0/reference/upgrade_agent.html"
204 + elog "and https://docs.puppetlabs.com/puppet/4.0/reference/upgrade_server.html"
205 + elog "for more information."
206 + elog
207 + fi
208 + done
209 +
210 + use xemacs && xemacs-elisp-site-regen
211 +}
212 +
213 +pkg_postrm() {
214 + use xemacs && xemacs-elisp-site-regen
215 +}
216
217 diff --git a/app-admin/puppet/puppet-5.1.0-r1.ebuild b/app-admin/puppet/puppet-5.1.0-r1.ebuild
218 new file mode 100644
219 index 00000000000..f74a524361a
220 --- /dev/null
221 +++ b/app-admin/puppet/puppet-5.1.0-r1.ebuild
222 @@ -0,0 +1,144 @@
223 +# Copyright 1999-2017 Gentoo Foundation
224 +# Distributed under the terms of the GNU General Public License v2
225 +
226 +EAPI="6"
227 +
228 +USE_RUBY="ruby22 ruby23 ruby24"
229 +
230 +RUBY_FAKEGEM_RECIPE_TEST="rspec3"
231 +
232 +RUBY_FAKEGEM_TASK_DOC="doc:all"
233 +
234 +RUBY_FAKEGEM_EXTRAINSTALL="locales"
235 +
236 +inherit eutils user ruby-fakegem versionator
237 +
238 +DESCRIPTION="A system automation and configuration management software."
239 +HOMEPAGE="http://puppetlabs.com/"
240 +SRC_URI="http://downloads.puppetlabs.com/puppet/${P}.tar.gz"
241 +
242 +LICENSE="Apache-2.0 GPL-2"
243 +SLOT="0"
244 +KEYWORDS="~amd64 ~hppa ~x86"
245 +IUSE="augeas diff doc emacs ldap rrdtool selinux shadow sqlite vim-syntax"
246 +RESTRICT="test"
247 +
248 +ruby_add_rdepend "
249 + dev-ruby/hiera
250 + dev-ruby/json:=
251 + >=dev-ruby/facter-3.0.0
252 + augeas? ( dev-ruby/ruby-augeas )
253 + diff? ( dev-ruby/diff-lcs )
254 + doc? ( dev-ruby/rdoc )
255 + ldap? ( dev-ruby/ruby-ldap )
256 + shadow? ( dev-ruby/ruby-shadow )
257 + sqlite? ( dev-ruby/sqlite3 )
258 + virtual/ruby-ssl
259 + dev-ruby/hocon"
260 +
261 +ruby_add_bdepend "
262 + doc? ( dev-ruby/yard )
263 + test? (
264 + dev-ruby/mocha
265 + dev-ruby/rack
266 + dev-ruby/rspec-its
267 + )"
268 +# this should go in the above lists, but isn't because of test deps not being keyworded
269 +# dev-ruby/rspec-collection_matchers
270 +
271 +RDEPEND+=" ${RDEPEND}
272 + rrdtool? ( >=net-analyzer/rrdtool-1.2.23[ruby] )
273 + selinux? (
274 + sys-libs/libselinux[ruby]
275 + sec-policy/selinux-puppet
276 + )
277 + vim-syntax? ( >=app-vim/puppet-syntax-3.0.1 )
278 + >=app-portage/eix-0.18.0"
279 +PDEPEND="emacs? ( >=app-emacs/puppet-mode-0.3-r1 )"
280 +
281 +pkg_setup() {
282 + enewgroup puppet
283 + enewuser puppet -1 -1 /var/lib/puppet puppet
284 +}
285 +
286 +all_ruby_prepare() {
287 + # Avoid spec that require unpackaged json-schema.
288 + rm spec/lib/matchers/json.rb $( grep -Rl matchers/json spec) || die
289 +
290 + # can't be run within portage.
291 + epatch "${FILESDIR}/puppet-fix-tests-4.7.0.patch"
292 +
293 + # fix systemd path
294 + epatch "${FILESDIR}/puppet-systemd.patch"
295 +
296 + # Avoid specs that can only run in the puppet.git repository. This
297 + # should be narrowed down to the specific specs.
298 + rm spec/integration/parser/compiler_spec.rb || die
299 +
300 + # Avoid failing spec that need further investigation.
301 + rm spec/unit/module_tool/metadata_spec.rb || die
302 +}
303 +
304 +each_ruby_install() {
305 + each_fakegem_install
306 +# dosym "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${P}" "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${PN}"
307 +}
308 +
309 +all_ruby_install() {
310 + all_fakegem_install
311 +
312 + # systemd stuffs
313 + insinto /usr/lib/systemd/system
314 + doins "${WORKDIR}/all/${P}/ext/systemd/puppet.service"
315 +
316 + # tmpfiles stuff
317 + insinto /usr/lib/tmpfiles.d
318 + newins "${FILESDIR}/tmpfiles.d" "puppet.conf"
319 +
320 + # openrc init stuff
321 + newinitd "${FILESDIR}"/puppet.init-4.x puppet
322 + newinitd "${FILESDIR}"/puppetmaster.init-4.x puppetmaster
323 + newconfd "${FILESDIR}"/puppetmaster.confd puppetmaster
324 +
325 + keepdir /etc/puppetlabs/puppet/ssl
326 +
327 + keepdir /var/lib/puppet/facts
328 + keepdir /var/lib/puppet/files
329 + fowners -R puppet:puppet /var/lib/puppet
330 +
331 + fperms 0750 /var/lib/puppet
332 +
333 + fperms 0750 /etc/puppetlabs
334 + fperms 0750 /etc/puppetlabs/puppet
335 + fperms 0750 /etc/puppetlabs/puppet/ssl
336 + fowners -R :puppet /etc/puppetlabs
337 + fowners -R :puppet /var/lib/puppet
338 +
339 + if use ldap ; then
340 + insinto /etc/openldap/schema; doins ext/ldap/puppet.schema
341 + fi
342 +
343 + # ext and examples files
344 + for f in $(find ext examples -type f) ; do
345 + docinto "$(dirname ${f})"; dodoc "${f}"
346 + done
347 +}
348 +
349 +pkg_postinst() {
350 + elog
351 + elog "Please, *don't* include the --ask option in EMERGE_EXTRA_OPTS as this could"
352 + elog "cause puppet to hang while installing packages."
353 + elog
354 + elog "Portage Puppet module with Gentoo-specific resources:"
355 + elog "http://forge.puppetlabs.com/gentoo/portage"
356 + elog
357 +
358 + for v in ${REPLACING_VERSIONS}; do
359 + if [ "$(get_major_version $v)" = "4" ]; then
360 + elog
361 + elog "Please see the following url for the release notes for puppet-5"
362 + elog "https://docs.puppet.com/puppet/5.0/release_notes.html#if-youre-upgrading-from-puppet-4x"
363 + elog
364 + fi
365 + done
366 +}