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: Mon, 29 Jan 2018 06:44:05
Message-Id: 1517208232.2eb2b70918e79b9b6dc8878ca01e412340ad6a27.graaff@gentoo
1 commit: 2eb2b70918e79b9b6dc8878ca01e412340ad6a27
2 Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 29 06:43:52 2018 +0000
4 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 29 06:43:52 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2eb2b709
7
8 app-admin/puppet: also backport ruby 2.3.6 fix to puppet 5.x
9
10 Package-Manager: Portage-2.3.19, Repoman-2.3.6
11
12 app-admin/puppet/puppet-5.3.3-r1.ebuild | 147 ++++++++++++++++++++++++++++++++
13 1 file changed, 147 insertions(+)
14
15 diff --git a/app-admin/puppet/puppet-5.3.3-r1.ebuild b/app-admin/puppet/puppet-5.3.3-r1.ebuild
16 new file mode 100644
17 index 00000000000..1f8461b191d
18 --- /dev/null
19 +++ b/app-admin/puppet/puppet-5.3.3-r1.ebuild
20 @@ -0,0 +1,147 @@
21 +# Copyright 1999-2018 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI="6"
25 +
26 +USE_RUBY="ruby22 ruby23 ruby24"
27 +
28 +RUBY_FAKEGEM_RECIPE_TEST="rspec3"
29 +
30 +RUBY_FAKEGEM_TASK_DOC="doc:all"
31 +
32 +RUBY_FAKEGEM_EXTRAINSTALL="locales"
33 +
34 +inherit eutils user ruby-fakegem versionator
35 +
36 +DESCRIPTION="A system automation and configuration management software."
37 +HOMEPAGE="http://puppetlabs.com/"
38 +SRC_URI="http://downloads.puppetlabs.com/puppet/${P}.tar.gz"
39 +
40 +LICENSE="Apache-2.0 GPL-2"
41 +SLOT="0"
42 +KEYWORDS="~amd64 ~hppa ~ppc ~x86"
43 +IUSE="augeas diff doc emacs ldap rrdtool selinux shadow sqlite vim-syntax"
44 +RESTRICT="test"
45 +
46 +ruby_add_rdepend "
47 + dev-ruby/hiera
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 + dev-ruby/hocon"
58 +
59 +ruby_add_bdepend "
60 + doc? ( dev-ruby/yard )
61 + test? (
62 + dev-ruby/mocha
63 + dev-ruby/rack
64 + dev-ruby/rspec-its
65 + )"
66 +# this should go in the above lists, but isn't because of test deps not being keyworded
67 +# dev-ruby/rspec-collection_matchers
68 +
69 +RDEPEND+=" ${RDEPEND}
70 + rrdtool? ( >=net-analyzer/rrdtool-1.2.23[ruby] )
71 + selinux? (
72 + sys-libs/libselinux[ruby]
73 + sec-policy/selinux-puppet
74 + )
75 + vim-syntax? ( >=app-vim/puppet-syntax-3.0.1 )
76 + >=app-portage/eix-0.18.0"
77 +PDEPEND="emacs? ( >=app-emacs/puppet-mode-0.3-r1 )"
78 +
79 +pkg_setup() {
80 + enewgroup puppet
81 + enewuser puppet -1 -1 /var/lib/puppet puppet
82 +}
83 +
84 +all_ruby_prepare() {
85 + # Avoid spec that require unpackaged json-schema.
86 + rm spec/lib/matchers/json.rb $( grep -Rl matchers/json spec) || die
87 +
88 + # can't be run within portage.
89 + epatch "${FILESDIR}/puppet-fix-tests-4.7.0.patch"
90 +
91 + # fix systemd path
92 + epatch "${FILESDIR}/puppet-systemd.patch"
93 +
94 + # backport upstream fix for ruby 2.3.6 compatibility
95 + epatch "${FILESDIR}/puppet-4-webrick-ruby.patch"
96 +
97 + # Avoid specs that can only run in the puppet.git repository. This
98 + # should be narrowed down to the specific specs.
99 + rm spec/integration/parser/compiler_spec.rb || die
100 +
101 + # Avoid failing spec that need further investigation.
102 + rm spec/unit/module_tool/metadata_spec.rb || die
103 +}
104 +
105 +each_ruby_install() {
106 + each_fakegem_install
107 +# dosym "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${P}" "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${PN}"
108 +}
109 +
110 +all_ruby_install() {
111 + all_fakegem_install
112 +
113 + # systemd stuffs
114 + insinto /usr/lib/systemd/system
115 + doins "${WORKDIR}/all/${P}/ext/systemd/puppet.service"
116 +
117 + # tmpfiles stuff
118 + insinto /usr/lib/tmpfiles.d
119 + newins "${FILESDIR}/tmpfiles.d" "puppet.conf"
120 +
121 + # openrc init stuff
122 + newinitd "${FILESDIR}"/puppet.init-4.x puppet
123 + newinitd "${FILESDIR}"/puppetmaster.init-4.x puppetmaster
124 + newconfd "${FILESDIR}"/puppetmaster.confd puppetmaster
125 +
126 + keepdir /etc/puppetlabs/puppet/ssl
127 +
128 + keepdir /var/lib/puppet/facts
129 + keepdir /var/lib/puppet/files
130 + fowners -R puppet:puppet /var/lib/puppet
131 +
132 + fperms 0750 /var/lib/puppet
133 +
134 + fperms 0750 /etc/puppetlabs
135 + fperms 0750 /etc/puppetlabs/puppet
136 + fperms 0750 /etc/puppetlabs/puppet/ssl
137 + fowners -R :puppet /etc/puppetlabs
138 + fowners -R :puppet /var/lib/puppet
139 +
140 + if use ldap ; then
141 + insinto /etc/openldap/schema; doins ext/ldap/puppet.schema
142 + fi
143 +
144 + # ext and examples files
145 + for f in $(find ext examples -type f) ; do
146 + docinto "$(dirname ${f})"; dodoc "${f}"
147 + done
148 +}
149 +
150 +pkg_postinst() {
151 + elog
152 + elog "Please, *don't* include the --ask option in EMERGE_EXTRA_OPTS as this could"
153 + elog "cause puppet to hang while installing packages."
154 + elog
155 + elog "Portage Puppet module with Gentoo-specific resources:"
156 + elog "http://forge.puppetlabs.com/gentoo/portage"
157 + elog
158 +
159 + for v in ${REPLACING_VERSIONS}; do
160 + if [ "$(get_major_version $v)" = "4" ]; then
161 + elog
162 + elog "Please see the following url for the release notes for puppet-5"
163 + elog "https://docs.puppet.com/puppet/5.0/release_notes.html#if-youre-upgrading-from-puppet-4x"
164 + elog
165 + fi
166 + done
167 +}