You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2014/11/13 14:00:10 UTC
svn commit: r1639317 - in /sling/trunk/contrib: ./ launchpad/debian/
launchpad/debian/src/ launchpad/debian/src/deb/
launchpad/debian/src/deb/control/ launchpad/debian/src/root_fs/
launchpad/debian/src/root_fs/etc/ launchpad/debian/src/root_fs/etc/defa...
Author: bdelacretaz
Date: Thu Nov 13 13:00:09 2014
New Revision: 1639317
URL: http://svn.apache.org/r1639317
Log:
SLING-4151 - Sling Launchpad debian/.ubuntu package, contributed by Bruce Edge, thanks!
Added:
sling/trunk/contrib/launchpad/debian/ (with props)
sling/trunk/contrib/launchpad/debian/README.txt
sling/trunk/contrib/launchpad/debian/pom.xml
sling/trunk/contrib/launchpad/debian/src/
sling/trunk/contrib/launchpad/debian/src/deb/
sling/trunk/contrib/launchpad/debian/src/deb/control/
sling/trunk/contrib/launchpad/debian/src/deb/control/control
sling/trunk/contrib/launchpad/debian/src/deb/control/postinst
sling/trunk/contrib/launchpad/debian/src/deb/control/prerm
sling/trunk/contrib/launchpad/debian/src/root_fs/
sling/trunk/contrib/launchpad/debian/src/root_fs/etc/
sling/trunk/contrib/launchpad/debian/src/root_fs/etc/default/
sling/trunk/contrib/launchpad/debian/src/root_fs/etc/default/sling.sample
sling/trunk/contrib/launchpad/debian/src/root_fs/etc/init.d/
sling/trunk/contrib/launchpad/debian/src/root_fs/etc/init.d/sling
sling/trunk/contrib/launchpad/debian/src/root_fs/etc/logrotate.d/
sling/trunk/contrib/launchpad/debian/src/root_fs/etc/logrotate.d/sling
Modified:
sling/trunk/contrib/pom.xml
Propchange: sling/trunk/contrib/launchpad/debian/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Nov 13 13:00:09 2014
@@ -0,0 +1,14 @@
+target
+bin
+*.iml
+*.ipr
+*.iws
+.settings
+.project
+.classpath
+.externalToolBuilders
+maven-eclipse.xml
+felix-cache
+sling-crankstart
+derby.log
+
Added: sling/trunk/contrib/launchpad/debian/README.txt
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/launchpad/debian/README.txt?rev=1639317&view=auto
==============================================================================
--- sling/trunk/contrib/launchpad/debian/README.txt (added)
+++ sling/trunk/contrib/launchpad/debian/README.txt Thu Nov 13 13:00:09 2014
@@ -0,0 +1,11 @@
+Apache Sling debian/ubuntu packageing
+==========================================
+
+This is a work in progress .deb packaging for Sling.
+
+It provides basic init.d start/stop logrotate & sample sling config.
+
+To run this, and install using dpkg/apt commands, review /etc/default.sling
+config and run
+ "service sling start"
+
Added: sling/trunk/contrib/launchpad/debian/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/launchpad/debian/pom.xml?rev=1639317&view=auto
==============================================================================
--- sling/trunk/contrib/launchpad/debian/pom.xml (added)
+++ sling/trunk/contrib/launchpad/debian/pom.xml Thu Nov 13 13:00:09 2014
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>sling</artifactId>
+ <version>22</version>
+ <relativePath>../../../parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sling-lauchpad</artifactId>
+ <packaging>jar</packaging>
+ <version>8-SNAPSHOT</version>
+
+ <name>Apache Sling Launchpad Debian Package Builder</name>
+ <description>
+ Simple packaged installation for sling launchpad standalone jar
+ as a system daemon.
+ </description>
+
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/launchpad/builder/debian</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/launchpad/builder/debian</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/trunk/launchpad/builder/debian</url>
+ </scm>
+
+ <properties>
+ <!--
+ jdeb plugin version for debian package
+ -->
+ <jdeb.version>1.0.1</jdeb.version>
+ <!--
+ builder artifact identifier
+ -->
+ <builder.artifact>org.apache.sling.launchpad</builder.artifact>
+
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>jdeb</artifactId>
+ <groupId>org.vafer</groupId>
+ <version>${jdeb.version}</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>jdeb</goal>
+ </goals>
+ <configuration>
+ <dataSet>
+ <data>
+ <src>../../../launchpad/builder/target/${builder.artifact}-${project.version}-standalone.jar</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>/opt/sling/${project.parent.artifactId}</prefix>
+ </mapper>
+ </data>
+ <data>
+ <src>${project.basedir}/src/root_fs/</src>
+ <type>directory</type>
+ <excludes>**/.svn/</excludes>
+ <mapper>
+ <type>perm</type>
+ <prefix>/</prefix>
+ </mapper>
+ </data>
+ </dataSet>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <!-- No javadocs -->
+ <excludePackageNames>
+ org.apache.sling
+ </excludePackageNames>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <repositories>
+ <repository>
+ <id>OPS4J</id>
+ <name>OPS4J Repository</name>
+ <url>http://repository.ops4j.org/maven2</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+</project>
+
Added: sling/trunk/contrib/launchpad/debian/src/deb/control/control
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/launchpad/debian/src/deb/control/control?rev=1639317&view=auto
==============================================================================
--- sling/trunk/contrib/launchpad/debian/src/deb/control/control (added)
+++ sling/trunk/contrib/launchpad/debian/src/deb/control/control Thu Nov 13 13:00:09 2014
@@ -0,0 +1,9 @@
+Package: [[artifactId]]
+Version: [[version]]
+Section: misc
+Priority: optional
+Architecture: all
+Maintainer: Bruce Edge <br...@nextissuemedia.com>
+Depends: oracle-java7-installer
+Description: [[description]]
+Distribution: development
Added: sling/trunk/contrib/launchpad/debian/src/deb/control/postinst
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/launchpad/debian/src/deb/control/postinst?rev=1639317&view=auto
==============================================================================
--- sling/trunk/contrib/launchpad/debian/src/deb/control/postinst (added)
+++ sling/trunk/contrib/launchpad/debian/src/deb/control/postinst Thu Nov 13 13:00:09 2014
@@ -0,0 +1,57 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+echo $0 $*
+[ "$DEBUG" ] && set -x
+
+
+
+SLING_DEFAULTS=/etc/default/sling
+if [ ! -e $SLING_DEFAULTS ] ; then
+ cp $SLING_DEFAULTS.sample $SLING_DEFAULTS
+fi
+. $SLING_DEFAULTS
+
+chmod +x /etc/init.d/sling
+
+# Check for sling user
+if ! getent passwd | grep -q sling ; then
+ useradd --home-dir $SLING_HOME --gid adm $SLING_USER
+fi
+
+# Make data dir
+SLING_DATA=/var/lib/sling
+if [ ! -d $SLING_DATA ] ; then
+ echo Create $SLING_DATA
+ mkdir -p $SLING_DATA
+ chown -R $SLING_USER:adm $SLING_DATA
+fi
+
+# Make log dir
+if [ ! -d $SLING_LOG_DIR ] ; then
+ echo Create $SLING_LOG_DIR
+ mkdir -p $SLING_LOG_DIR
+ chown -R $SLING_USER:adm $SLING_LOG_DIR
+fi
+
+update-rc.d sling defaults
+
+if service sling status; then
+ service sling restart
+fi
+
Added: sling/trunk/contrib/launchpad/debian/src/deb/control/prerm
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/launchpad/debian/src/deb/control/prerm?rev=1639317&view=auto
==============================================================================
--- sling/trunk/contrib/launchpad/debian/src/deb/control/prerm (added)
+++ sling/trunk/contrib/launchpad/debian/src/deb/control/prerm Thu Nov 13 13:00:09 2014
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+echo $0 $*
+[ "$DEBUG" ] && set -x
+. /etc/default/sling || true
+
+if [ remove = "$1" ]; then
+ if service sling status; then
+ service sling stop
+ fi
+ rm -f $SLING_DEFAULTS
+ if [ "$SLING_DATA" ] && [ -d $SLING_DATA ] ; then
+ echo Not Purging $SLING_DATA
+ # rm -rf $SLING_DATA
+ fi
+fi
Added: sling/trunk/contrib/launchpad/debian/src/root_fs/etc/default/sling.sample
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/launchpad/debian/src/root_fs/etc/default/sling.sample?rev=1639317&view=auto
==============================================================================
--- sling/trunk/contrib/launchpad/debian/src/root_fs/etc/default/sling.sample (added)
+++ sling/trunk/contrib/launchpad/debian/src/root_fs/etc/default/sling.sample Thu Nov 13 13:00:09 2014
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# sling defaults
+
+set -a
+SLING_DATA=/var/lib/sling
+set +a
+
+# usage: org.apache.sling.launchpad.app.Main [ start | stop | status ] [ -j adr ] [ -l loglevel ] [ -f logfile ] [ -c slinghome ] [ -i launchpadhome ] [ -a address ] [ -p port ] { -Dn=v } [ -h ]
+# start listen for control connection (uses -j)
+# stop terminate running Apache Sling (uses -j)
+# status check whether Apache Sling is running (uses -j)
+# -j adr host and port to use for control connection in the format '[host:]port' (default 127.0.0.1:0)
+# -l loglevel the initial loglevel (0..4, FATAL, ERROR, WARN, INFO, DEBUG)
+# -f logfile the log file, "-" for stdout (default logs/error.log)
+# -c slinghome the sling context directory (default sling)
+# -i launchpadhome the launchpad directory (default slinghome)
+# -a address the interfact to bind to (use 0.0.0.0 for any)
+# -p port the port to listen to (default 8080)
+# -r path the root servlet context path for the http service (default is /)
+# -n don't install the shutdown hook
+# -Dn=v sets property n to value v. Make sure to use this option *after* the jar filename. The JVM also has a -D option which has a different meaning
+# -h prints this usage message
+
+JAVA_ARGS="-Xmx384M "
+# Uncomment for debugging:
+#JAVA_DEBUG_ARGS="-agentlib:jdwp=transport=dt_socket,address=30303,server=y,suspend=n"
+
+SLING_DEFAULT_ARGS="-c $SLING_DATA -p 8090 -a 0.0.0.0 $DEBUG_ARGS"
+
+
+# Don't change anything below this line unless you want to break something
+# ========================================================================
+
+set -a
+SLING_HOME=/opt/sling
+SLING_LOG_DIR=/var/log/sling
+LOG_FILE=$SLING_LOG_DIR/${NAME}-start.log
+SLING_USER=sling
+SLING_DATA=/var/lib/sling
+SLING_DEFAULTS=/etc/default/sling
+set +a
Added: sling/trunk/contrib/launchpad/debian/src/root_fs/etc/init.d/sling
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/launchpad/debian/src/root_fs/etc/init.d/sling?rev=1639317&view=auto
==============================================================================
--- sling/trunk/contrib/launchpad/debian/src/root_fs/etc/init.d/sling (added)
+++ sling/trunk/contrib/launchpad/debian/src/root_fs/etc/init.d/sling Thu Nov 13 13:00:09 2014
@@ -0,0 +1,119 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#
+# Usage
+#
+function usage () {
+ echo "Purpose: Stop/Start sling"
+ echo "Usage : $0 { stop | start }"
+}
+
+NAME=sling
+
+PID=/var/run/${NAME}.pid
+
+[ "$DEBUG" ] && set -x
+
+. /etc/profile
+
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
+
+SLING_DEFAULTS=/etc/default/sling
+[ -r $SLING_DEFAULTS ] && . $SLING_DEFAULTS
+
+SLING_JAR=$(find $SLING_HOME -name \*-standalone.jar)
+
+running()
+{
+ local PID=$(cat "$1" 2>/dev/null) || return 1
+ kill -0 "$PID" 2>/dev/null
+}
+
+status()
+{
+ if running "$PID"
+ then
+ echo "OK"
+ else
+ echo "FAILED"
+ fi
+}
+
+#
+# Stop current sling instance
+#
+function stop () {
+ start-stop-daemon --stop --pidfile $PID --chdir $SLING_HOME --startas "./$NAME" --signal TERM
+}
+
+#
+# Start batch job scheduler
+#
+function start () {
+
+ if start-stop-daemon --start \
+ --chdir "$SLING_HOME" \
+ --chuid $SLING_USER \
+ --pidfile "$PID" \
+ --make-pidfile \
+ --startas $(which java) \
+ -- \
+ $JAVA_ARGS $JAVA_DEBUG_ARGS \
+ -jar $SLING_JAR $SLING_DEFAULT_ARGS \
+ >>$LOG_FILE 2>&1 &
+ then
+ sleep 3s
+ status
+ fi
+
+}
+
+if test -z "$1"; then
+ usage
+ exit
+fi
+case $1 in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ while ps --pid $(cat $PID) >/dev/null ; do
+ sleep 1
+ done
+ start
+ ;;
+ status)
+ if [ $(status) == "OK" ] ; then
+ exit 0
+ else
+ exit 1
+ fi
+ ;;
+ *)
+ echo "Unknown parameter: $1"
+ usage
+ ;;
+ esac
+
+
+# end_of_file
Added: sling/trunk/contrib/launchpad/debian/src/root_fs/etc/logrotate.d/sling
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/launchpad/debian/src/root_fs/etc/logrotate.d/sling?rev=1639317&view=auto
==============================================================================
--- sling/trunk/contrib/launchpad/debian/src/root_fs/etc/logrotate.d/sling (added)
+++ sling/trunk/contrib/launchpad/debian/src/root_fs/etc/logrotate.d/sling Thu Nov 13 13:00:09 2014
@@ -0,0 +1,9 @@
+/var/log/sling/sling-start.log {
+ rotate 5
+ size 4M
+ copytruncate
+ daily
+ compress
+ missingok
+ notifempty
+}
Modified: sling/trunk/contrib/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/pom.xml?rev=1639317&r1=1639316&r2=1639317&view=diff
==============================================================================
--- sling/trunk/contrib/pom.xml (original)
+++ sling/trunk/contrib/pom.xml Thu Nov 13 13:00:09 2014
@@ -135,6 +135,7 @@
<module>validation</module>
<module>launchpad/karaf</module>
<module>launchpad/testing</module>
+ <module>launchpad/debian</module>
</modules>
<profiles>
<profile>