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, 31 Oct 2016 06:49:44
Message-Id: 1477896572.0a84fb34a34ee042c9a6068ff6509cec9d870763.graaff@gentoo
1 commit: 0a84fb34a34ee042c9a6068ff6509cec9d870763
2 Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
3 AuthorDate: Mon Oct 31 06:48:45 2016 +0000
4 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 31 06:49:32 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0a84fb34
7
8 app-admin/puppet: add ruby22
9
10 Package-Manager: portage-2.3.0
11
12 app-admin/puppet/puppet-3.8.7-r1.ebuild | 194 ++++++++++++++++++++++++++++++++
13 1 file changed, 194 insertions(+)
14
15 diff --git a/app-admin/puppet/puppet-3.8.7-r1.ebuild b/app-admin/puppet/puppet-3.8.7-r1.ebuild
16 new file mode 100644
17 index 00000000..f41553c
18 --- /dev/null
19 +++ b/app-admin/puppet/puppet-3.8.7-r1.ebuild
20 @@ -0,0 +1,194 @@
21 +# Copyright 1999-2016 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +# $Id$
24 +
25 +EAPI="5"
26 +
27 +USE_RUBY="ruby20 ruby21 ruby22"
28 +
29 +RUBY_FAKEGEM_RECIPE_TEST="rspec"
30 +
31 +inherit elisp-common xemacs-elisp-common eutils user ruby-fakegem versionator
32 +
33 +DESCRIPTION="A system automation and configuration management software"
34 +HOMEPAGE="http://puppetlabs.com/"
35 +SRC_URI="http://downloads.puppetlabs.com/puppet/${P}.tar.gz"
36 +
37 +LICENSE="Apache-2.0 GPL-2"
38 +SLOT="0"
39 +KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86"
40 +IUSE="augeas diff doc emacs ldap minimal rrdtool selinux shadow sqlite vim-syntax xemacs"
41 +
42 +ruby_add_rdepend "
43 + dev-ruby/hiera
44 + >=dev-ruby/rgen-0.7.0
45 + >=dev-ruby/facter-1.6.2 <dev-ruby/facter-3
46 + dev-ruby/json
47 + augeas? ( dev-ruby/ruby-augeas )
48 + diff? ( dev-ruby/diff-lcs )
49 + doc? ( dev-ruby/rdoc )
50 + ldap? ( dev-ruby/ruby-ldap )
51 + shadow? ( dev-ruby/ruby-shadow )
52 + sqlite? ( dev-ruby/sqlite3 )
53 + virtual/ruby-ssl"
54 +
55 +ruby_add_bdepend "test? ( dev-ruby/mocha )"
56 +
57 +DEPEND="${DEPEND}
58 + emacs? ( virtual/emacs )
59 + xemacs? ( app-editors/xemacs )"
60 +RDEPEND="${RDEPEND}
61 + rrdtool? ( >=net-analyzer/rrdtool-1.2.23[ruby] )
62 + selinux? (
63 + sys-libs/libselinux[ruby]
64 + sec-policy/selinux-puppet
65 + )
66 + vim-syntax? ( >=app-vim/puppet-syntax-3.0.1 )
67 + >=app-portage/eix-0.18.0"
68 +
69 +SITEFILE="50${PN}-mode-gentoo.el"
70 +
71 +pkg_setup() {
72 + enewgroup puppet
73 + enewuser puppet -1 -1 /var/lib/puppet puppet
74 +}
75 +
76 +all_ruby_prepare() {
77 + # Fix compatibility with ruby22 and later. Psych has been the
78 + # default YAML engine since ruby 2.0 and ruby22 and later no longer
79 + # define YAML::ENGINE at all.
80 + sed -i -e '/YAML_ENGINE =/ s/syck/psych/' lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb
81 +
82 + # Avoid spec that require unpackaged json-schema.
83 + rm spec/lib/matchers/json.rb $( grep -Rl matchers/json spec) || die
84 +
85 + # Avoid Rails specs to avoid this dependency and because they
86 + # currently fail against Rails 4.1.
87 + find spec -type f -name '*rails*' -o -name '*active_record*' | xargs rm || die
88 + rm -r spec/unit/rails || die
89 + rm spec/unit/parser/collector_spec.rb || die
90 +
91 + # Avoid specs that can only run in the puppet.git repository. This
92 + # should be narrowed down to the specific specs.
93 + rm spec/integration/parser/compiler_spec.rb spec/integration/parser/future_compiler_spec.rb || die
94 +
95 + # Avoid failing spec that need further investigation.
96 + rm spec/unit/module_tool/metadata_spec.rb || die
97 +}
98 +
99 +all_ruby_compile() {
100 + if use emacs ; then
101 + elisp-compile ext/emacs/puppet-mode.el
102 + fi
103 +
104 + if use xemacs ; then
105 + # Create a separate version for xemacs to be able to install
106 + # emacs and xemacs in parallel.
107 + mkdir ext/xemacs
108 + cp ext/emacs/* ext/xemacs/
109 + xemacs-elisp-compile ext/xemacs/puppet-mode.el
110 + fi
111 +}
112 +
113 +each_ruby_install() {
114 + each_fakegem_install
115 + #${RUBY} install.rb --destdir="${D}" install || die
116 +}
117 +
118 +all_ruby_install() {
119 + all_fakegem_install
120 +
121 + #systemd stuffs
122 + insinto /usr/lib/systemd/system
123 + doins "${WORKDIR}/all/${P}/ext/systemd/puppet.service"
124 + insinto /usr/lib/tmpfiles.d
125 + newins "${FILESDIR}/tmpfiles.d" "puppet.conf"
126 +
127 + newinitd "${FILESDIR}"/puppet.init-r1 puppet
128 +
129 + # Initial configuration files
130 + insinto /etc/puppet
131 +
132 + # Location of log and data files
133 + keepdir /var/log/puppet
134 + fowners -R puppet:puppet /var/log/puppet
135 +
136 + if use minimal ; then
137 + rm "${ED}/etc/puppet/auth.conf"
138 + else
139 + insinto /usr/lib/systemd/system
140 + doins "${WORKDIR}/all/${P}/ext/systemd/puppetmaster.service"
141 + newinitd "${FILESDIR}"/puppetmaster.init-r1 puppetmaster
142 + newconfd "${FILESDIR}"/puppetmaster.confd puppetmaster
143 +
144 + insinto /etc/puppet
145 +
146 + keepdir /etc/puppet/manifests
147 + keepdir /etc/puppet/modules
148 +
149 + keepdir /var/lib/puppet/ssl
150 + keepdir /var/lib/puppet/facts
151 + keepdir /var/lib/puppet/files
152 + fowners -R puppet:puppet /var/lib/puppet
153 + fperms 0750 /var/lib/puppet
154 + fi
155 + fperms 0750 /etc/puppet
156 + fowners :puppet /etc/puppet
157 +
158 + if use emacs ; then
159 + elisp-install ${PN} ext/emacs/puppet-mode.el*
160 + elisp-site-file-install "${FILESDIR}/${SITEFILE}"
161 + fi
162 +
163 + if use xemacs ; then
164 + xemacs-elisp-install ${PN} ext/xemacs/puppet-mode.el*
165 + xemacs-elisp-site-file-install "${FILESDIR}/${SITEFILE}"
166 + fi
167 +
168 + if use ldap ; then
169 + insinto /etc/openldap/schema; doins ext/ldap/puppet.schema
170 + fi
171 +
172 + # ext and examples files
173 + for f in $(find ext examples -type f) ; do
174 + docinto "$(dirname ${f})"; dodoc "${f}"
175 + done
176 +}
177 +
178 +pkg_postinst() {
179 + elog
180 + elog "Please, *don't* include the --ask option in EMERGE_EXTRA_OPTS as this could"
181 + elog "cause puppet to hang while installing packages."
182 + elog
183 + elog "Portage Puppet module with Gentoo-specific resources:"
184 + elog "http://forge.puppetlabs.com/gentoo/portage"
185 + elog
186 +
187 + if [ \
188 + -f "${EPREFIX}/etc/puppet/puppetd.conf" -o \
189 + -f "${EPREFIX}/etc/puppet/puppetmaster.conf" -o \
190 + -f "${EPREFIX}/etc/puppet/puppetca.conf" \
191 + ] ; then
192 + elog
193 + elog "Please remove deprecated config files."
194 + elog " /etc/puppet/puppetca.conf"
195 + elog " /etc/puppet/puppetd.conf"
196 + elog " /etc/puppet/puppetmasterd.conf"
197 + elog
198 + fi
199 +
200 + if [ "$(get_major_version $REPLACING_VERSIONS)" = "2" ]; then
201 + elog
202 + elog "If you're upgrading from 2.x then we strongly suggest you to read:"
203 + elog "http://docs.puppetlabs.com/guides/upgrading.html"
204 + elog
205 + fi
206 +
207 + use emacs && elisp-site-regen
208 + use xemacs && xemacs-elisp-site-regen
209 +}
210 +
211 +pkg_postrm() {
212 + use emacs && elisp-site-regen
213 + use xemacs && xemacs-elisp-site-regen
214 +}