aboutsummaryrefslogtreecommitdiffstats
path: root/databases
diff options
context:
space:
mode:
authorromain <romain@FreeBSD.org>2016-06-09 19:06:28 +0800
committerromain <romain@FreeBSD.org>2016-06-09 19:06:28 +0800
commitf0878a3e58aa02c5034925dfa6559998542ee79b (patch)
tree0462671dfb2ec2a2b836d7a51d88399b68f70d4a /databases
parent8b7283f549827058e5a72ba8fd4dae8507ce334a (diff)
downloadfreebsd-ports-gnome-f0878a3e58aa02c5034925dfa6559998542ee79b.tar.gz
freebsd-ports-gnome-f0878a3e58aa02c5034925dfa6559998542ee79b.tar.zst
freebsd-ports-gnome-f0878a3e58aa02c5034925dfa6559998542ee79b.zip
New ports for PuppetDB 3.x
- databases/puppetdb3 [1] - databases/puppetdb-terminus3 [2] Also add conflicts with the puppetdb 2.x and 4.x ports. PR: 204074 [1], 206594 [2] Submitted by: freebsd@zleslie.info [1, 2]
Diffstat (limited to 'databases')
-rw-r--r--databases/Makefile2
-rw-r--r--databases/puppetdb-terminus/Makefile2
-rw-r--r--databases/puppetdb-terminus3/Makefile25
-rw-r--r--databases/puppetdb-terminus3/distinfo2
-rw-r--r--databases/puppetdb-terminus3/pkg-descr3
-rw-r--r--databases/puppetdb-terminus3/pkg-plist16
-rw-r--r--databases/puppetdb-terminus4/Makefile2
-rw-r--r--databases/puppetdb/Makefile2
-rw-r--r--databases/puppetdb3/Makefile78
-rw-r--r--databases/puppetdb3/distinfo2
-rw-r--r--databases/puppetdb3/files/patch-ext__bin__puppetdb21
-rw-r--r--databases/puppetdb3/files/patch-ext__config__conf.d__config.ini15
-rw-r--r--databases/puppetdb3/files/patch-ext__config__conf.d__database.ini11
-rw-r--r--databases/puppetdb3/files/patch-ext__config__logback.xml15
-rw-r--r--databases/puppetdb3/files/patch-ext__config__request-logging.xml10
-rw-r--r--databases/puppetdb3/files/pkg-message.in9
-rw-r--r--databases/puppetdb3/files/puppetdb.in85
-rw-r--r--databases/puppetdb3/pkg-descr3
-rw-r--r--databases/puppetdb3/pkg-plist21
-rw-r--r--databases/puppetdb4/Makefile2
20 files changed, 322 insertions, 4 deletions
diff --git a/databases/Makefile b/databases/Makefile
index f4e951560f0e..139b7db00932 100644
--- a/databases/Makefile
+++ b/databases/Makefile
@@ -707,7 +707,9 @@
SUBDIR += proftpd-mod_sql_tds
SUBDIR += puppetdb
SUBDIR += puppetdb-terminus
+ SUBDIR += puppetdb-terminus3
SUBDIR += puppetdb-terminus4
+ SUBDIR += puppetdb3
SUBDIR += puppetdb4
SUBDIR += pure-sql3
SUBDIR += puredb
diff --git a/databases/puppetdb-terminus/Makefile b/databases/puppetdb-terminus/Makefile
index 72a8020e4ff9..0952df502d5c 100644
--- a/databases/puppetdb-terminus/Makefile
+++ b/databases/puppetdb-terminus/Makefile
@@ -14,7 +14,7 @@ LICENSE= APACHE20
BUILD_DEPENDS= puppet38>=0:sysutils/puppet38
-CONFLICTS_INSTALL= puppetdb-terminus4-*
+CONFLICTS_INSTALL= puppetdb-terminus3-* puppetdb-terminus4-*
USE_RUBY= yes
NO_BUILD= yes
diff --git a/databases/puppetdb-terminus3/Makefile b/databases/puppetdb-terminus3/Makefile
new file mode 100644
index 000000000000..e6da7780ed7f
--- /dev/null
+++ b/databases/puppetdb-terminus3/Makefile
@@ -0,0 +1,25 @@
+# $FreeBSD$
+
+PORTNAME= puppetdb-terminus3
+PORTVERSION= 3.2.4
+CATEGORIES= databases ruby
+MASTER_SITES= http://downloads.puppetlabs.com/puppetdb/
+DISTNAME= puppetdb-${PORTVERSION}
+
+MAINTAINER= freebsd@zleslie.info
+COMMENT= PuppetDB storeconfigs backend terminus module
+
+LICENSE= APACHE20
+
+BUILD_DEPENDS= puppet:${PORTSDIR}/sysutils/puppet4
+
+CONFLICTS_INSTALL= puppetdb-terminus-* puppetdb-terminus4-*
+USE_RUBY= yes
+NO_BUILD= yes
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${RUBY_SITELIBDIR}/puppet
+ (cd ${WRKSRC}/puppet && ${COPYTREE_SHARE} . \
+ ${STAGEDIR}${RUBY_SITELIBDIR}/puppet)
+
+.include <bsd.port.mk>
diff --git a/databases/puppetdb-terminus3/distinfo b/databases/puppetdb-terminus3/distinfo
new file mode 100644
index 000000000000..40b0c1c4c2b0
--- /dev/null
+++ b/databases/puppetdb-terminus3/distinfo
@@ -0,0 +1,2 @@
+SHA256 (puppetdb-3.2.4.tar.gz) = 580d25ace29b61d7504dfc2650fd7e1c6a14e77421cbfafed14703d857996d84
+SIZE (puppetdb-3.2.4.tar.gz) = 25695565
diff --git a/databases/puppetdb-terminus3/pkg-descr b/databases/puppetdb-terminus3/pkg-descr
new file mode 100644
index 000000000000..82720763fd9c
--- /dev/null
+++ b/databases/puppetdb-terminus3/pkg-descr
@@ -0,0 +1,3 @@
+The PuppetDB storeconfigs backend terminus module.
+
+WWW: https://docs.puppetlabs.com/puppetdb/latest/
diff --git a/databases/puppetdb-terminus3/pkg-plist b/databases/puppetdb-terminus3/pkg-plist
new file mode 100644
index 000000000000..0cf16f8a50e0
--- /dev/null
+++ b/databases/puppetdb-terminus3/pkg-plist
@@ -0,0 +1,16 @@
+%%RUBY_SITELIBDIR%%/puppet/application/storeconfigs.rb
+%%RUBY_SITELIBDIR%%/puppet/face/node/deactivate.rb
+%%RUBY_SITELIBDIR%%/puppet/face/node/status.rb
+%%RUBY_SITELIBDIR%%/puppet/face/storeconfigs.rb
+%%RUBY_SITELIBDIR%%/puppet/indirector/catalog/puppetdb.rb
+%%RUBY_SITELIBDIR%%/puppet/indirector/facts/puppetdb.rb
+%%RUBY_SITELIBDIR%%/puppet/indirector/facts/puppetdb_apply.rb
+%%RUBY_SITELIBDIR%%/puppet/indirector/node/puppetdb.rb
+%%RUBY_SITELIBDIR%%/puppet/indirector/resource/puppetdb.rb
+%%RUBY_SITELIBDIR%%/puppet/reports/puppetdb.rb
+%%RUBY_SITELIBDIR%%/puppet/util/puppetdb.rb
+%%RUBY_SITELIBDIR%%/puppet/util/puppetdb/char_encoding.rb
+%%RUBY_SITELIBDIR%%/puppet/util/puppetdb/command.rb
+%%RUBY_SITELIBDIR%%/puppet/util/puppetdb/command_names.rb
+%%RUBY_SITELIBDIR%%/puppet/util/puppetdb/config.rb
+%%RUBY_SITELIBDIR%%/puppet/util/puppetdb/http.rb
diff --git a/databases/puppetdb-terminus4/Makefile b/databases/puppetdb-terminus4/Makefile
index 28990d9ff643..bd6b4912b3af 100644
--- a/databases/puppetdb-terminus4/Makefile
+++ b/databases/puppetdb-terminus4/Makefile
@@ -14,7 +14,7 @@ LICENSE= APACHE20
BUILD_DEPENDS= puppet4>=0:sysutils/puppet4
-CONFLICTS_INSTALL= puppetdb-terminus-*
+CONFLICTS_INSTALL= puppetdb-terminus-* puppetdb-terminus3-*
USE_RUBY= yes
NO_BUILD= yes
USES= gmake
diff --git a/databases/puppetdb/Makefile b/databases/puppetdb/Makefile
index 0b5aaadc0c09..15ac43caf27b 100644
--- a/databases/puppetdb/Makefile
+++ b/databases/puppetdb/Makefile
@@ -18,7 +18,7 @@ BUILD_DEPENDS= rubygem-facter>=0:sysutils/rubygem-facter \
USE_RC_SUBR= puppetdb
-CONFLICTS_INSTALL= puppetdb4-*
+CONFLICTS_INSTALL= puppetdb3-* puppetdb4-*
USES= shebangfix
SHEBANG_FILES= ext/files/puppetdb \
ext/files/puppetdb-anonymize \
diff --git a/databases/puppetdb3/Makefile b/databases/puppetdb3/Makefile
new file mode 100644
index 000000000000..4b8cbdfa4d66
--- /dev/null
+++ b/databases/puppetdb3/Makefile
@@ -0,0 +1,78 @@
+# $FreeBSD$
+
+PORTNAME= puppetdb
+PORTVERSION= 3.2.4
+CATEGORIES= databases java
+MASTER_SITES= http://downloads.puppetlabs.com/puppetdb/
+PKGNAMESUFFIX= 3
+
+MAINTAINER= freebsd@zleslie.info
+COMMENT= PuppetDB storeconfigs backend
+
+LICENSE= APACHE20
+
+RUN_DEPENDS= bash:${PORTSDIR}/shells/bash \
+ puppet:${PORTSDIR}/sysutils/puppet4
+BUILD_DEPENDS= rubygem-facter>=0:${PORTSDIR}/sysutils/rubygem-facter \
+ rubygem-rake>=0:${PORTSDIR}/devel/rubygem-rake
+
+USE_RC_SUBR= puppetdb
+
+CONFLICTS_INSTALL= puppetdb-* puppetdb4-*
+USE_JAVA= yes
+NO_BUILD= yes
+JAVA_VERSION= 1.7+
+
+USERS= puppetdb
+GROUPS= puppetdb
+
+SUB_LIST= JAVA_HOME=${JAVA_HOME}
+SUB_FILES= pkg-message
+
+PKGMESSAGE= ${WRKDIR}/pkg-message
+
+.include <bsd.port.pre.mk>
+
+post-patch:
+.for file in ext/config/bootstrap.cfg ext/config/logback.xml \
+ ext/config/request-logging.xml ext/config/conf.d/config.ini \
+ ext/config/conf.d/database.ini ext/config/conf.d/jetty.ini \
+ ext/config/conf.d/repl.ini ext/bin/puppetdb
+ @${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|" ${WRKSRC}/${file}
+ @${REINPLACE_CMD} -e "s|%%JAVA%%|${JAVA}|" ${WRKSRC}/${file}
+ @${REINPLACE_CMD} -e "s|%%DATADIR%%|${DATADIR}|" ${WRKSRC}/${file}
+ @${REINPLACE_CMD} -e "s|%%ETCDIR%%|${ETCDIR}|" ${WRKSRC}/${file}
+.endfor
+
+.for file in ext/cli/anonymize ext/cli/config-migration \
+ ext/cli/export ext/cli/foreground ext/cli/import \
+ ext/cli/ssl-setup
+ @${REINPLACE_CMD} -e 's|/etc/puppetlabs/puppetdb|${ETCDIR}|g' ${WRKSRC}/${file}
+ @${REINPLACE_CMD} -e 's|/bin/bash|${PREFIX}/bin/bash|g' ${WRKSRC}/${file}
+.endfor
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${DATADIR}
+ ${MKDIR} ${STAGEDIR}${DATADIR}/cli
+ ${MKDIR} ${STAGEDIR}${DATADIR}/cli/apps
+ ${MKDIR} ${STAGEDIR}${ETCDIR}
+ ${MKDIR} ${STAGEDIR}${ETCDIR}/conf.d
+ ${MKDIR} ${STAGEDIR}/var/log/puppetdb
+ ${MKDIR} ${STAGEDIR}/var/db/puppetdb
+ ${INSTALL_DATA} ${WRKSRC}/puppetdb.jar ${STAGEDIR}${DATADIR}/puppetdb.jar
+ ${INSTALL_DATA} ${WRKSRC}/ext/config/conf.d/config.ini ${STAGEDIR}${ETCDIR}/conf.d/config.ini.sample
+ ${INSTALL_DATA} ${WRKSRC}/ext/config/conf.d/database.ini ${STAGEDIR}${ETCDIR}/conf.d/database.ini.sample
+ ${INSTALL_DATA} ${WRKSRC}/ext/config/conf.d/jetty.ini ${STAGEDIR}${ETCDIR}/conf.d/jetty.ini.sample
+ ${INSTALL_DATA} ${WRKSRC}/ext/config/conf.d/repl.ini ${STAGEDIR}${ETCDIR}/conf.d/repl.ini.sample
+ ${INSTALL_DATA} ${WRKSRC}/ext/config/bootstrap.cfg ${STAGEDIR}${ETCDIR}/bootstrap.cfg.sample
+ ${INSTALL_DATA} ${WRKSRC}/ext/config/logback.xml ${STAGEDIR}${ETCDIR}/logback.xml.sample
+ ${INSTALL_DATA} ${WRKSRC}/ext/config/request-logging.xml ${STAGEDIR}${ETCDIR}/request-logging.xml.sample
+ ${INSTALL_DATA} ${WRKSRC}/ext/cli/anonymize ${STAGEDIR}${DATADIR}/cli/apps/anonymize
+ ${INSTALL_DATA} ${WRKSRC}/ext/cli/config-migration ${STAGEDIR}${DATADIR}/cli/apps/config-migration
+ ${INSTALL_DATA} ${WRKSRC}/ext/cli/export ${STAGEDIR}${DATADIR}/cli/apps/export
+ ${INSTALL_DATA} ${WRKSRC}/ext/cli/foreground ${STAGEDIR}${DATADIR}/cli/apps/foreground
+ ${INSTALL_DATA} ${WRKSRC}/ext/cli/import ${STAGEDIR}${DATADIR}/cli/apps/import
+ ${INSTALL_DATA} ${WRKSRC}/ext/cli/ssl-setup ${STAGEDIR}${DATADIR}/cli/apps/ssl-setup
+ ${INSTALL_DATA} ${WRKSRC}/ext/bin/puppetdb ${STAGEDIR}${PREFIX}/sbin/puppetdb
+
+.include <bsd.port.post.mk>
diff --git a/databases/puppetdb3/distinfo b/databases/puppetdb3/distinfo
new file mode 100644
index 000000000000..40b0c1c4c2b0
--- /dev/null
+++ b/databases/puppetdb3/distinfo
@@ -0,0 +1,2 @@
+SHA256 (puppetdb-3.2.4.tar.gz) = 580d25ace29b61d7504dfc2650fd7e1c6a14e77421cbfafed14703d857996d84
+SIZE (puppetdb-3.2.4.tar.gz) = 25695565
diff --git a/databases/puppetdb3/files/patch-ext__bin__puppetdb b/databases/puppetdb3/files/patch-ext__bin__puppetdb
new file mode 100644
index 000000000000..3a813b34d8cd
--- /dev/null
+++ b/databases/puppetdb3/files/patch-ext__bin__puppetdb
@@ -0,0 +1,21 @@
+--- ext/bin/puppetdb.orig 2016-01-25 03:46:10.797703384 +0000
++++ ext/bin/puppetdb 2016-01-25 04:12:10.048976423 +0000
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!%%PREFIX%%/bin/bash
+
+ set -a
+ if [ -r "/etc/default/puppetdb" ] ; then
+@@ -11,6 +11,12 @@
+ USER="_puppetdb"
+ INSTALL_DIR="/opt/puppetlabs/server/apps/puppetdb"
+ CONFIG="/etc/puppetlabs/puppetdb/conf.d"
++elif [ `uname` == "FreeBSD" ] ; then
++ JAVA_BIN="%%JAVA%%"
++ JAVA_ARGS="-Xmx192m"
++ USER="puppetdb"
++ INSTALL_DIR="%%DATADIR%%"
++ CONFIG="%%PREFIX%%/%%ETCDIR%%/conf.d"
+ else
+ echo "You seem to be missing some important configuration files; could not find /etc/default/puppetdb or /etc/sysconfig/puppetdb" >&2
+ exit 1
diff --git a/databases/puppetdb3/files/patch-ext__config__conf.d__config.ini b/databases/puppetdb3/files/patch-ext__config__conf.d__config.ini
new file mode 100644
index 000000000000..316e40af8da5
--- /dev/null
+++ b/databases/puppetdb3/files/patch-ext__config__conf.d__config.ini
@@ -0,0 +1,15 @@
+--- ext/config/conf.d/config.ini.orig 2016-02-25 00:02:56 UTC
++++ ext/config/conf.d/config.ini
+@@ -3,10 +3,10 @@
+
+ [global]
+ # Store mq/db data in a custom directory
+-vardir = /opt/puppetlabs/server/data/puppetdb
++vardir = /var/db/puppetdb
+
+ # Use an external logback config file
+-logging-config = /etc/puppetlabs/puppetdb/logback.xml
++logging-config = /usr/local/etc/puppetdb/logback.xml
+
+ [command-processing]
+ # How many command-processing threads to use, defaults to (CPUs / 2)
diff --git a/databases/puppetdb3/files/patch-ext__config__conf.d__database.ini b/databases/puppetdb3/files/patch-ext__config__conf.d__database.ini
new file mode 100644
index 000000000000..8c68b3529f83
--- /dev/null
+++ b/databases/puppetdb3/files/patch-ext__config__conf.d__database.ini
@@ -0,0 +1,11 @@
+--- ext/config/conf.d/database.ini.orig 2016-02-25 00:02:56 UTC
++++ ext/config/conf.d/database.ini
+@@ -12,7 +12,7 @@ subprotocol = hsqldb
+ # For the embedded DB: file:/path/to/database;hsqldb.tx=mvcc;sql.syntax_pgs=true
+ # For PostgreSQL: //host:port/databaseName
+ # Defaults to embedded DB located in <vardir>/db
+-subname = file:/opt/puppetlabs/server/data/puppetdb/db/db;hsqldb.tx=mvcc;sql.syntax_pgs=true
++subname = file:/var/db/puppetdb/db/db;hsqldb.tx=mvcc;sql.syntax_pgs=true
+
+ # Connect as a specific user
+ # username = foobar
diff --git a/databases/puppetdb3/files/patch-ext__config__logback.xml b/databases/puppetdb3/files/patch-ext__config__logback.xml
new file mode 100644
index 000000000000..c27980d88516
--- /dev/null
+++ b/databases/puppetdb3/files/patch-ext__config__logback.xml
@@ -0,0 +1,15 @@
+--- ext/config/logback.xml.orig 2016-02-25 00:02:56 UTC
++++ ext/config/logback.xml
+@@ -6,10 +6,10 @@
+ </appender>
+
+ <appender name="F1" class="ch.qos.logback.core.rolling.RollingFileAppender">
+- <file>/var/log/puppetlabs/puppetdb/puppetdb.log</file>
++ <file>/var/log/puppetdb/puppetdb.log</file>
+
+ <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+- <fileNamePattern>/var/log/puppetlabs/puppetdb/puppetdb-%d{yyyy-MM-dd}.log.gz</fileNamePattern>
++ <fileNamePattern>/var/log/puppetdb/puppetdb-%d{yyyy-MM-dd}.log.gz</fileNamePattern>
+ <maxHistory>90</maxHistory>
+ </rollingPolicy>
+ <encoder>
diff --git a/databases/puppetdb3/files/patch-ext__config__request-logging.xml b/databases/puppetdb3/files/patch-ext__config__request-logging.xml
new file mode 100644
index 000000000000..a058b8950e6b
--- /dev/null
+++ b/databases/puppetdb3/files/patch-ext__config__request-logging.xml
@@ -0,0 +1,10 @@
+--- ext/config/request-logging.xml.orig 2016-02-25 00:02:56 UTC
++++ ext/config/request-logging.xml
+@@ -1,6 +1,6 @@
+ <configuration debug="false">
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+- <file>/var/log/puppetlabs/puppetdb/puppetdb-access.log</file>
++ <file>/var/log/puppetdb/puppetdb-access.log</file>
+ <encoder>
+ <pattern>combined</pattern>
+ <!-- To have the same "combined" pattern with elapsedTime ('%D')
diff --git a/databases/puppetdb3/files/pkg-message.in b/databases/puppetdb3/files/pkg-message.in
new file mode 100644
index 000000000000..82e76a35423c
--- /dev/null
+++ b/databases/puppetdb3/files/pkg-message.in
@@ -0,0 +1,9 @@
+If this is a new installation, please run the follow to setup your SSL/puppetdb
+server:
+
+%%PREFIX%%/sbin/puppetdb ssl-setup
+
+Add puppetdb_enable="YES" into your rc.conf to enable.
+
+To enable communication from a FreeBSD Puppet master, install the
+puppetdb-terminus package on the master.
diff --git a/databases/puppetdb3/files/puppetdb.in b/databases/puppetdb3/files/puppetdb.in
new file mode 100644
index 000000000000..906cc12ef605
--- /dev/null
+++ b/databases/puppetdb3/files/puppetdb.in
@@ -0,0 +1,85 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: puppetdb
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Configuration settings for puppetdb in /etc/rc.conf:
+#
+# puppetdb_enable (bool):
+# Set to "NO" by default.
+# Set it to "YES" to enable puppetdb
+#
+# puppetdb_args (str):
+# Extra arguments passed to start command
+#
+# puppetdb_java_home (str):
+# Set to "%%JAVA_HOME%%" by default.
+# Set the Java virtual machine to run puppetdb
+#
+# puppetdb_java_opts (str):
+# Set to "" by default.
+# Java VM args to use.
+#
+# puppetdb_user (str):
+# Set to "puppetdb" by default.
+# User to run puppetdb as.
+#
+# puppetdb_group (str):
+# Set to "puppetdb" by default.
+# Group for data file ownership.
+#
+# puppetdb_log_file (str):
+# Set to "/var/log/puppetdb/puppetdb.log" by default.
+# Log file location.
+#
+
+. /etc/rc.subr
+
+name="puppetdb"
+rcvar=puppetdb_enable
+
+load_rc_config "${name}"
+
+: ${puppetdb_enable="NO"}
+: ${puppetdb_args="--config %%PREFIX%%/etc/puppetdb/conf.d -b %%PREFIX%%/etc/puppetdb/bootstrap.cfg"}
+: ${puppetdb_java_home="%%JAVA_HOME%%"}
+: ${puppetdb_user="puppetdb"}
+: ${puppetdb_group="puppetdb"}
+: ${puppetdb_log_file="/var/log/puppetdb/puppetdb.log"}
+
+pidfile="/var/run/puppetdb/puppetdb.pid"
+command="/usr/sbin/daemon"
+java_cmd="${puppetdb_java_home}/bin/java"
+procname="${java_cmd}"
+command_args="-p ${pidfile} ${java_cmd} -cp %%DATADIR%%/puppetdb.jar clojure.main -m puppetlabs.puppetdb.main ${puppetdb_args} > ${puppetdb_log_file} 2>&1"
+
+
+required_files="${java_cmd}"
+
+start_precmd="puppetdb_prestart"
+
+puppetdb_prestart() {
+ if [ ! -f "${puppetdb_log_file}" ]; then
+ touch "${puppetdb_log_file}"
+ chown "${puppetdb_user}:${puppetdb_group}" "${puppetdb_log_file}"
+ chmod 640 "${puppetdb_log_file}"
+ fi
+ if [ ! -d "/var/run/puppetdb" ]; then
+ install -d -o "${puppetdb_user}" -g "${puppetdb_group}" -m 750 "/var/run/puppetdb"
+ fi
+
+ chown -R "root:${puppetdb_group}" "%%PREFIX%%/etc/puppetdb/conf.d"
+ chmod 0750 "%%PREFIX%%/etc/puppetdb/conf.d"
+
+ chown "root:${puppetdb_group}" "%%PREFIX%%/etc/puppetdb/logback.xml"
+ chmod 0640 "%%PREFIX%%/etc/puppetdb/logback.xml"
+
+ chown -R "${puppetdb_user}:${puppetdb_group}" "/var/db/puppetdb"
+ chmod 0750 "/var/db/puppetdb"
+}
+
+run_rc_command "$1"
diff --git a/databases/puppetdb3/pkg-descr b/databases/puppetdb3/pkg-descr
new file mode 100644
index 000000000000..47fcde3773c6
--- /dev/null
+++ b/databases/puppetdb3/pkg-descr
@@ -0,0 +1,3 @@
+The PuppetDB storeconfigs backend
+
+WWW: https://docs.puppetlabs.com/puppetdb/latest/
diff --git a/databases/puppetdb3/pkg-plist b/databases/puppetdb3/pkg-plist
new file mode 100644
index 000000000000..e3feb53f6763
--- /dev/null
+++ b/databases/puppetdb3/pkg-plist
@@ -0,0 +1,21 @@
+@sample %%ETCDIR%%/logback.xml.sample
+@sample %%ETCDIR%%/bootstrap.cfg.sample
+@sample %%ETCDIR%%/request-logging.xml.sample
+@sample %%ETCDIR%%/conf.d/config.ini.sample
+@sample %%ETCDIR%%/conf.d/database.ini.sample
+@sample %%ETCDIR%%/conf.d/jetty.ini.sample
+@sample %%ETCDIR%%/conf.d/repl.ini.sample
+%%DATADIR%%/puppetdb.jar
+@group puppetdb
+@group
+@mode 0750
+%%DATADIR%%/cli/apps/anonymize
+%%DATADIR%%/cli/apps/config-migration
+%%DATADIR%%/cli/apps/export
+%%DATADIR%%/cli/apps/foreground
+%%DATADIR%%/cli/apps/import
+%%DATADIR%%/cli/apps/ssl-setup
+sbin/puppetdb
+@mode
+@dir(puppetdb,puppetdb,) /var/log/puppetdb
+@dir(puppetdb,puppetdb,) /var/db/puppetdb
diff --git a/databases/puppetdb4/Makefile b/databases/puppetdb4/Makefile
index 9bbf48f2ee00..e957dc9e1ca9 100644
--- a/databases/puppetdb4/Makefile
+++ b/databases/puppetdb4/Makefile
@@ -17,7 +17,7 @@ RUN_DEPENDS= bash:shells/bash \
USE_RC_SUBR= puppetdb
-CONFLICTS_INSTALL= puppetdb-*
+CONFLICTS_INSTALL= puppetdb-* puppetdb3-*
USES= shebangfix
SHEBANG_FILES= ext/bin/puppetdb \
ext/cli/anonymize \