aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/puppetserver/Makefile76
-rw-r--r--sysutils/puppetserver/distinfo2
-rw-r--r--sysutils/puppetserver/files/patch-ext__config__conf.d__global.conf9
-rw-r--r--sysutils/puppetserver/files/patch-ext__config__conf.d__puppetserver.conf48
-rw-r--r--sysutils/puppetserver/files/patch-ext__config__conf.d__webserver.conf9
-rw-r--r--sysutils/puppetserver/files/patch-ext__config__logback.xml11
-rw-r--r--sysutils/puppetserver/files/patch-ext__config__request-logging.xml10
-rw-r--r--sysutils/puppetserver/files/pkg-message.in1
-rw-r--r--sysutils/puppetserver/files/puppetserver.in82
-rw-r--r--sysutils/puppetserver/pkg-descr13
-rw-r--r--sysutils/puppetserver/pkg-plist14
12 files changed, 276 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 5a7e9abacac5..264c9faeef60 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -774,6 +774,7 @@
SUBDIR += puppet37
SUBDIR += puppet38
SUBDIR += puppet4
+ SUBDIR += puppetserver
SUBDIR += pv
SUBDIR += pwd_unmkdb
SUBDIR += pwgen
diff --git a/sysutils/puppetserver/Makefile b/sysutils/puppetserver/Makefile
new file mode 100644
index 000000000000..fb093cca7695
--- /dev/null
+++ b/sysutils/puppetserver/Makefile
@@ -0,0 +1,76 @@
+# $FreeBSD$
+
+PORTNAME= puppetserver
+PORTVERSION= 2.2.1
+CATEGORIES= sysutils java
+MASTER_SITES= http://downloads.puppetlabs.com/puppet/
+
+MAINTAINER= xaque208@gmail.com
+COMMENT= Puppet Server running in the JVM
+
+LICENSE= APACHE20
+
+RUN_DEPENDS= bash>=0:${PORTSDIR}/shells/bash \
+ puppet4>=0:${PORTSDIR}/sysutils/puppet4
+BUILD_DEPENDS= rubygem-rake>=0:${PORTSDIR}/devel/rubygem-rake
+
+USE_RC_SUBR= puppetserver
+
+USE_JAVA= yes
+USE_RUBY= yes
+NO_BUILD= yes
+JAVA_VERSION= 1.7+
+
+USERS= puppet
+GROUPS= puppet
+
+SUB_LIST= JAVA_HOME=${JAVA_HOME}
+SUB_FILES= pkg-message
+
+PKGMESSAGE= ${WRKDIR}/pkg-message
+
+OPTIONS_DEFAULT= RFACTER
+OPTIONS_RADIO= FACTER
+OPTIONS_RADIO_FACTER= CFACTER RFACTER
+
+RFACTER_DESC= Use facter 2.x (written in Ruby)
+CFACTER_DESC= Use facter 3.x (experimental rewrite in C++)
+
+RFACTER_BUILD_DEPENDS= rubygem-facter>=2.0:${PORTSDIR}/sysutils/rubygem-facter
+RFACTER_RUN_DEPENDS= rubygem-facter>=2.0:${PORTSDIR}/sysutils/rubygem-facter
+
+CFACTER_BUILD_DEPENDS= facter>=3.0:${PORTSDIR}/sysutils/facter
+CFACTER_RUN_DEPENDS= facter>=3.0:${PORTSDIR}/sysutils/facter
+
+.include <bsd.port.options.mk>
+
+.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/global.conf ext/config/conf.d/puppetserver.conf \
+ ext/config/conf.d/web-routes.conf ext/config/conf.d/webserver.conf \
+ ext/config/conf.d/auth.conf
+ @${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|" ${WRKSRC}/${file}
+ @${REINPLACE_CMD} -e "s|%%RUBY_SITELIBDIR%%|${RUBY_SITELIBDIR}|" ${WRKSRC}/${file}
+ @${REINPLACE_CMD} -e "s|%%RUBY_VER%%|${RUBY_VER}|" ${WRKSRC}/${file}
+.endfor
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${DATADIR}
+ ${MKDIR} ${STAGEDIR}${ETCDIR}
+ ${MKDIR} ${STAGEDIR}${ETCDIR}/conf.d
+ ${MKDIR} ${STAGEDIR}${PREFIX}/etc/puppet/code
+ ${MKDIR} ${STAGEDIR}/var/log/puppetserver
+ ${INSTALL_DATA} ${WRKSRC}/puppet-server-release.jar ${STAGEDIR}${DATADIR}/puppetserver.jar
+ ${INSTALL_DATA} ${WRKSRC}/ext/config/conf.d/global.conf ${STAGEDIR}${ETCDIR}/conf.d/global.conf
+ ${INSTALL_DATA} ${WRKSRC}/ext/config/logback.xml ${STAGEDIR}${ETCDIR}/logback.xml
+ ${INSTALL_DATA} ${WRKSRC}/ext/config/bootstrap.cfg ${STAGEDIR}${ETCDIR}/bootstrap.cfg
+ ${INSTALL_DATA} ${WRKSRC}/ext/config/request-logging.xml ${STAGEDIR}${ETCDIR}/request-logging.xml
+ ${INSTALL_DATA} ${WRKSRC}/ext/config/conf.d/puppetserver.conf ${STAGEDIR}${ETCDIR}/conf.d/puppetserver.conf
+ ${INSTALL_DATA} ${WRKSRC}/ext/config/conf.d/web-routes.conf ${STAGEDIR}${ETCDIR}/conf.d/web-routes.conf
+ ${INSTALL_DATA} ${WRKSRC}/ext/config/conf.d/webserver.conf ${STAGEDIR}${ETCDIR}/conf.d/webserver.conf
+ ${INSTALL_DATA} ${WRKSRC}/ext/config/conf.d/auth.conf ${STAGEDIR}${ETCDIR}/conf.d/auth.conf
+
+.include <bsd.port.post.mk>
diff --git a/sysutils/puppetserver/distinfo b/sysutils/puppetserver/distinfo
new file mode 100644
index 000000000000..22007c0441a8
--- /dev/null
+++ b/sysutils/puppetserver/distinfo
@@ -0,0 +1,2 @@
+SHA256 (puppetserver-2.2.1.tar.gz) = 583662380b161fc35e0f0c5e7e2964892ec4b7e0cb848cadcd76b29684a85843
+SIZE (puppetserver-2.2.1.tar.gz) = 42665674
diff --git a/sysutils/puppetserver/files/patch-ext__config__conf.d__global.conf b/sysutils/puppetserver/files/patch-ext__config__conf.d__global.conf
new file mode 100644
index 000000000000..d5bed9fc64e7
--- /dev/null
+++ b/sysutils/puppetserver/files/patch-ext__config__conf.d__global.conf
@@ -0,0 +1,9 @@
+--- ext/config/conf.d/global.conf.orig 2015-10-27 16:22:06 UTC
++++ ext/config/conf.d/global.conf
+@@ -1,5 +1,5 @@
+ global: {
+ # Path to logback logging configuration file; for more
+ # info, see http://logback.qos.ch/manual/configuration.html
+- logging-config: /etc/puppetlabs/puppetserver/logback.xml
++ logging-config: %%PREFIX%%/etc/puppetserver/logback.xml
+ }
diff --git a/sysutils/puppetserver/files/patch-ext__config__conf.d__puppetserver.conf b/sysutils/puppetserver/files/patch-ext__config__conf.d__puppetserver.conf
new file mode 100644
index 000000000000..12aeb5c9cf6b
--- /dev/null
+++ b/sysutils/puppetserver/files/patch-ext__config__conf.d__puppetserver.conf
@@ -0,0 +1,48 @@
+--- ext/config/conf.d/puppetserver.conf.orig 2015-10-27 17:03:52 UTC
++++ ext/config/conf.d/puppetserver.conf
+@@ -2,11 +2,14 @@
+ jruby-puppet: {
+ # Where the puppet-agent dependency places puppet, facter, etc...
+ # Puppet server expects to load Puppet from this location
+- ruby-load-path: [/opt/puppetlabs/puppet/lib/ruby/vendor_ruby]
++ ruby-load-path: [
++ %%RUBY_SITELIBDIR%%,
++ %%PREFIX%%/lib/ruby/gems/%%RUBY_VER%%/gems/facter-2.4.4/lib/,
++ ]
+
+ # This setting determines where JRuby will look for gems. It is also
+ # used by the `puppetserver gem` command line tool.
+- gem-home: /opt/puppetlabs/server/data/puppetserver/jruby-gems
++ gem-home: /var/puppet/server/data/puppetserver/jruby-gems
+
+
+ # PLEASE NOTE: Use caution when modifying the below settings. Modifying
+@@ -22,23 +25,23 @@
+
+ # (optional) path to puppet conf dir; if not specified, will use
+ # /etc/puppetlabs/puppet
+- master-conf-dir: /etc/puppetlabs/puppet
++ master-conf-dir: %%PREFIX%%/etc/puppet
+
+ # (optional) path to puppet code dir; if not specified, will use
+ # /etc/puppetlabs/code
+- master-code-dir: /etc/puppetlabs/code
++ master-code-dir: %%PREFIX%%/etc/puppet/code
+
+ # (optional) path to puppet var dir; if not specified, will use
+ # /opt/puppetlabs/server/data/puppetserver
+- master-var-dir: /opt/puppetlabs/server/data/puppetserver
++ master-var-dir: /var/puppet/server/data/puppetserver
+
+ # (optional) path to puppet run dir; if not specified, will use
+ # /var/run/puppetlabs/puppetserver
+- master-run-dir: /var/run/puppetlabs/puppetserver
++ master-run-dir: /var/run/puppetserver
+
+ # (optional) path to puppet log dir; if not specified, will use
+ # /var/log/puppetlabs/puppetserver
+- master-log-dir: /var/log/puppetlabs/puppetserver
++ master-log-dir: /var/log/puppetserver
+
+ # (optional) maximum number of JRuby instances to allow
+ #max-active-instances: 1
diff --git a/sysutils/puppetserver/files/patch-ext__config__conf.d__webserver.conf b/sysutils/puppetserver/files/patch-ext__config__conf.d__webserver.conf
new file mode 100644
index 000000000000..40310663026d
--- /dev/null
+++ b/sysutils/puppetserver/files/patch-ext__config__conf.d__webserver.conf
@@ -0,0 +1,9 @@
+--- ext/config/conf.d/webserver.conf.orig 2015-10-27 16:26:17 UTC
++++ ext/config/conf.d/webserver.conf
+@@ -1,5 +1,5 @@
+ webserver: {
+- access-log-config = /etc/puppetlabs/puppetserver/request-logging.xml
++ access-log-config = %%PREFIX%%/etc/puppetserver/request-logging.xml
+ client-auth = want
+ ssl-host = 0.0.0.0
+ ssl-port = 8140
diff --git a/sysutils/puppetserver/files/patch-ext__config__logback.xml b/sysutils/puppetserver/files/patch-ext__config__logback.xml
new file mode 100644
index 000000000000..07aa5d1fed0d
--- /dev/null
+++ b/sysutils/puppetserver/files/patch-ext__config__logback.xml
@@ -0,0 +1,11 @@
+--- ext/config/logback.xml.orig 2015-10-27 16:40:33 UTC
++++ ext/config/logback.xml
+@@ -7,7 +7,7 @@
+
+ <appender name="F1" class="ch.qos.logback.core.FileAppender">
+ <!-- TODO: this path should not be hard-coded -->
+- <file>/var/log/puppetlabs/puppetserver/puppetserver.log</file>
++ <file>/var/log/puppetserver/puppetserver.log</file>
+ <append>true</append>
+ <encoder>
+ <pattern>%d %-5p [%c{2}] %m%n</pattern>
diff --git a/sysutils/puppetserver/files/patch-ext__config__request-logging.xml b/sysutils/puppetserver/files/patch-ext__config__request-logging.xml
new file mode 100644
index 000000000000..ad5e4f564c97
--- /dev/null
+++ b/sysutils/puppetserver/files/patch-ext__config__request-logging.xml
@@ -0,0 +1,10 @@
+--- ext/config/request-logging.xml.orig 2015-10-27 16:40:09 UTC
++++ ext/config/request-logging.xml
+@@ -1,6 +1,6 @@
+ <configuration debug="false" scan="true">
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+- <file>/var/log/puppetlabs/puppetserver/puppetserver-access.log</file>
++ <file>/var/log/puppetserver/puppetserver-access.log</file>
+ <encoder>
+ <pattern>%h %l %u %user %date "%r" %s %b %h %a %localPort %D</pattern>
+ </encoder>
diff --git a/sysutils/puppetserver/files/pkg-message.in b/sysutils/puppetserver/files/pkg-message.in
new file mode 100644
index 000000000000..c3308ed7579d
--- /dev/null
+++ b/sysutils/puppetserver/files/pkg-message.in
@@ -0,0 +1 @@
+Remember to add puppetserver_enable="YES" to rc.conf.
diff --git a/sysutils/puppetserver/files/puppetserver.in b/sysutils/puppetserver/files/puppetserver.in
new file mode 100644
index 000000000000..f4dee21ab0e5
--- /dev/null
+++ b/sysutils/puppetserver/files/puppetserver.in
@@ -0,0 +1,82 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: puppetserver
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Configuration settings for puppetserver in /etc/rc.conf:
+#
+# puppetserver_enable (bool):
+# Set to "NO" by default.
+# Set it to "YES" to enable puppetserver
+#
+# puppetserver_args (str):
+# Extra arguments passed to start command
+#
+# puppetserver_java_home (str):
+# Set to "%%JAVA_HOME%%" by default.
+# Set the Java virtual machine to run puppetserver
+#
+# puppetserver_java_opts (str):
+# Set to "" by default.
+# Java VM args to use.
+#
+# puppetserver_user (str):
+# Set to "puppet" by default.
+# User to run puppetserver as.
+#
+# puppetserver_group (str):
+# Set to "puppet" by default.
+# Group for data file ownership.
+#
+# puppetserver_log_file (str):
+# Set to "/var/log/puppetserver/puppetserver.log" by default.
+# Log file location.
+#
+
+. /etc/rc.subr
+
+name="puppetserver"
+rcvar=puppetserver_enable
+
+load_rc_config "${name}"
+
+: ${puppetserver_enable="NO"}
+: ${puppetserver_args="--config %%PREFIX%%/etc/puppetserver/conf.d -b %%PREFIX%%/etc/puppetserver/bootstrap.cfg"}
+: ${puppetserver_java_home="%%JAVA_HOME%%"}
+: ${puppetserver_user="puppet"}
+: ${puppetserver_group="puppet"}
+: ${puppetserver_log_file="/var/log/puppetserver/puppetserver.log"}
+
+pidfile="/var/run/puppetserver/puppetserver.pid"
+command="/usr/sbin/daemon"
+java_cmd="${puppetserver_java_home}/bin/java"
+procname="${java_cmd}"
+command_args="-p ${pidfile} ${java_cmd} -cp %%DATADIR%%/puppetserver.jar clojure.main -m puppetlabs.trapperkeeper.main ${puppetserver_args} > ${puppetserver_log_file} 2>&1"
+
+
+required_files="${java_cmd}"
+
+start_precmd="puppetserver_prestart"
+
+puppetserver_prestart() {
+ if [ ! -f "${puppetserver_log_file}" ]; then
+ touch "${puppetserver_log_file}"
+ chown "${puppetserver_user}:${puppetserver_group}" "${puppetserver_log_file}"
+ chmod 640 "${puppetserver_log_file}"
+ fi
+ if [ ! -d "/var/run/puppetserver" ]; then
+ install -d -o "${puppetserver_user}" -g "${puppetserver_group}" -m 750 "/var/run/puppetserver"
+ fi
+
+ chown -R "root:${puppetserver_group}" "%%PREFIX%%/etc/puppetserver/conf.d"
+ chmod 0750 "%%PREFIX%%/etc/puppetserver/conf.d"
+
+ chown "root:${puppetserver_group}" "%%PREFIX%%/etc/puppetserver/logback.xml"
+ chmod 0640 "%%PREFIX%%/etc/puppetserver/logback.xml"
+}
+
+run_rc_command "$1"
diff --git a/sysutils/puppetserver/pkg-descr b/sysutils/puppetserver/pkg-descr
new file mode 100644
index 000000000000..99ba4db5203a
--- /dev/null
+++ b/sysutils/puppetserver/pkg-descr
@@ -0,0 +1,13 @@
+Puppet master is a Ruby application that compiles configurations
+for any number of Puppet agent nodes, using Puppet code and various
+other data sources. (For more info, see Overview of Puppet's
+Architecture.)
+
+Puppet Server is an application that runs on the Java Virtual Machine
+(JVM) and provides the same services as the classic Puppet master
+application. It mostly does this by running the existing Puppet
+master code in several JRuby interpreters, but it replaces some
+parts of the classic application with new services written in
+Clojure.
+
+WWW: https://docs.puppetlabs.com/puppetserver/latest/services_master_puppetserver.html
diff --git a/sysutils/puppetserver/pkg-plist b/sysutils/puppetserver/pkg-plist
new file mode 100644
index 000000000000..341c7766ae7a
--- /dev/null
+++ b/sysutils/puppetserver/pkg-plist
@@ -0,0 +1,14 @@
+%%ETCDIR%%/logback.xml
+%%ETCDIR%%/bootstrap.cfg
+%%ETCDIR%%/request-logging.xml
+%%ETCDIR%%/conf.d/global.conf
+%%ETCDIR%%/conf.d/puppetserver.conf
+%%ETCDIR%%/conf.d/web-routes.conf
+%%ETCDIR%%/conf.d/webserver.conf
+%%ETCDIR%%/conf.d/auth.conf
+%%DATADIR%%/puppetserver.jar
+@mode 0750
+@group puppet
+@dir etc/puppet/code
+@owner puppet
+@dir /var/log/puppetserver