rocci-server-apache subpackage for all-in-one installation and setup rOCCI server...
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Sat, 8 Mar 2014 11:20:16 +0000 (12:20 +0100)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Sat, 8 Mar 2014 11:24:48 +0000 (12:24 +0100)
12 files changed:
rocci-server/debian/README.Debian
rocci-server/debian/control
rocci-server/debian/links [deleted file]
rocci-server/debian/rocci-server-apache.install [new file with mode: 0644]
rocci-server/debian/rocci-server-apache.postinst [moved from rocci-server/debian/postinst with 83% similarity]
rocci-server/debian/rocci-server-apache.prerm [moved from rocci-server/debian/prerm with 80% similarity]
rocci-server/debian/rocci-server.dirs [moved from rocci-server/debian/dirs with 100% similarity]
rocci-server/debian/rocci-server.install [moved from rocci-server/debian/install with 88% similarity]
rocci-server/debian/rocci-server.links [new file with mode: 0644]
rocci-server/debian/rocci-server.postinst [new file with mode: 0644]
rocci-server/debian/rocci-server.preinst [moved from rocci-server/debian/preinst with 100% similarity]
rocci-server/debian/rocci-server.prerm [new file with mode: 0644]

index 531be3a..fbdff8d 100644 (file)
@@ -14,7 +14,7 @@ Locations:
 
 Automatically launched setup:
 
-# rocci-server
+# rocci-server-apache
 a2enmod ssl
 a2ensite occi-ssl
 service apache2 restart
index 32ce335..f21a9f6 100644 (file)
@@ -16,7 +16,7 @@ Pre-Depends: ${misc:Pre-Depends}
 Depends:
     bundler, git, memcached, ruby | ruby-interpreter
     ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends}
-Recommends: libapache2-mod-passenger (>= 4.0.29), apache2-mpm-worker
+Suggests: rocci-server-apache
 Description: Ruby OCCI Server
  OCCI (the Open Cloud Computing Interface) is a standard by the Open Grid Forum,
  specifying a protocol and API to perform various remote management tasks in
@@ -24,6 +24,23 @@ Description: Ruby OCCI Server
  natively, with its own OCCI interface. It is based on the rOCCI (Ruby OCCI)
  Framework.
 
+Package: rocci-server-apache
+Architecture: all
+Pre-Depends: ${misc:Pre-Depends}
+Depends:
+    rocci-server (= ${binary:Version}), apache2-mpm-worker,
+    libapache2-mod-passenger (>= 4.0.29),
+    ${misc:Depends}
+Description: Ruby OCCI Server for Apache
+ OCCI (the Open Cloud Computing Interface) is a standard by the Open Grid Forum,
+ specifying a protocol and API to perform various remote management tasks in
+ clouds. The rOCCI-server extends cloud managers, which are not OCCI-compliant
+ natively, with its own OCCI interface. It is based on the rOCCI (Ruby OCCI)
+ Framework.
+ .
+ This package contains configuration files, setup scripts, and dependencies for
+ running rOCCI server in Apache.
+
 Package: rocci-server-dbg
 Architecture: any
 Pre-Depends: ${misc:Pre-Depends}
diff --git a/rocci-server/debian/links b/rocci-server/debian/links
deleted file mode 100644 (file)
index e0b9a01..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# no FHS support, just point /etc/rocci-server to proper place
-usr/lib/rocci-server/etc       etc/rocci-server
diff --git a/rocci-server/debian/rocci-server-apache.install b/rocci-server/debian/rocci-server-apache.install
new file mode 100644 (file)
index 0000000..807238f
--- /dev/null
@@ -0,0 +1,2 @@
+debian/etc     .
+debian/occi-ssl        etc/apache2/sites-available
similarity index 83%
rename from rocci-server/debian/postinst
rename to rocci-server/debian/rocci-server-apache.postinst
index ee48710..17f6c20 100644 (file)
@@ -7,9 +7,6 @@ if [ "$1" != "configure" -a "$1" != "reconfigure" ]; then
        exit 0
 fi
 
-conf="/etc/apache2/sites-available/occi-ssl"
-econf="/etc/apache2/sites-enabled/occi-ssl"
-hname=`hostname -f` || hname=""
 
 
 reload_apache()
@@ -22,11 +19,10 @@ reload_apache()
 }
 
 
-# logs
-chown -R nobody:nogroup /usr/lib/rocci-server/log
-
 # hostname in configuration
-if [ -n "$hname" ]; then
+conf="/etc/apache2/sites-available/occi-ssl"
+hname=`hostname -f`
+if [ $? -eq 0 -a -n "$hname" ]; then
        sed -i \
                -e "s,^\(\s*ServerName\s*\).*,\1$hname," \
                -e "s,^\(\s*SetEnv\s*ROCCI_SERVER_HOSTNAME\s*\).*,\1$hname," \
@@ -37,7 +33,7 @@ fi
 
 if [ -n "$2" ]; then
 # we're upgrading. test if we're enabled, and if so, restart to reload the module.
-       if [ -e "$econf" ]; then
+       if [ -e /etc/apache2/sites-enabled/occi-ssl ]; then
                reload_apache
        fi
        exit 0
similarity index 80%
rename from rocci-server/debian/prerm
rename to rocci-server/debian/rocci-server-apache.prerm
index df1e3e8..0c9bd2d 100644 (file)
@@ -8,7 +8,7 @@ if [ "$1" != "remove" -a "$1" != "purge" ]; then
 fi
 
 if [ -e /etc/apache2/apache2.conf ]; then
-       a2dissite occi-ssl || :
+       a2dissite occi-ssl >/dev/null || :
 fi
 
 exit 0
similarity index 88%
rename from rocci-server/debian/install
rename to rocci-server/debian/rocci-server.install
index 7d4ace1..d447d57 100644 (file)
@@ -19,7 +19,4 @@ Gemfile.lock  usr/lib/rocci-server
 Guardfile      usr/lib/rocci-server
 config.ru      usr/lib/rocci-server
 
-# prepare configuration
-debian/occi-ssl        etc/apache2/sites-available
 debian/occi-ssl        usr/lib/doc/rocci-server/examples/etc/apache2/sites-available
-debian/etc     .
diff --git a/rocci-server/debian/rocci-server.links b/rocci-server/debian/rocci-server.links
new file mode 100644 (file)
index 0000000..0fa1d3c
--- /dev/null
@@ -0,0 +1,3 @@
+# no FHS support, just point to proper places
+usr/lib/rocci-server/etc       etc/rocci-server
+usr/lib/rocci-server/log       var/log/rocci-server
diff --git a/rocci-server/debian/rocci-server.postinst b/rocci-server/debian/rocci-server.postinst
new file mode 100644 (file)
index 0000000..4f2dcef
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+set -e
+
+#DEBHELPER#
+
+if [ "$1" != "configure" -a "$1" != "reconfigure" ]; then
+       exit 0
+fi
+
+# logs
+chown -R nobody:nogroup /usr/lib/rocci-server/log
+
+exit 0
diff --git a/rocci-server/debian/rocci-server.prerm b/rocci-server/debian/rocci-server.prerm
new file mode 100644 (file)
index 0000000..0c9bd2d
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -e
+
+#DEBHELPER#
+
+if [ "$1" != "remove" -a "$1" != "purge" ]; then
+       exit 0
+fi
+
+if [ -e /etc/apache2/apache2.conf ]; then
+       a2dissite occi-ssl >/dev/null || :
+fi
+
+exit 0