import puppetdb 1.3.2

PuppetDB is the fast, scalable, and reliable data warehouse for Puppet.
It caches data generated by Puppet, and gives you advanced features at
awesome speed with a powerful API.

ok aja@
This commit is contained in:
jasper 2013-06-28 09:13:09 +00:00
parent 27645441ec
commit 4db3a481cd
15 changed files with 294 additions and 0 deletions

View File

@ -0,0 +1,65 @@
# $OpenBSD: Makefile,v 1.1.1.1 2013/06/28 09:13:09 jasper Exp $
COMMENT-main= fast, scalable, and reliable data warehouse for Puppet
COMMENT-plugin= PuppetDB terminus plugin
V= 1.3.2
DISTNAME= puppetdb-$V
PKGNAME-main= ${DISTNAME}
PKGNAME-plugin= puppetdb-terminus-$V
CATEGORIES= databases
HOMEPAGE= http://docs.puppetlabs.com/puppetdb/latest/
MAINTAINER= Jasper Lievisse Adriaanse <jasper@openbsd.org>
MASTER_SITES= http://downloads.puppetlabs.com/puppetdb/
# Apache
PERMIT_PACKAGE_CDROM= Yes
MODULES= java \
lang/ruby
MODRUBY_REV= 1.9
MODJAVA_VER= 1.7+
MULTI_PACKAGES= -main -plugin
RUN_DEPENDS-plugin=sysutils/ruby-puppet/3
RUN_DEPENDS-main=${BASE_PKGPATH},-plugin \
java/javaPathHelper \
shells/bash
NO_BUILD= Yes
NO_TEST= Yes
SCRIPTS= export foreground import ssl-setup
do-configure:
${SUBST_CMD} ${WRKSRC}/Rakefile ${WRKSRC}/tasks/install.rake \
${WRKSRC}/ext/files/puppetdb.default
.for s in ${SCRIPTS}
${SUBST_CMD} ${WRKSRC}/ext/files/puppetdb-$s
.endfor
do-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/{,examples/}puppetdb
.for s in ${SCRIPTS}
${INSTALL_SCRIPT} ${WRKSRC}/ext/files/puppetdb-$s ${PREFIX}/sbin/
.endfor
.for c in config.ini database.ini jetty.ini repl.ini
cat ${WRKSRC}/ext/files/$c >> ${PREFIX}/share/examples/puppetdb/puppetdb.conf
.endfor
${INSTALL_DATA} ${WRKSRC}/ext/files/puppetdb.default \
${PREFIX}/share/examples/puppetdb/
${INSTALL_DATA} ${WRKSRC}/ext/files/log4j.properties \
${PREFIX}/share/examples/puppetdb/
${INSTALL_DATA} ${WRKSRC}/puppetdb.jar ${PREFIX}/share/puppetdb/
cd ${PREFIX}/share/puppetdb/ && ln -sf /var/db/puppetdb/db db
cd ${PREFIX}/share/puppetdb/ && ln -sf /var/db/puppetdb/mq mq
cd ${PREFIX}/share/puppetdb/ && ln -sf /var/db/puppetdb/state state
${INSTALL_DATA_DIR} ${PREFIX}/${MODRUBY_SITEDIR}
cd ${WRKSRC}/ext/master/lib/ && pax -rw . ${PREFIX}/${MODRUBY_SITEDIR}
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (puppetdb-1.3.2.tar.gz) = mN1AdK5l3rjUxt1f4vr/ekClJBH8I8G5ZbAEInaRyyA=
SIZE (puppetdb-1.3.2.tar.gz) = 17744543

View File

@ -0,0 +1,50 @@
$OpenBSD: patch-Rakefile,v 1.1.1.1 2013/06/28 09:13:09 jasper Exp $
- Remove unsupported ln(1) option: -T.
- Change various configuration variables to what they would be like when
PuppetDB has been _installed_, as these variables are used in other scripts.
The installer has been modified in tasks/install.rake
- Set OpenBSD's Ruby site dir.
--- Rakefile.orig Mon Jun 3 19:12:39 2013
+++ Rakefile Fri Jun 28 10:26:46 2013
@@ -10,7 +10,7 @@ RAKE_ROOT = File.dirname(__FILE__)
Dir[ File.join(RAKE_ROOT, 'ext', 'packaging', 'tasks', '*.rake') ].sort.each { |t| load t }
def ln_sfT(src, dest)
- sh "ln -sfT #{src} #{dest}"
+ sh "ln -sf #{src} #{dest}"
end
def cp_pr(src, dest, options={})
@@ -51,15 +51,15 @@ if @pe
@pe_version = ENV['PE_VER'] || '3.0'
@java_bin = "/opt/puppet/bin/java"
else
- @install_dir = "/usr/share/puppetdb"
- @etc_dir = "/etc/puppetdb"
- @config_dir = "/etc/puppetdb/conf.d"
+ @install_dir = "share/puppetdb"
+ @etc_dir = "${SYSCONFDIR}/puppetdb"
+ @config_dir = "${SYSCONFDIR}/puppetdb/conf.d"
@initscriptname = "/etc/init.d/puppetdb"
@log_dir = "/var/log/puppetdb"
- @lib_dir = "/var/lib/puppetdb"
- @link = "/usr/share/puppetdb"
+ @lib_dir = "/var/db/puppetdb"
+ @link = "share/puppetdb"
@name = "puppetdb"
- @sbin_dir = "/usr/sbin"
+ @sbin_dir = "sbin"
end
# We only need the ruby major, minor versions
@@ -82,6 +82,8 @@ case @osfamily
@plibdir = @pe ? PE_SITELIBDIR : ( @ruby_version == '1.8' ? '/usr/lib/ruby/site_ruby/1.8' : '/usr/share/ruby/vendor_ruby' )
when /suse/
@plibdir = @pe ? PE_SITELIBDIR : nil
+ when /openbsd/
+ @plibdir = @pe ? PE_SITELIBDIR : '${MODRUBY_SITEDIR}'
end
@heap_dump_path = "#{@log_dir}/puppetdb-oom.hprof"

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-ext_files_config_ini,v 1.1.1.1 2013/06/28 09:13:09 jasper Exp $
--- ext/files/config.ini.orig Mon Jun 3 19:13:08 2013
+++ ext/files/config.ini Fri Jun 28 10:27:03 2013
@@ -1,9 +1,12 @@
# See README.md for more thorough explanations of each section and
# option.
+[jetty]
+port = 8080
+
[global]
# Store mq/db data in a custom directory
-vardir = /var/lib/puppetdb
+vardir = /var/db/puppetdb
# Use an external log4j config file
logging-config = /etc/puppetdb/log4j.properties

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-ext_files_database_ini,v 1.1.1.1 2013/06/28 09:13:09 jasper Exp $
--- ext/files/database.ini.orig Fri Jun 28 10:27:12 2013
+++ ext/files/database.ini Fri Jun 28 10:27:21 2013
@@ -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:/var/lib/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

View File

@ -0,0 +1,10 @@
$OpenBSD: patch-ext_files_puppetdb-export,v 1.1.1.1 2013/06/28 09:13:09 jasper Exp $
--- ext/files/puppetdb-export.orig Mon Jun 3 19:13:08 2013
+++ ext/files/puppetdb-export Thu Jun 27 14:26:47 2013
@@ -1,3 +1,4 @@
-#!/bin/bash
+#!${LOCALBASE}/bin/bash
-/usr/bin/java -Xmx192m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/puppetdb/puppetdb-oom.hprof -jar /usr/share/puppetdb/puppetdb.jar export "$@"
+JAVA_CMD=$(javaPathHelper -c puppetdb)
+${JAVA_CMD} -Xmx192m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/puppetdb/puppetdb-oom.hprof -jar ${PREFIX}/share/puppetdb/puppetdb.jar export "$@"

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-ext_files_puppetdb-foreground,v 1.1.1.1 2013/06/28 09:13:09 jasper Exp $
--- ext/files/puppetdb-foreground.orig Mon Jun 3 19:13:08 2013
+++ ext/files/puppetdb-foreground Thu Jun 27 19:37:43 2013
@@ -1,4 +1,5 @@
-#!/bin/bash
+#!${LOCALBASE}/bin/bash
+JAVA_CMD=$(javaPathHelper -c puppetdb)
ARGS="$@"
-su puppetdb -s /bin/bash -c "/usr/bin/java -Xmx192m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/puppetdb/puppetdb-oom.hprof -jar /usr/share/puppetdb/puppetdb.jar services -c /etc/puppetdb/conf.d $ARGS"
+su _puppetdb -s ${LOCALBASE}/bin/bash -c "${JAVA_CMD} -Xmx192m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/puppetdb/puppetdb-oom.hprof -jar ${PREFIX}/share/puppetdb/puppetdb.jar services -c /etc/puppetdb/conf.d $ARGS"

View File

@ -0,0 +1,10 @@
$OpenBSD: patch-ext_files_puppetdb-import,v 1.1.1.1 2013/06/28 09:13:09 jasper Exp $
--- ext/files/puppetdb-import.orig Mon Jun 3 19:13:08 2013
+++ ext/files/puppetdb-import Thu Jun 27 14:27:02 2013
@@ -1,3 +1,4 @@
-#!/bin/bash
+#!${LOCALBASE}/bin/bash
-/usr/bin/java -Xmx192m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/puppetdb/puppetdb-oom.hprof -jar /usr/share/puppetdb/puppetdb.jar import "$@"
+JAVA_CMD=$(javaPathHelper -c puppetdb)
+${JAVA_CMD} -Xmx192m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/puppetdb/puppetdb-oom.hprof -jar ${PREFIX}/share/puppetdb/puppetdb.jar import "$@"

View File

@ -0,0 +1,36 @@
$OpenBSD: patch-ext_files_puppetdb-ssl-setup,v 1.1.1.1 2013/06/28 09:13:09 jasper Exp $
- Use a more portable construct, since head -c isn't implemented on OpenBSD.
- Adjust the mktemp(1) template to include six 'X's to prevent an "Invalid
argument" error on OpenBSD.
--- ext/files/puppetdb-ssl-setup.orig Mon Jun 3 19:12:39 2013
+++ ext/files/puppetdb-ssl-setup Thu Jun 27 16:06:44 2013
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!${LOCALBASE}/bin/bash
# This function wraps sed:
# * Makes sure its atomic by writing to a temp file and moving it _after_
@@ -81,8 +81,8 @@ else
puppetdb_confdir="/etc/puppetlabs/puppetdb"
user=pe-puppetdb
else
- puppetdb_confdir="/etc/puppetdb"
- user=puppetdb
+ puppetdb_confdir="${SYSCONFDIR}/puppetdb"
+ user=_puppetdb
fi
fi
@@ -104,8 +104,8 @@ pw_file=${puppetdb_confdir}/ssl/puppetdb_keystore_pw.t
if [ -f $pw_file ]; then
password=`cat $pw_file`
else
- password=`export LC_ALL=C; dd if=/dev/urandom count=20 2> /dev/null | tr -cd '[:alnum:]' | head -c 25`
- tmpdir=`mktemp -t -d tmp.puppetdbXXXXX`
+ password=`export LC_ALL=C; dd if=/dev/urandom count=20 2> /dev/null | tr -cd '[:alnum:]' | cut -c 1-25`
+ tmpdir=`mktemp -t -d tmp.puppetdbXXXXXX`
rm -rf $tmpdir
mkdir -p $tmpdir
cp $myca $tmpdir/ca.pem

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-ext_files_puppetdb_default,v 1.1.1.1 2013/06/28 09:13:09 jasper Exp $
--- ext/files/puppetdb.default.orig Thu Jun 27 15:13:22 2013
+++ ext/files/puppetdb.default Thu Jun 27 15:13:25 2013
@@ -3,12 +3,12 @@
###########################################
# Location of your Java binary (version 6 or higher)
-JAVA_BIN="/usr/bin/java"
+JAVA_BIN==$(${LOCALBASE}/bin/javaPathHelper -c puppetdb)
# Modify this if you'd like to change the memory allocation, enable JMX, etc
JAVA_ARGS="-Xmx192m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/puppetdb/puppetdb-oom.hprof "
# These normally shouldn't need to be edited if using OS packages
-USER="puppetdb"
-INSTALL_DIR="/usr/share/puppetdb"
-CONFIG="/etc/puppetdb/conf.d"
+USER="_puppetdb"
+INSTALL_DIR="${PREFIX}/share/puppetdb"
+CONFIG="${SYSCONFDIR}/puppetdb/conf.d"

View File

@ -0,0 +1,3 @@
PuppetDB is the fast, scalable, and reliable data warehouse for Puppet.
It caches data generated by Puppet, and gives you advanced features at
awesome speed with a powerful API.

View File

@ -0,0 +1 @@
Connect Puppet to PuppetDB by setting up a terminus for PuppetDB.

View File

@ -0,0 +1,28 @@
@comment $OpenBSD: PLIST-main,v 1.1.1.1 2013/06/28 09:13:09 jasper Exp $
@newgroup _puppetdb:719
@newuser _puppetdb:719:719:daemon:PuppetDB user:/nonexistent:/sbin/nologin
@extraunexec rm -rf /var/log/puppetdb/*
sbin/puppetdb-export
sbin/puppetdb-foreground
sbin/puppetdb-import
sbin/puppetdb-ssl-setup
share/examples/puppetdb/
@sample ${SYSCONFDIR}/puppetdb/
@sample ${SYSCONFDIR}/puppetdb/conf.d/
share/examples/puppetdb/puppetdb.conf
@sample ${SYSCONFDIR}/puppetdb/conf.d/puppetdb.conf
share/examples/puppetdb/log4j.properties
@sample ${SYSCONFDIR}/puppetdb/log4j.properties
share/examples/puppetdb/puppetdb.default
@sample ${SYSCONFDIR}/puppetdb/conf.d/puppetdb
share/puppetdb/
share/puppetdb/db
share/puppetdb/mq
share/puppetdb/puppetdb.jar
share/puppetdb/state
@sample /var/db/puppetdb/
@sample /var/db/puppetdb/db/
@sample /var/db/puppetdb/mq/
@sample /var/db/puppetdb/state/
@sample /var/log/puppetdb/
@rcscript ${RCDIR}/puppetdb

View File

@ -0,0 +1,16 @@
@comment $OpenBSD: PLIST-plugin,v 1.1.1.1 2013/06/28 09:13:09 jasper Exp $
${MODRUBY_SITEDIR}/puppet/application/storeconfigs.rb
${MODRUBY_SITEDIR}/puppet/face/node/deactivate.rb
${MODRUBY_SITEDIR}/puppet/face/node/status.rb
${MODRUBY_SITEDIR}/puppet/face/storeconfigs.rb
${MODRUBY_SITEDIR}/puppet/indirector/catalog/puppetdb.rb
${MODRUBY_SITEDIR}/puppet/indirector/facts/puppetdb.rb
${MODRUBY_SITEDIR}/puppet/indirector/node/puppetdb.rb
${MODRUBY_SITEDIR}/puppet/indirector/resource/puppetdb.rb
${MODRUBY_SITEDIR}/puppet/reports/puppetdb.rb
${MODRUBY_SITEDIR}/puppet/util/puppetdb/
${MODRUBY_SITEDIR}/puppet/util/puppetdb.rb
${MODRUBY_SITEDIR}/puppet/util/puppetdb/char_encoding.rb
${MODRUBY_SITEDIR}/puppet/util/puppetdb/command.rb
${MODRUBY_SITEDIR}/puppet/util/puppetdb/command_names.rb
${MODRUBY_SITEDIR}/puppet/util/puppetdb/config.rb

View File

@ -0,0 +1,13 @@
#!/bin/sh
#
# $OpenBSD: puppetdb.rc,v 1.1.1.1 2013/06/28 09:13:09 jasper Exp $
daemon=$(${LOCALBASE}/bin/javaPathHelper -c puppetdb)
daemon_flags="-jar ${PREFIX}/share/puppetdb/puppetdb.jar services -c ${SYSCONFDIR}/puppetdb/conf.d/puppetdb.conf"
. /etc/rc.d/rc.subr
rc_bg=YES
rc_reload=NO
rc_cmd $1