debian: Fix the usage server packaging

Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/7a794519
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/7a794519
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/7a794519

Branch: refs/heads/ui-multiple-vlan-ranges
Commit: 7a794519a2703ee35651123862ffd5445df24063
Parents: aee6fc3
Author: Wido den Hollander <[email protected]>
Authored: Tue Mar 12 13:05:44 2013 +0100
Committer: Wido den Hollander <[email protected]>
Committed: Tue Mar 12 14:26:10 2013 +0100

----------------------------------------------------------------------
 debian/cloudstack-usage.install   |    3 ++-
 debian/rules                      |    3 +++
 packaging/debian/init/cloud-usage |   18 +++++++-----------
 usage/pom.xml                     |   18 ++++++++++++++++++
 4 files changed, 30 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7a794519/debian/cloudstack-usage.install
----------------------------------------------------------------------
diff --git a/debian/cloudstack-usage.install b/debian/cloudstack-usage.install
index 53f2a56..4722e68 100644
--- a/debian/cloudstack-usage.install
+++ b/debian/cloudstack-usage.install
@@ -15,7 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
-/usr/share/cloudstack-usage/lib/cloudstack-usage.jar
+/usr/share/cloudstack-usage/lib/*
+/usr/share/cloudstack-usage/plugins
 /etc/init.d/cloudstack-usage
 /var/log/cloudstack/usage
 /etc/cloudstack/usage/*

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7a794519/debian/rules
----------------------------------------------------------------------
diff --git a/debian/rules b/debian/rules
index f0cb67f..0967979 100755
--- a/debian/rules
+++ b/debian/rules
@@ -124,7 +124,10 @@ install:
        # cloudstack-usage
        mkdir $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage
        mkdir $(DESTDIR)/var/log/$(PACKAGE)/usage
+       mkdir $(DESTDIR)/usr/share/$(PACKAGE)-usage
+       mkdir $(DESTDIR)/usr/share/$(PACKAGE)-usage/plugins
        install -D usage/target/cloud-usage-4.2.0-SNAPSHOT.jar 
$(DESTDIR)/usr/share/$(PACKAGE)-usage/lib/$(PACKAGE)-usage.jar
+       install -D usage/target/dependencies/* 
$(DESTDIR)/usr/share/$(PACKAGE)-usage/lib/
        cp usage/target/transformed/* $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage/
        ln -s ../management/db.properties 
$(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage/db.properties
        install -D packaging/debian/init/cloud-usage 
$(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-usage

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7a794519/packaging/debian/init/cloud-usage
----------------------------------------------------------------------
diff --git a/packaging/debian/init/cloud-usage 
b/packaging/debian/init/cloud-usage
index 3421cd1..1cc75cc 100755
--- a/packaging/debian/init/cloud-usage
+++ b/packaging/debian/init/cloud-usage
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 ### BEGIN INIT INFO
-# Provides:          cloud usage
+# Provides:          cloudstack usage
 # Required-Start:    $network $local_fs
 # Required-Stop:     $network $local_fs
 # Default-Start:     3 4 5
@@ -32,17 +32,15 @@
 
 . /lib/lsb/init-functions
 
-SHORTNAME="cloud-usage"
+SHORTNAME="cloudstack-usage"
 PIDFILE=/var/run/"$SHORTNAME".pid
-LOGFILE=/var/log/cloud/usage/usage-server.log
 PROGNAME="CloudStack Usage Monitor"
 CLASS="com.cloud.usage.UsageServer"
 PROG="jsvc"
 DAEMON="/usr/bin/jsvc"
-USER=@MSUSER@
 
 unset OPTIONS
-[ -r @SYSCONFDIR@/default/"$SHORTNAME" ] && source 
@SYSCONFDIR@/default/"$SHORTNAME"
+[ -r /etc/default/"$SHORTNAME" ] && source /etc/default/"$SHORTNAME"
 
 # The first existing directory is used for JAVA_HOME (if JAVA_HOME is not 
defined in $DEFAULT)
 JDK_DIRS="/usr/lib/jvm/java-7-openjdk-amd64 /usr/lib/jvm/java-7-openjdk-i386 
/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-openjdk-i386 
/usr/lib/jvm/java-6-openjdk-amd64 /usr/lib/jvm/java-6-sun"
@@ -54,14 +52,12 @@ for jdir in $JDK_DIRS; do
 done
 export JAVA_HOME
 
-SCP="@SYSTEMCLASSPATH@"
-DCP="@DEPSCLASSPATH@"
-UCP="@USAGECLASSPATH@"
-JCP="/usr/share/java/commons-daemon.jar"
+UCP=`ls /usr/share/cloudstack-usage/lib/*.jar | tr '\n' ':' | sed s'/.$//'`
+PCP=`ls /usr/share/cloudstack-usage/plugins/*.jar 2>/dev/null | tr '\n' ':' | 
sed s'/.$//'`
 
 # We need to append the JSVC daemon JAR to the classpath
 # AgentShell implements the JSVC daemon methods
-export CLASSPATH="$SCP:$DCP:$UCP:$JCP:@USAGESYSCONFDIR@"
+export 
CLASSPATH="/usr/share/java/commons-daemon.jar:$UCP:$PCP:/etc/cloudstack/usage"
 
 start() {
     if [ -s "$PIDFILE" ] && kill -0 $(cat "$PIDFILE") >/dev/null 2>&1; then
@@ -79,7 +75,7 @@ start() {
         exit 1
     fi
 
-    if start_daemon -p $PIDFILE $DAEMON -cp "$CLASSPATH" -pidfile "$PIDFILE" 
-user "$USER" -outfile SYSLOG -errfile SYSLOG -Dpid=$$ $CLASS
+    if start_daemon -p $PIDFILE $DAEMON -cp "$CLASSPATH" -pidfile "$PIDFILE" 
-outfile SYSLOG -errfile SYSLOG -Dpid=$$ $CLASS
         RETVAL=$?
     then
         rc=0

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7a794519/usage/pom.xml
----------------------------------------------------------------------
diff --git a/usage/pom.xml b/usage/pom.xml
index 28ab1a7..31df358 100644
--- a/usage/pom.xml
+++ b/usage/pom.xml
@@ -127,6 +127,24 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>2.5.1</version>
+        <executions>
+          <execution>
+            <id>copy-dependencies</id>
+            <phase>package</phase>
+            <goals>
+              <goal>copy-dependencies</goal>
+            </goals>
+            <configuration>
+              
<outputDirectory>${project.build.directory}/dependencies</outputDirectory>
+              <includeScope>runtime</includeScope>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
   <profiles>

Reply via email to