1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 USE_RUBY="ruby19 ruby20"
9 RUBY_FAKEGEM_RECIPE_TEST="rspec"
11 inherit elisp-common xemacs-elisp-common eutils user ruby-fakegem versionator
13 DESCRIPTION="A system automation and configuration management software"
14 HOMEPAGE="http://puppetlabs.com/"
15 SRC_URI="http://downloads.puppetlabs.com/puppet/${P}.tar.gz"
17 LICENSE="Apache-2.0 GPL-2"
19 KEYWORDS="amd64 hppa ppc sparc x86"
20 IUSE="augeas diff doc emacs ldap minimal rrdtool selinux shadow sqlite vim-syntax xemacs"
24 >=dev-ruby/rgen-0.6.5 =dev-ruby/rgen-0.6*
25 >=dev-ruby/facter-1.6.2 <dev-ruby/facter-3
27 augeas? ( dev-ruby/ruby-augeas )
28 diff? ( dev-ruby/diff-lcs )
29 doc? ( dev-ruby/rdoc )
30 ldap? ( dev-ruby/ruby-ldap )
31 shadow? ( dev-ruby/ruby-shadow )
32 sqlite? ( dev-ruby/sqlite3 )
36 ruby_targets_ruby19? ( dev-lang/ruby:1.9[yaml] )
37 emacs? ( virtual/emacs )
38 xemacs? ( app-editors/xemacs )"
40 ruby_targets_ruby19? ( dev-lang/ruby:1.9[yaml] )
41 rrdtool? ( >=net-analyzer/rrdtool-1.2.23[ruby] )
43 sys-libs/libselinux[ruby]
44 sec-policy/selinux-puppet
46 vim-syntax? ( >=app-vim/puppet-syntax-3.0.1 )
47 >=app-portage/eix-0.18.0"
49 SITEFILE="50${PN}-mode-gentoo.el"
53 enewuser puppet -1 -1 /var/lib/puppet puppet
57 # Avoid spec that require unpackaged json-schema.
58 rm spec/lib/matchers/json.rb $( grep -Rl matchers/json spec) || die
60 # Avoid Rails specs to avoid this dependency and because they
61 # currently fail against Rails 4.1.
62 find spec -type f -name '*rails*' -o -name '*active_record*' | xargs rm || die
63 rm -r spec/unit/rails || die
64 rm spec/unit/parser/collector_spec.rb || die
66 # Avoid specs that can only run in the puppet.git repository. This
67 # should be narrowed down to the specific specs.
68 rm spec/integration/parser/compiler_spec.rb spec/integration/parser/future_compiler_spec.rb || die
70 # Avoid failing spec that need further investigation.
71 rm spec/unit/module_tool/metadata_spec.rb || die
76 elisp-compile ext/emacs/puppet-mode.el
80 # Create a separate version for xemacs to be able to install
81 # emacs and xemacs in parallel.
83 cp ext/emacs/* ext/xemacs/
84 xemacs-elisp-compile ext/xemacs/puppet-mode.el
90 #${RUBY} install.rb --destdir="${D}" install || die
97 insinto /usr/lib/systemd/system
98 doins "${WORKDIR}/all/${P}/ext/systemd/puppet.service"
99 insinto /usr/lib/tmpfiles.d
100 newins "${FILESDIR}/tmpfiles.d" "puppet.conf"
102 newinitd "${FILESDIR}"/puppet.init-r1 puppet
104 # Initial configuration files
107 # Location of log and data files
108 keepdir /var/log/puppet
109 fowners -R puppet:puppet /var/log/puppet
111 if use minimal ; then
112 rm "${ED}/etc/puppet/auth.conf"
114 insinto /usr/lib/systemd/system
115 doins "${WORKDIR}/all/${P}/ext/systemd/puppetmaster.service"
116 newinitd "${FILESDIR}"/puppetmaster.init-r1 puppetmaster
117 newconfd "${FILESDIR}"/puppetmaster.confd puppetmaster
121 keepdir /etc/puppet/manifests
122 keepdir /etc/puppet/modules
124 keepdir /var/lib/puppet/ssl
125 keepdir /var/lib/puppet/facts
126 keepdir /var/lib/puppet/files
127 fowners -R puppet:puppet /var/lib/puppet
128 fperms 0750 /var/lib/puppet
130 fperms 0750 /etc/puppet
131 fowners :puppet /etc/puppet
134 elisp-install ${PN} ext/emacs/puppet-mode.el*
135 elisp-site-file-install "${FILESDIR}/${SITEFILE}"
139 xemacs-elisp-install ${PN} ext/xemacs/puppet-mode.el*
140 xemacs-elisp-site-file-install "${FILESDIR}/${SITEFILE}"
144 insinto /etc/openldap/schema; doins ext/ldap/puppet.schema
147 # ext and examples files
148 for f in $(find ext examples -type f) ; do
149 docinto "$(dirname ${f})"; dodoc "${f}"
155 elog "Please, *don't* include the --ask option in EMERGE_EXTRA_OPTS as this could"
156 elog "cause puppet to hang while installing packages."
158 elog "Portage Puppet module with Gentoo-specific resources:"
159 elog "http://forge.puppetlabs.com/gentoo/portage"
163 -f "${EPREFIX}/etc/puppet/puppetd.conf" -o \
164 -f "${EPREFIX}/etc/puppet/puppetmaster.conf" -o \
165 -f "${EPREFIX}/etc/puppet/puppetca.conf" \
168 elog "Please remove deprecated config files."
169 elog " /etc/puppet/puppetca.conf"
170 elog " /etc/puppet/puppetd.conf"
171 elog " /etc/puppet/puppetmasterd.conf"
175 if [ "$(get_major_version $REPLACING_VERSIONS)" = "2" ]; then
177 elog "If you're upgrading from 2.x then we strongly suggest you to read:"
178 elog "http://docs.puppetlabs.com/guides/upgrading.html"
182 use emacs && elisp-site-regen
183 use xemacs && xemacs-elisp-site-regen
187 use emacs && elisp-site-regen
188 use xemacs && xemacs-elisp-site-regen