1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 USE_RUBY="ruby20 ruby21"
9 RUBY_FAKEGEM_RECIPE_TEST="rspec3"
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 ~x86"
20 IUSE="augeas diff doc emacs ldap rrdtool selinux shadow sqlite vim-syntax xemacs"
27 >=dev-ruby/facter-3.0.0
28 augeas? ( dev-ruby/ruby-augeas )
29 diff? ( dev-ruby/diff-lcs )
30 doc? ( dev-ruby/rdoc )
31 ldap? ( dev-ruby/ruby-ldap )
32 shadow? ( dev-ruby/ruby-shadow )
33 sqlite? ( dev-ruby/sqlite3 )
42 # this should go in the above lists, but isn't because of test deps not being keyworded
43 # dev-ruby/rspec-collection_matchers
46 emacs? ( virtual/emacs )
47 xemacs? ( app-editors/xemacs )"
49 rrdtool? ( >=net-analyzer/rrdtool-1.2.23[ruby] )
51 sys-libs/libselinux[ruby]
52 sec-policy/selinux-puppet
54 vim-syntax? ( >=app-vim/puppet-syntax-3.0.1 )
55 >=app-portage/eix-0.18.0"
57 SITEFILE="50${PN}-mode-gentoo.el"
61 enewuser puppet -1 -1 /var/lib/puppet puppet
65 # Avoid spec that require unpackaged json-schema.
66 rm spec/lib/matchers/json.rb $( grep -Rl matchers/json spec) || die
68 # can't be run within portage.
69 epatch "${FILESDIR}/puppet-fix-tests-4.x.patch"
71 # Avoid specs that can only run in the puppet.git repository. This
72 # should be narrowed down to the specific specs.
73 rm spec/integration/parser/compiler_spec.rb || die
75 # Avoid failing spec that need further investigation.
76 rm spec/unit/module_tool/metadata_spec.rb || die
81 elisp-compile ext/emacs/puppet-mode.el
85 # Create a separate version for xemacs to be able to install
86 # emacs and xemacs in parallel.
88 cp ext/emacs/* ext/xemacs/
89 xemacs-elisp-compile ext/xemacs/puppet-mode.el
95 # dosym "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${P}" "/usr/$(get_libdir)/ruby/gems/$(ruby_get_version)/gems/${PN}"
102 insinto /usr/lib/systemd/system
103 doins "${WORKDIR}/all/${P}/ext/systemd/puppet.service"
106 insinto /usr/lib/tmpfiles.d
107 newins "${FILESDIR}/tmpfiles.d" "puppet.conf"
110 newinitd "${FILESDIR}"/puppet.init-4.x puppet
111 newinitd "${FILESDIR}"/puppetmaster.init-4.x puppetmaster
112 newconfd "${FILESDIR}"/puppetmaster.confd puppetmaster
114 keepdir /etc/puppetlabs/puppet/ssl
116 keepdir /var/lib/puppet/facts
117 keepdir /var/lib/puppet/files
118 fowners -R puppet:puppet /var/lib/puppet
120 fperms 0750 /var/lib/puppet
122 fperms 0750 /etc/puppetlabs
123 fperms 0750 /etc/puppetlabs/puppet
124 fperms 0750 /etc/puppetlabs/puppet/ssl
125 fowners -R :puppet /etc/puppetlabs
126 fowners -R :puppet /var/lib/puppet
129 elisp-install ${PN} ext/emacs/puppet-mode.el*
130 elisp-site-file-install "${FILESDIR}/${SITEFILE}"
134 xemacs-elisp-install ${PN} ext/xemacs/puppet-mode.el*
135 xemacs-elisp-site-file-install "${FILESDIR}/${SITEFILE}"
139 insinto /etc/openldap/schema; doins ext/ldap/puppet.schema
142 # ext and examples files
143 for f in $(find ext examples -type f) ; do
144 docinto "$(dirname ${f})"; dodoc "${f}"
150 elog "Please, *don't* include the --ask option in EMERGE_EXTRA_OPTS as this could"
151 elog "cause puppet to hang while installing packages."
153 elog "Portage Puppet module with Gentoo-specific resources:"
154 elog "http://forge.puppetlabs.com/gentoo/portage"
157 if [ "$(get_major_version $REPLACING_VERSIONS)" = "3" ]; then
159 elog "If you're upgrading from 3.x then please move everything in /etc/puppet to"
160 elog "/etc/puppetlabs/puppet"
161 elog "Also, puppet now uses config directories for modules and manifests."
162 elog "See https://docs.puppetlabs.com/puppet/4.0/reference/upgrade_agent.html"
163 elog "and https://docs.puppetlabs.com/puppet/4.0/reference/upgrade_server.html"
164 elog "for more information."
168 use emacs && elisp-site-regen
169 use xemacs && xemacs-elisp-site-regen
173 use emacs && elisp-site-regen
174 use xemacs && xemacs-elisp-site-regen