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 <anthonyryan1@gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/46085
Closes: https://github.com/gentoo/gentoo/pull/46085
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Anthony Ryan
2026-05-17 20:38:13 -04:00
committed by Sam James
parent 86d37f1963
commit 395007b33a
7 changed files with 244 additions and 0 deletions

View File

@@ -0,0 +1 @@
DIST openvox-8.27.0.tar.gz 3748596 BLAKE2B 6c2406f8865529c7b17ecc552a76fc081edb72254a791cc19afd63e51ce35d58a297db7b575bca9d143e60b97add522231e48469d1737706659a6ee907ccc14e SHA512 1660e9b864a2645e0dcd00bbec35616b48cf351489e0549e679cccde5f01dc36b2c87a986bae745eb276ff66295f4590f596a97d2309526d2da99507ff63645a

View File

@@ -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'

View File

@@ -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

View File

@@ -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 $?
}

View File

@@ -0,0 +1 @@
D /run/puppet 0755 puppet puppet -

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person" proxied="yes">
<email>anthonyryan1@gmail.com</email>
<name>Anthony Ryan</name>
</maintainer>
<maintainer type="project" proxied="proxy">
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
<longdescription lang="en">
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.
</longdescription>
<use>
<flag name="augeas">Enable augeas support</flag>
<flag name="diff">Enable diff support</flag>
<flag name="shadow">Enable shadow support</flag>
</use>
<upstream>
<remote-id type="github">OpenVoxProject/openvox</remote-id>
</upstream>
</pkgmetadata>

View File

@@ -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
}