You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sv...@apache.org on 2016/04/12 10:35:21 UTC

[1/2] brooklyn-dist git commit: Add deb packaging files

Repository: brooklyn-dist
Updated Branches:
  refs/heads/master f4f0ecaf6 -> 299c8cfad


Add deb packaging files


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/commit/d1b541ab
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/tree/d1b541ab
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/diff/d1b541ab

Branch: refs/heads/master
Commit: d1b541abd040d5c97a99c1242a25c205aa6fbade
Parents: f4f0eca
Author: alrick87 <so...@gmail.com>
Authored: Wed Mar 30 13:55:24 2016 +0300
Committer: alrick87 <so...@gmail.com>
Committed: Fri Apr 8 16:22:38 2016 +0300

----------------------------------------------------------------------
 deb-packaging/pom.xml                      | 122 ++++++++++++++++++
 deb-packaging/src/conf/brooklyn.conf       |  26 ++++
 deb-packaging/src/conf/logback.xml         |  24 ++++
 deb-packaging/src/deb/control/control      |  24 ++++
 deb-packaging/src/deb/control/postinst     |  20 +++
 deb-packaging/src/deb/control/postrm       |  18 +++
 deb-packaging/src/deb/control/preinst      |  19 +++
 deb-packaging/src/deb/control/prerm        |  18 +++
 deb-packaging/src/deb/init.d/brooklyn      |  93 ++++++++++++++
 packaging/pom.xml                          | 163 ------------------------
 packaging/src/conf/brooklyn.conf           |  26 ----
 packaging/src/conf/logback.xml             |  24 ----
 packaging/src/service/brooklyn.service     |  33 -----
 pom.xml                                    |  14 +-
 rpm-packaging/pom.xml                      | 163 ++++++++++++++++++++++++
 rpm-packaging/src/conf/brooklyn.conf       |  26 ++++
 rpm-packaging/src/conf/logback.xml         |  24 ++++
 rpm-packaging/src/service/brooklyn.service |  33 +++++
 18 files changed, 623 insertions(+), 247 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/deb-packaging/pom.xml
----------------------------------------------------------------------
diff --git a/deb-packaging/pom.xml b/deb-packaging/pom.xml
new file mode 100644
index 0000000..566f93a
--- /dev/null
+++ b/deb-packaging/pom.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>deb-packaging</artifactId>
+    <name>Brooklyn DEB Package</name>
+    <description>
+        Brooklyn DEB Package for Debian and Ubuntu operating systems
+    </description>
+
+    <parent>
+        <groupId>org.apache.brooklyn</groupId>
+        <artifactId>brooklyn-dist-root</artifactId>
+        <version>0.10.0-SNAPSHOT</version>  <!-- BROOKLYN_VERSION -->
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.brooklyn</groupId>
+            <artifactId>brooklyn-dist</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>jdeb</artifactId>
+                <groupId>org.vafer</groupId>
+                <version>1.5</version>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>jdeb</goal>
+                        </goals>
+                        <configuration>
+                            <verbose>true</verbose>
+                            <deb>target/apache-brooklyn_${project.version}_all.deb</deb>
+                            <controlDir>${basedir}/src/deb/control</controlDir>
+                            <dataSet>
+                                <data>
+                                    <src>../dist/target/brooklyn-dist</src>
+                                    <type>directory</type>
+                                    <mapper>
+                                        <type>perm</type>
+                                        <prefix>/opt</prefix>
+                                        <user>brooklyn</user>
+                                        <group>brooklyn</group>
+                                    </mapper>
+                                </data>
+                                <data>
+                                    <src>${basedir}/src/deb/init.d/brooklyn</src>
+                                    <type>file</type>
+                                    <mapper>
+                                        <type>perm</type>
+                                        <prefix>/etc/init.d</prefix>
+                                        <filemode>755</filemode>
+                                    </mapper>
+                                </data>
+                                <data>
+                                    <type>template</type>
+                                    <paths>
+                                        <path>etc/brooklyn</path>
+                                        <path>var/lib/brooklyn</path>
+                                        <path>var/log/brooklyn</path>
+                                    </paths>
+                                    <mapper>
+                                        <type>perm</type>
+                                        <user>brooklyn</user>
+                                        <group>brooklyn</group>
+                                    </mapper>
+                                </data>
+                                <data>
+                                    <src>${basedir}/src/conf/brooklyn.conf</src>
+                                    <type>file</type>
+                                    <conffile>true</conffile>
+                                    <mapper>
+                                        <type>perm</type>
+                                        <prefix>/etc/brooklyn</prefix>
+                                        <user>brooklyn</user>
+                                        <group>brooklyn</group>
+                                        <filemode>600</filemode>
+                                    </mapper>
+                                </data>
+                                <data>
+                                    <src>${basedir}/src/conf/logback.xml</src>
+                                    <type>file</type>
+                                    <conffile>true</conffile>
+                                    <mapper>
+                                        <type>perm</type>
+                                        <prefix>/etc/brooklyn</prefix>
+                                        <user>brooklyn</user>
+                                        <group>brooklyn</group>
+                                        <filemode>644</filemode>
+                                    </mapper>
+                                </data>
+                            </dataSet>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/deb-packaging/src/conf/brooklyn.conf
----------------------------------------------------------------------
diff --git a/deb-packaging/src/conf/brooklyn.conf b/deb-packaging/src/conf/brooklyn.conf
new file mode 100644
index 0000000..3fe950c
--- /dev/null
+++ b/deb-packaging/src/conf/brooklyn.conf
@@ -0,0 +1,26 @@
+# 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.
+
+##################################  Welcome!  ############################################
+
+# It's great to have you here.
+# Documentation is available at https://brooklyn.apache.org/documentation/index.html
+##########################################################################################
+
+brooklyn.base.dir=/var/lib/brooklyn/
+brooklyn.persistence.dir=data
+brooklyn.persistence.backups.dir=backups

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/deb-packaging/src/conf/logback.xml
----------------------------------------------------------------------
diff --git a/deb-packaging/src/conf/logback.xml b/deb-packaging/src/conf/logback.xml
new file mode 100644
index 0000000..00e8001
--- /dev/null
+++ b/deb-packaging/src/conf/logback.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<configuration>
+    <property name="logging.basename" scope="context" value="brooklyn" />
+    <property name="logging.dir" scope="context" value="/var/log/brooklyn/" />
+    <include resource="logback-main.xml"/>
+</configuration>

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/deb-packaging/src/deb/control/control
----------------------------------------------------------------------
diff --git a/deb-packaging/src/deb/control/control b/deb-packaging/src/deb/control/control
new file mode 100644
index 0000000..1729a36
--- /dev/null
+++ b/deb-packaging/src/deb/control/control
@@ -0,0 +1,24 @@
+# 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.
+Package: apache-brooklyn
+Version: [[version]]
+Section: misc
+Priority: optional
+Architecture: all
+Depends: jdk (>= 1.7)
+Maintainer: Aleksandr Vasilev <al...@cloudsoftcorp.com>
+Description: Apache Brooklyn is a framework for modeling, monitoring, and managing applications through autonomic blueprints.

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/deb-packaging/src/deb/control/postinst
----------------------------------------------------------------------
diff --git a/deb-packaging/src/deb/control/postinst b/deb-packaging/src/deb/control/postinst
new file mode 100644
index 0000000..657467a
--- /dev/null
+++ b/deb-packaging/src/deb/control/postinst
@@ -0,0 +1,20 @@
+#!/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.
+/usr/sbin/update-rc.d -f brooklyn defaults
+/usr/sbin/update-rc.d brooklyn enable
+service brooklyn start

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/deb-packaging/src/deb/control/postrm
----------------------------------------------------------------------
diff --git a/deb-packaging/src/deb/control/postrm b/deb-packaging/src/deb/control/postrm
new file mode 100644
index 0000000..55360bd
--- /dev/null
+++ b/deb-packaging/src/deb/control/postrm
@@ -0,0 +1,18 @@
+#!/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.
+/usr/sbin/userdel brooklyn

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/deb-packaging/src/deb/control/preinst
----------------------------------------------------------------------
diff --git a/deb-packaging/src/deb/control/preinst b/deb-packaging/src/deb/control/preinst
new file mode 100644
index 0000000..81f1c87
--- /dev/null
+++ b/deb-packaging/src/deb/control/preinst
@@ -0,0 +1,19 @@
+#!/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.
+/usr/bin/getent group brooklyn || /usr/sbin/groupadd -r brooklyn
+/usr/bin/getent passwd brooklyn || /usr/sbin/useradd -r -g brooklyn -d /opt/brooklyn -s /bin/false brooklyn

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/deb-packaging/src/deb/control/prerm
----------------------------------------------------------------------
diff --git a/deb-packaging/src/deb/control/prerm b/deb-packaging/src/deb/control/prerm
new file mode 100644
index 0000000..69d5fff
--- /dev/null
+++ b/deb-packaging/src/deb/control/prerm
@@ -0,0 +1,18 @@
+#!/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.
+service brooklyn stop

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/deb-packaging/src/deb/init.d/brooklyn
----------------------------------------------------------------------
diff --git a/deb-packaging/src/deb/init.d/brooklyn b/deb-packaging/src/deb/init.d/brooklyn
new file mode 100644
index 0000000..99c7d12
--- /dev/null
+++ b/deb-packaging/src/deb/init.d/brooklyn
@@ -0,0 +1,93 @@
+#!/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.
+
+### BEGIN INIT INFO
+# Provides:          brooklyn
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Apache Brooklyn
+# Description:       Apache Brooklyn init script
+### END INIT INFO
+
+# Author: Aleksandr Vasilev <al...@cloudsoftcorp.com>
+
+[ -d /opt/brooklyn ] || exit 0
+
+SERVICE_NAME="brooklyn"
+PID_FILE="/var/lib/${SERVICE_NAME}/${SERVICE_NAME}.pid"
+LOG_FILE="/var/log/brooklyn/service.log"
+JAVA_OPTS="-Dbrooklyn.location.localhost.address=127.0.0.1 -Dlogback.configurationFile=/etc/${SERVICE_NAME}/logback.xml -Xms256m -Xmx1g -XX:MaxPermSize=256m"
+CLASSPATH="/opt/${SERVICE_NAME}/conf:/opt/${SERVICE_NAME}/lib/patch/*:/opt/${SERVICE_NAME}/lib/${SERVICE_NAME}/*:/opt/${SERVICE_NAME}/lib/dropins/*"
+EXEC_START="/usr/bin/java $JAVA_OPTS -cp "$CLASSPATH" org.apache.brooklyn.cli.Main launch --noGlobalBrooklynProperties --localBrooklynProperties /etc/brooklyn/brooklyn.conf --persist auto"
+
+do_start() {
+    if [ -f ${PID_FILE} ] && kill -0 $(cat ${PID_FILE}) > /dev/null 2>&1; then
+        echo "${SERVICE_NAME} is running, pid $(cat ${PID_FILE})"
+        exit 1
+    else
+        nohup ${EXEC_START} >> ${LOG_FILE} 2>&1 &
+        if [ $? -eq 0 ]; then
+            PID=$!
+            echo ${PID} > ${PID_FILE}
+            echo "${SERVICE_NAME} started, pid ${PID}"
+        else
+            echo "${SERVICE_NAME} failed to start, exiting..."
+            exit 1
+        fi
+    fi
+}
+
+do_stop() {
+    if [ ! -f ${PID_FILE} ] || ! kill -0 $(cat ${PID_FILE}) > /dev/null 2>&1; then
+        echo "${SERVICE_NAME} is not running"
+        exit 1
+    else
+        kill $(cat ${PID_FILE}) && rm -f ${PID_FILE}
+        echo "${SERVICE_NAME} stopped"
+    fi
+}
+
+do_status() {
+    if [ -f ${PID_FILE} ] && kill -0 $(cat ${PID_FILE}) > /dev/null 2>&1; then
+        echo "${SERVICE_NAME} is running, pid $(cat ${PID_FILE})"
+    else
+        echo "${SERVICE_NAME} is not running"
+    fi
+}
+
+case $1 in
+    start)
+        do_start
+    ;;
+    stop)
+        do_stop
+    ;;
+    restart|force-reload)
+        do_stop
+        do_start
+    ;;
+    status)
+        do_status
+    ;;
+    *)
+        echo $"Usage: $0 {start|stop|restart|status}"
+        exit 1
+esac

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/packaging/pom.xml
----------------------------------------------------------------------
diff --git a/packaging/pom.xml b/packaging/pom.xml
deleted file mode 100644
index 7c51c67..0000000
--- a/packaging/pom.xml
+++ /dev/null
@@ -1,163 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    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/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <packaging>pom</packaging>
-    <artifactId>brooklyn-packaging</artifactId>
-    <name>Brooklyn RPM Package</name>
-    <description>
-        Brooklyn RPM Package for Centos 7 and RHEL 7 operating systems
-    </description>
-
-    <parent>
-        <groupId>org.apache.brooklyn</groupId>
-        <artifactId>brooklyn-dist-root</artifactId>
-        <version>0.10.0-SNAPSHOT</version>  <!-- BROOKLYN_VERSION -->
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-dist</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>rpm-maven-plugin</artifactId>
-                <version>2.1.5</version>
-                <executions>
-                    <execution>
-                        <id>generate-rpm</id>
-                        <goals>
-                            <goal>attached-rpm</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <name>apache-brooklyn</name>
-                    <license>ASL 2.0</license>
-                    <group>Applications/Internet</group>
-                    <changelogFile><!--TODO--></changelogFile>
-                    <needarch>noarch</needarch>
-                    <targetOS>Linux</targetOS>
-                    <requires>
-                        <require>java</require>
-                    </requires>
-                    <defineStatements>
-                        <defineStatement>_binaries_in_noarch_packages_terminate_build 0</defineStatement>
-                    </defineStatements>
-                    <mappings>
-                        <mapping>
-                            <directory>/etc/brooklyn</directory>
-                            <configuration>true</configuration>
-                            <sources>
-                                <source>
-                                    <location>src/conf</location>
-                                </source>
-                            </sources>
-                        </mapping>
-                        <mapping>
-                            <directory>/etc/brooklyn</directory>
-                            <configuration>true</configuration>
-                            <filemode>600</filemode>
-                            <username>brooklyn</username>
-                            <groupname>brooklyn</groupname>
-                            <sources>
-                                <source>
-                                    <location>src/conf/brooklyn.conf</location>
-                                </source>
-                            </sources>
-                        </mapping>
-                        <mapping>
-                            <directory>/etc/brooklyn</directory>
-                            <configuration>true</configuration>
-                            <filemode>644</filemode>
-                            <username>brooklyn</username>
-                            <groupname>brooklyn</groupname>
-                            <sources>
-                                <source>
-                                    <location>src/conf/logback.xml</location>
-                                </source>
-                            </sources>
-                        </mapping>
-                        <mapping>
-                            <directory>/opt/brooklyn</directory>
-                            <filemode>755</filemode>
-                            <username>brooklyn</username>
-                            <groupname>brooklyn</groupname>
-                            <sources>
-                                <source>
-                                    <location>../dist/target/brooklyn-dist/brooklyn</location>
-                                </source>
-                            </sources>
-                        </mapping>
-                        <mapping>
-                            <directory>/var/lib/brooklyn</directory>
-                            <configuration>true</configuration>
-                            <filemode>755</filemode>
-                            <username>brooklyn</username>
-                            <groupname>brooklyn</groupname>
-                        </mapping>
-                        <mapping>
-                            <directory>/var/log/brooklyn</directory>
-                            <configuration>true</configuration>
-                            <filemode>700</filemode>
-                            <username>brooklyn</username>
-                            <groupname>brooklyn</groupname>
-                        </mapping>
-                        <mapping>
-                            <directory>/etc/systemd/system/multi-user.target.wants</directory>
-                            <filemode>755</filemode>
-                            <username>root</username>
-                            <groupname>root</groupname>
-                            <sources>
-                                <source>
-                                    <location>src/service</location>
-                                </source>
-                            </sources>
-                        </mapping>
-                    </mappings>
-                    <preinstallScriptlet>
-                        <script>
-                            /bin/getent group brooklyn || /sbin/groupadd -r brooklyn
-                            /bin/getent passwd brooklyn || /sbin/useradd -r -g brooklyn -d /opt/brooklyn -s /sbin/nologin brooklyn
-                        </script>
-                    </preinstallScriptlet>
-                    <postinstallScriptlet>
-                        <script>
-                            /bin/systemctl daemon-reload
-                            /bin/systemctl start brooklyn.service
-                        </script>
-                    </postinstallScriptlet>
-                    <preremoveScriptlet>
-                        <script>/bin/systemctl stop brooklyn.service</script>
-                    </preremoveScriptlet>
-                    <postremoveScriptlet>
-                        <script>/sbin/userdel brooklyn</script>
-                    </postremoveScriptlet>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/packaging/src/conf/brooklyn.conf
----------------------------------------------------------------------
diff --git a/packaging/src/conf/brooklyn.conf b/packaging/src/conf/brooklyn.conf
deleted file mode 100644
index 3fe950c..0000000
--- a/packaging/src/conf/brooklyn.conf
+++ /dev/null
@@ -1,26 +0,0 @@
-# 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.
-
-##################################  Welcome!  ############################################
-
-# It's great to have you here.
-# Documentation is available at https://brooklyn.apache.org/documentation/index.html
-##########################################################################################
-
-brooklyn.base.dir=/var/lib/brooklyn/
-brooklyn.persistence.dir=data
-brooklyn.persistence.backups.dir=backups

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/packaging/src/conf/logback.xml
----------------------------------------------------------------------
diff --git a/packaging/src/conf/logback.xml b/packaging/src/conf/logback.xml
deleted file mode 100644
index 00e8001..0000000
--- a/packaging/src/conf/logback.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    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.
--->
-<configuration>
-    <property name="logging.basename" scope="context" value="brooklyn" />
-    <property name="logging.dir" scope="context" value="/var/log/brooklyn/" />
-    <include resource="logback-main.xml"/>
-</configuration>

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/packaging/src/service/brooklyn.service
----------------------------------------------------------------------
diff --git a/packaging/src/service/brooklyn.service b/packaging/src/service/brooklyn.service
deleted file mode 100644
index 5986555..0000000
--- a/packaging/src/service/brooklyn.service
+++ /dev/null
@@ -1,33 +0,0 @@
-# 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.
-
-[Unit]
-Description=Apache Brooklyn Service
-Documentation=https://brooklyn.apache.org/documentation/index.html
-
-[Service]
-Type=simple
-WorkingDirectory=/opt/brooklyn/
-Environment="JAVA_OPTS=-Dbrooklyn.location.localhost.address=127.0.0.1 -Dlogback.configurationFile=/etc/brooklyn/logback.xml -Xms256m -Xmx1g -XX:MaxPermSize=256m"
-Environment="CLASSPATH=/opt/brooklyn/conf:/opt/brooklyn/lib/patch/*:/opt/brooklyn/lib/brooklyn/*:/opt/brooklyn/lib/dropins/*"
-ExecStart=/usr/bin/java $JAVA_OPTS -cp "$CLASSPATH" org.apache.brooklyn.cli.Main launch --noGlobalBrooklynProperties --localBrooklynProperties /etc/brooklyn/brooklyn.conf --persist auto
-Restart=always
-User=brooklyn
-Group=brooklyn
-
-[Install]
-WantedBy=multi-user.target

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 494ba7d..bd8bc94 100644
--- a/pom.xml
+++ b/pom.xml
@@ -97,7 +97,19 @@
                 </property>
             </activation>
             <modules>
-                <module>packaging</module>
+                <module>rpm-packaging</module>
+            </modules>
+        </profile>
+        <profile>
+            <!-- skip the DEB build by setting -Dno-deb - useful if Debian tools are not available -->
+            <id>deb-module</id>
+            <activation>
+                <property>
+                    <name>!no-deb</name>
+                </property>
+            </activation>
+            <modules>
+                <module>deb-packaging</module>
             </modules>
         </profile>
     </profiles>

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/rpm-packaging/pom.xml
----------------------------------------------------------------------
diff --git a/rpm-packaging/pom.xml b/rpm-packaging/pom.xml
new file mode 100644
index 0000000..26c7ef9
--- /dev/null
+++ b/rpm-packaging/pom.xml
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>pom</packaging>
+    <artifactId>rpm-packaging</artifactId>
+    <name>Brooklyn RPM Package</name>
+    <description>
+        Brooklyn RPM Package for Centos 7 and RHEL 7 operating systems
+    </description>
+
+    <parent>
+        <groupId>org.apache.brooklyn</groupId>
+        <artifactId>brooklyn-dist-root</artifactId>
+        <version>0.10.0-SNAPSHOT</version>  <!-- BROOKLYN_VERSION -->
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.brooklyn</groupId>
+            <artifactId>brooklyn-dist</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>rpm-maven-plugin</artifactId>
+                <version>2.1.5</version>
+                <executions>
+                    <execution>
+                        <id>generate-rpm</id>
+                        <goals>
+                            <goal>attached-rpm</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <name>apache-brooklyn</name>
+                    <license>ASL 2.0</license>
+                    <group>Applications/Internet</group>
+                    <changelogFile><!--TODO--></changelogFile>
+                    <needarch>noarch</needarch>
+                    <targetOS>Linux</targetOS>
+                    <requires>
+                        <require>java</require>
+                    </requires>
+                    <defineStatements>
+                        <defineStatement>_binaries_in_noarch_packages_terminate_build 0</defineStatement>
+                    </defineStatements>
+                    <mappings>
+                        <mapping>
+                            <directory>/etc/brooklyn</directory>
+                            <configuration>true</configuration>
+                            <sources>
+                                <source>
+                                    <location>src/conf</location>
+                                </source>
+                            </sources>
+                        </mapping>
+                        <mapping>
+                            <directory>/etc/brooklyn</directory>
+                            <configuration>true</configuration>
+                            <filemode>600</filemode>
+                            <username>brooklyn</username>
+                            <groupname>brooklyn</groupname>
+                            <sources>
+                                <source>
+                                    <location>src/conf/brooklyn.conf</location>
+                                </source>
+                            </sources>
+                        </mapping>
+                        <mapping>
+                            <directory>/etc/brooklyn</directory>
+                            <configuration>true</configuration>
+                            <filemode>644</filemode>
+                            <username>brooklyn</username>
+                            <groupname>brooklyn</groupname>
+                            <sources>
+                                <source>
+                                    <location>src/conf/logback.xml</location>
+                                </source>
+                            </sources>
+                        </mapping>
+                        <mapping>
+                            <directory>/opt/brooklyn</directory>
+                            <filemode>755</filemode>
+                            <username>brooklyn</username>
+                            <groupname>brooklyn</groupname>
+                            <sources>
+                                <source>
+                                    <location>../dist/target/brooklyn-dist/brooklyn</location>
+                                </source>
+                            </sources>
+                        </mapping>
+                        <mapping>
+                            <directory>/var/lib/brooklyn</directory>
+                            <configuration>true</configuration>
+                            <filemode>755</filemode>
+                            <username>brooklyn</username>
+                            <groupname>brooklyn</groupname>
+                        </mapping>
+                        <mapping>
+                            <directory>/var/log/brooklyn</directory>
+                            <configuration>true</configuration>
+                            <filemode>700</filemode>
+                            <username>brooklyn</username>
+                            <groupname>brooklyn</groupname>
+                        </mapping>
+                        <mapping>
+                            <directory>/etc/systemd/system/multi-user.target.wants</directory>
+                            <filemode>755</filemode>
+                            <username>root</username>
+                            <groupname>root</groupname>
+                            <sources>
+                                <source>
+                                    <location>src/service</location>
+                                </source>
+                            </sources>
+                        </mapping>
+                    </mappings>
+                    <preinstallScriptlet>
+                        <script>
+                            /bin/getent group brooklyn || /sbin/groupadd -r brooklyn
+                            /bin/getent passwd brooklyn || /sbin/useradd -r -g brooklyn -d /opt/brooklyn -s /sbin/nologin brooklyn
+                        </script>
+                    </preinstallScriptlet>
+                    <postinstallScriptlet>
+                        <script>
+                            /bin/systemctl daemon-reload
+                            /bin/systemctl start brooklyn.service
+                        </script>
+                    </postinstallScriptlet>
+                    <preremoveScriptlet>
+                        <script>/bin/systemctl stop brooklyn.service</script>
+                    </preremoveScriptlet>
+                    <postremoveScriptlet>
+                        <script>/sbin/userdel brooklyn</script>
+                    </postremoveScriptlet>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/rpm-packaging/src/conf/brooklyn.conf
----------------------------------------------------------------------
diff --git a/rpm-packaging/src/conf/brooklyn.conf b/rpm-packaging/src/conf/brooklyn.conf
new file mode 100644
index 0000000..3fe950c
--- /dev/null
+++ b/rpm-packaging/src/conf/brooklyn.conf
@@ -0,0 +1,26 @@
+# 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.
+
+##################################  Welcome!  ############################################
+
+# It's great to have you here.
+# Documentation is available at https://brooklyn.apache.org/documentation/index.html
+##########################################################################################
+
+brooklyn.base.dir=/var/lib/brooklyn/
+brooklyn.persistence.dir=data
+brooklyn.persistence.backups.dir=backups

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/rpm-packaging/src/conf/logback.xml
----------------------------------------------------------------------
diff --git a/rpm-packaging/src/conf/logback.xml b/rpm-packaging/src/conf/logback.xml
new file mode 100644
index 0000000..00e8001
--- /dev/null
+++ b/rpm-packaging/src/conf/logback.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<configuration>
+    <property name="logging.basename" scope="context" value="brooklyn" />
+    <property name="logging.dir" scope="context" value="/var/log/brooklyn/" />
+    <include resource="logback-main.xml"/>
+</configuration>

http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/d1b541ab/rpm-packaging/src/service/brooklyn.service
----------------------------------------------------------------------
diff --git a/rpm-packaging/src/service/brooklyn.service b/rpm-packaging/src/service/brooklyn.service
new file mode 100644
index 0000000..5986555
--- /dev/null
+++ b/rpm-packaging/src/service/brooklyn.service
@@ -0,0 +1,33 @@
+# 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.
+
+[Unit]
+Description=Apache Brooklyn Service
+Documentation=https://brooklyn.apache.org/documentation/index.html
+
+[Service]
+Type=simple
+WorkingDirectory=/opt/brooklyn/
+Environment="JAVA_OPTS=-Dbrooklyn.location.localhost.address=127.0.0.1 -Dlogback.configurationFile=/etc/brooklyn/logback.xml -Xms256m -Xmx1g -XX:MaxPermSize=256m"
+Environment="CLASSPATH=/opt/brooklyn/conf:/opt/brooklyn/lib/patch/*:/opt/brooklyn/lib/brooklyn/*:/opt/brooklyn/lib/dropins/*"
+ExecStart=/usr/bin/java $JAVA_OPTS -cp "$CLASSPATH" org.apache.brooklyn.cli.Main launch --noGlobalBrooklynProperties --localBrooklynProperties /etc/brooklyn/brooklyn.conf --persist auto
+Restart=always
+User=brooklyn
+Group=brooklyn
+
+[Install]
+WantedBy=multi-user.target


[2/2] brooklyn-dist git commit: Closes #28

Posted by sv...@apache.org.
Closes #28

Add Debian packaging


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/commit/299c8cfa
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/tree/299c8cfa
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/diff/299c8cfa

Branch: refs/heads/master
Commit: 299c8cfadfd8925bcf490b5e5a62bb964a8957b8
Parents: f4f0eca d1b541a
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Tue Apr 12 11:34:59 2016 +0300
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Tue Apr 12 11:34:59 2016 +0300

----------------------------------------------------------------------
 deb-packaging/pom.xml                      | 122 ++++++++++++++++++
 deb-packaging/src/conf/brooklyn.conf       |  26 ++++
 deb-packaging/src/conf/logback.xml         |  24 ++++
 deb-packaging/src/deb/control/control      |  24 ++++
 deb-packaging/src/deb/control/postinst     |  20 +++
 deb-packaging/src/deb/control/postrm       |  18 +++
 deb-packaging/src/deb/control/preinst      |  19 +++
 deb-packaging/src/deb/control/prerm        |  18 +++
 deb-packaging/src/deb/init.d/brooklyn      |  93 ++++++++++++++
 packaging/pom.xml                          | 163 ------------------------
 packaging/src/conf/brooklyn.conf           |  26 ----
 packaging/src/conf/logback.xml             |  24 ----
 packaging/src/service/brooklyn.service     |  33 -----
 pom.xml                                    |  14 +-
 rpm-packaging/pom.xml                      | 163 ++++++++++++++++++++++++
 rpm-packaging/src/conf/brooklyn.conf       |  26 ++++
 rpm-packaging/src/conf/logback.xml         |  24 ++++
 rpm-packaging/src/service/brooklyn.service |  33 +++++
 18 files changed, 623 insertions(+), 247 deletions(-)
----------------------------------------------------------------------