From 395007b33a0ac4b64597d4ffd51ea16e0d83fa98 Mon Sep 17 00:00:00 2001 From: Anthony Ryan Date: Sun, 17 May 2026 20:38:13 -0400 Subject: [PATCH] app-admin/openvox: new package, add 8.27.0 Open source fork of app-admin/puppet now that Perforce closed source. Provides a migration path to last rites app-admin/puppet and app-admin/puppet-agent Closes: https://bugs.gentoo.org/965200 Signed-off-by: Anthony Ryan Part-of: https://github.com/gentoo/gentoo/pull/46085 Closes: https://github.com/gentoo/gentoo/pull/46085 Signed-off-by: Sam James --- app-admin/openvox/Manifest | 1 + .../files/openvox-spec-load-path.patch | 45 ++++++ app-admin/openvox/files/openvox-systemd.patch | 10 ++ app-admin/openvox/files/openvox.init | 26 ++++ app-admin/openvox/files/openvox.tmpfiles | 1 + app-admin/openvox/metadata.xml | 27 ++++ app-admin/openvox/openvox-8.27.0.ebuild | 134 ++++++++++++++++++ 7 files changed, 244 insertions(+) create mode 100644 app-admin/openvox/Manifest create mode 100644 app-admin/openvox/files/openvox-spec-load-path.patch create mode 100644 app-admin/openvox/files/openvox-systemd.patch create mode 100644 app-admin/openvox/files/openvox.init create mode 100644 app-admin/openvox/files/openvox.tmpfiles create mode 100644 app-admin/openvox/metadata.xml create mode 100644 app-admin/openvox/openvox-8.27.0.ebuild diff --git a/app-admin/openvox/Manifest b/app-admin/openvox/Manifest new file mode 100644 index 0000000000000..87f88fe7b675a --- /dev/null +++ b/app-admin/openvox/Manifest @@ -0,0 +1 @@ +DIST openvox-8.27.0.tar.gz 3748596 BLAKE2B 6c2406f8865529c7b17ecc552a76fc081edb72254a791cc19afd63e51ce35d58a297db7b575bca9d143e60b97add522231e48469d1737706659a6ee907ccc14e SHA512 1660e9b864a2645e0dcd00bbec35616b48cf351489e0549e679cccde5f01dc36b2c87a986bae745eb276ff66295f4590f596a97d2309526d2da99507ff63645a diff --git a/app-admin/openvox/files/openvox-spec-load-path.patch b/app-admin/openvox/files/openvox-spec-load-path.patch new file mode 100644 index 0000000000000..c9ec0d2b146a0 --- /dev/null +++ b/app-admin/openvox/files/openvox-spec-load-path.patch @@ -0,0 +1,45 @@ +Prevent Puppet's autoloader from double-loading files from older installed +openvox gem versions during testing. + +Puppet::Util::Autoload#search_directories returns: + gem_directories + $LOAD_PATH +where gem_directories is built from Gem::Specification.stubs -- every +installed gem's lib/, unconditionally. When a previous openvox version is +installed, its lib/ ends up in search_directories alongside the source +tree's lib/, so the autoloader (which uses Kernel.load, not require) loads +the same file twice, causing constant redefinitions and: + ArgumentError: Indirection file_metadata is already defined + +Fix: filter openvox entries out of Gem::Specification.stubs before +requiring puppet, so only the source tree's lib/ (already on $LOAD_PATH +via rspec) is visible to the autoloader. + +Also pre-require 'scanf' so it is already in $LOADED_FEATURES before +Puppet function definitions are eval'd. The scanf function's definition +block calls require 'scanf' inside a class_eval context; pre-loading it +here ensures it resolves correctly regardless of the eval binding context. + +--- a/spec/spec_helper.rb ++++ b/spec/spec_helper.rb +@@ -14,3 +14,20 @@ rescue LoadError + end + ++# Puppet's autoloader searches lib/ dirs of ALL installed gems via ++# Gem::Specification.stubs. When upgrading, the previously-installed openvox ++# gem would otherwise be found alongside the source tree, causing Kernel.load ++# to define the same constants twice and produce "Indirection already defined". ++if defined?(Gem) ++ original_stubs = Gem::Specification.method(:stubs) ++ Gem::Specification.define_singleton_method(:stubs) do |*args| ++ original_stubs.call(*args).reject { |spec| spec.name == 'openvox' } ++ end ++end ++ ++# Pre-load scanf so require 'scanf' inside Puppet function class_eval works. ++begin ++ require 'scanf' ++rescue LoadError ++end ++ + require 'puppet' + diff --git a/app-admin/openvox/files/openvox-systemd.patch b/app-admin/openvox/files/openvox-systemd.patch new file mode 100644 index 0000000000000..66c2aef5db2cc --- /dev/null +++ b/app-admin/openvox/files/openvox-systemd.patch @@ -0,0 +1,10 @@ +--- a/ext/systemd/puppet.service 2025-01-01 00:00:00.000000000 +0000 ++++ b/ext/systemd/puppet.service 2025-01-01 00:00:00.000000000 +0000 +@@ -17,7 +17,7 @@ + EnvironmentFile=-/etc/sysconfig/puppetagent + EnvironmentFile=-/etc/sysconfig/puppet + EnvironmentFile=-/etc/default/puppet +-ExecStart=/opt/puppetlabs/puppet/bin/puppet agent $PUPPET_EXTRA_OPTS --no-daemonize ++ExecStart=/usr/bin/puppet agent $PUPPET_EXTRA_OPTS --no-daemonize + ExecReload=/bin/kill -HUP $MAINPID + KillMode=process diff --git a/app-admin/openvox/files/openvox.init b/app-admin/openvox/files/openvox.init new file mode 100644 index 0000000000000..204d8bab30017 --- /dev/null +++ b/app-admin/openvox/files/openvox.init @@ -0,0 +1,26 @@ +#!/sbin/openrc-run + +PUPPET_PID_DIR="${PUPPET_PID_DIR:-/run/puppet}" +PUPPET_LOG_DIR="${PUPPET_LOG_DIR:-/var/log/puppetlabs/puppet}" + +pidfile="${PUPPET_PID_DIR}/openvox-agent.pid" + +command="/usr/bin/puppet" +command_args="agent --pidfile ${pidfile} --confdir /etc/puppetlabs/puppet ${PUPPET_EXTRA_OPTS}" +extra_started_commands="reload" + +depend() { + need localmount + use dns logger netmount openvox-server +} + +start_pre() { + checkpath --directory --owner puppet:puppet "${PUPPET_PID_DIR}" + checkpath --directory --owner puppet:puppet --mode 0750 "${PUPPET_LOG_DIR}" +} + +reload() { + ebegin "Reloading ${RC_SVCNAME}" + start-stop-daemon --signal HUP --pidfile "${pidfile}" + eend $? +} \ No newline at end of file diff --git a/app-admin/openvox/files/openvox.tmpfiles b/app-admin/openvox/files/openvox.tmpfiles new file mode 100644 index 0000000000000..b8196e38e69c2 --- /dev/null +++ b/app-admin/openvox/files/openvox.tmpfiles @@ -0,0 +1 @@ +D /run/puppet 0755 puppet puppet - \ No newline at end of file diff --git a/app-admin/openvox/metadata.xml b/app-admin/openvox/metadata.xml new file mode 100644 index 0000000000000..92dd4bb06ff77 --- /dev/null +++ b/app-admin/openvox/metadata.xml @@ -0,0 +1,27 @@ + + + + + anthonyryan1@gmail.com + Anthony Ryan + + + proxy-maint@gentoo.org + Proxy Maintainers + + + OpenVox is a community implementation of Puppet, an automated + administrative engine for your Linux, Unix, and Windows systems, + designed to perform administrative tasks (such as adding users, + installing packages, and updating server configurations) based on + a centralized specification. + + + Enable augeas support + Enable diff support + Enable shadow support + + + OpenVoxProject/openvox + + diff --git a/app-admin/openvox/openvox-8.27.0.ebuild b/app-admin/openvox/openvox-8.27.0.ebuild new file mode 100644 index 0000000000000..f3811e828ed78 --- /dev/null +++ b/app-admin/openvox/openvox-8.27.0.ebuild @@ -0,0 +1,134 @@ +# Copyright 2025-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +USE_RUBY="ruby32 ruby33 ruby34" +RUBY_FAKEGEM_RECIPE_TEST="rspec3" +RUBY_FAKEGEM_EXTRAINSTALL="locales" + +inherit ruby-fakegem systemd tmpfiles + +DESCRIPTION="OpenVox agent and apply tools for Puppet-compatible configuration management" +HOMEPAGE="https://github.com/OpenVoxProject/openvox" +SRC_URI="https://github.com/OpenVoxProject/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64" +IUSE="augeas diff doc ldap selinux shadow sqlite test" + +ruby_add_rdepend " + dev-ruby/concurrent-ruby + dev-ruby/deep_merge + dev-ruby/fast_gettext + dev-ruby/getoptlong + dev-ruby/hocon + dev-ruby/json:= + dev-ruby/locale + dev-ruby/openfact + dev-ruby/ostruct + dev-ruby/racc + dev-ruby/scanf + dev-ruby/semantic_puppet + virtual/ruby-ssl + augeas? ( dev-ruby/ruby-augeas ) + diff? ( dev-ruby/diff-lcs ) + doc? ( dev-ruby/rdoc ) + ldap? ( dev-ruby/ruby-ldap ) + shadow? ( dev-ruby/ruby-shadow ) + sqlite? ( dev-ruby/sqlite3 ) +" + +ruby_add_bdepend " + doc? ( dev-ruby/yard ) + test? ( + dev-ruby/json-schema:0 + dev-ruby/mocha + dev-ruby/rack + dev-ruby/rspec-its + dev-ruby/scanf + dev-ruby/vcr:6 + dev-ruby/webrick + dev-ruby/webmock:3 + ) +" + +RDEPEND+=" + acct-group/puppet + acct-user/puppet + !app-admin/puppet + !app-admin/puppet-agent + >=app-portage/eix-0.18.0 + selinux? ( + sec-policy/selinux-puppet + sys-libs/libselinux[ruby] + ) +" + +PATCHES=( + "${FILESDIR}/openvox-systemd.patch" + "${FILESDIR}/openvox-spec-load-path.patch" +) + +all_ruby_prepare() { + # RDoc::Parser#initialize signature changed in rdoc 6.4+ (4 args vs 5) + rm spec/integration/util/rdoc/parser_spec.rb || die + + # puppetserver_gem provider tries to read /etc/puppetlabs/puppetserver/puppetserver.conf + sed -i '/puppet_gem provider_command.*list local gems/s/^\(\s*\)it /\1xit /' \ + spec/unit/provider/package/puppetserver_gem_spec.rb || die + + # TODO: investigate why these are failing + sed -i \ + -e '/ask the provider whether it is enabled/s/^\(\s*\)it /\1xit /' \ + -e '/enable the service if it is supposed to be enabled/s/^\(\s*\)it /\1xit /' \ + -e '/disable the service if it is supposed to be disabled/s/^\(\s*\)it /\1xit /' \ + spec/unit/type/service_spec.rb || die +} + +all_ruby_install() { + all_fakegem_install + + # agent systemd unit + systemd_newunit "${WORKDIR}/all/${P}/ext/systemd/puppet.service" openvox.service + + # tmpfiles + newtmpfiles "${FILESDIR}"/openvox.tmpfiles puppet.conf + + # agent openrc init + newinitd "${FILESDIR}/openvox.init" openvox + + keepdir /etc/puppetlabs/puppet/ssl + + keepdir /var/lib/puppet/facts + keepdir /var/lib/puppet/files + fowners -R puppet:puppet /var/lib/puppet + + fperms 0750 /var/lib/puppet + + fperms 0750 /etc/puppetlabs{,/puppet,/puppet/ssl} + fowners -R :puppet /etc/puppetlabs + + # ext and examples files + local f + while IFS= read -r -d '' f ; do + docinto "${f%/*}" + dodoc "${f}" + done < <(find ext examples -type f -print0 || die) +} + +pkg_postinst() { + tmpfiles_process puppet.conf + + elog + elog "OpenVox is a community fork of Puppet." + elog "All existing Puppet documentation and modules are compatible." + elog + elog "Please, *don't* include the --ask option in EMERGE_EXTRA_OPTS as this could" + elog "cause puppet to hang while installing packages." + elog + elog "Portage Puppet module with Gentoo-specific resources:" + elog "http://forge.puppetlabs.com/gentoo/portage" + elog +}