Update packaging of rocci-server for jessie (mainly due to changes around apache).
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Wed, 12 Mar 2014 22:42:18 +0000 (23:42 +0100)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Wed, 12 Mar 2014 22:42:18 +0000 (23:42 +0100)
rocci-server/debian/README.Debian
rocci-server/debian/control
rocci-server/debian/passenger-security.conf [deleted file]
rocci-server/debian/rocci-server-apache.apache2 [new file with mode: 0644]
rocci-server/debian/rocci-server-apache.install [deleted file]
rocci-server/debian/rocci-server-apache.postinst
rocci-server/debian/rocci-server-apache.prerm [deleted file]
rocci-server/debian/rocci-server-port.conf [moved from rocci-server/debian/etc/apache2/conf.d/rocci-server with 100% similarity]
rocci-server/debian/rocci-server.install
rocci-server/debian/rocci-server.prerm [deleted file]
rocci-server/debian/rules

index 93e05d5..de4055d 100644 (file)
@@ -7,20 +7,21 @@ https://github.com/sustr4/rOCCI-server/wiki/rOCCI-Server-Admin-Guide
 Security
 ========
 
-Consider disabling user switching in passenger (see passenger-security.conf in
-rocci-server/examples).
+Consider disabling user switching in passenger:
+
+<IfModule mod_passenger.c>
+PassengerUserSwitching off
+</IfModule>
 
 
 Setup
 =====
 
-# Launched automatically:
+Basic setup with dummy backend is done automatically.
+
+Configuration steps manually:
 
-# rocci-server-apache
 a2enmod ssl
 a2ensite occi-ssl
-service apache2 restart
-
-# ruby-passenger
 a2enmod passenger
 service apache2 restart
index a1eeb79..b2ca42a 100644 (file)
@@ -3,7 +3,7 @@ Section: ruby
 Priority: optional
 Maintainer: František Dvořák <valtri@civ.zcu.cz>
 Standards-Version: 3.9.5
-Build-Depends: debhelper (>= 8), gem2deb (>= 0.6.1~)
+Build-Depends: debhelper (>= 8), gem2deb (>= 0.6.1~), dh-apache2
 Vcs-Browser: https://github.com/EGI-FCTF/rOCCI-server
 Vcs-Git: git://github.com/EGI-FCTF/rOCCI-server.git
 XS-Ruby-Versions: ruby1.9.1
@@ -13,7 +13,7 @@ Architecture: all
 XB-Ruby-Versions: ${ruby:Versions}
 Pre-Depends: ${misc:Pre-Depends}, adduser
 # keystones: openssl-cms-1-9-3/openssl-cms-2-0-0
-# opennebula: erubis, opennebula-4.0
+# opennebula: erubis, opennebula-4.4
 Depends: git, memcached, ruby | ruby-interpreter, ruby-dalli, ruby-erubis, ruby-hashie, ruby-ice-nine, ruby-jbuilder (>= 2.0.0), ruby-jbuilder (<< 2.1), ruby-kgio, ruby-nokogiri, ruby-occi-core (>= 4.2.10), ruby-logstasher, ruby-occi-core (<< 4.3), ruby-opennebula-4.4, ruby-openssl-cms-1-9-3, ruby-rails-4.0, ruby-rails-api (>= 0.2.0), ruby-rails-api (<< 0.3), ruby-warden, ruby-whenever, ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends}
 Suggests: rocci-server-apache
 Description: Ruby OCCI Server
diff --git a/rocci-server/debian/passenger-security.conf b/rocci-server/debian/passenger-security.conf
deleted file mode 100644 (file)
index cef1235..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<IfModule mod_passenger.c>
-PassengerUserSwitching off
-</IfModule>
diff --git a/rocci-server/debian/rocci-server-apache.apache2 b/rocci-server/debian/rocci-server-apache.apache2
new file mode 100644 (file)
index 0000000..0c6015b
--- /dev/null
@@ -0,0 +1,2 @@
+conf debian/rocci-server-port.conf
+site debian/occi-ssl.conf
diff --git a/rocci-server/debian/rocci-server-apache.install b/rocci-server/debian/rocci-server-apache.install
deleted file mode 100644 (file)
index e425c1f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-debian/etc     .
-debian/occi-ssl        etc/apache2/sites-available
-debian/passenger-security.conf usr/share/doc/rocci-server/examples/etc/apache2/conf.d
index 17f6c20..c22e698 100644 (file)
@@ -1,14 +1,6 @@
 #!/bin/sh
 set -e
 
-#DEBHELPER#
-
-if [ "$1" != "configure" -a "$1" != "reconfigure" ]; then
-       exit 0
-fi
-
-
-
 reload_apache()
 {
   if apache2ctl configtest 2>/dev/null; then
@@ -19,31 +11,28 @@ reload_apache()
 }
 
 
+if [ "$1" = "configure" -o "$1" = "reconfigure" ]; then
+
 # hostname in configuration
-conf="/etc/apache2/sites-available/occi-ssl"
+conf="/etc/apache2/sites-available/occi-ssl.conf"
 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," \
                $conf
+
 else
        echo "Hostname could not be determined! Please update 'ServerName' and 'ROCCI_SERVER_HOSTNAME' in $conf."
 fi
 
-if [ -n "$2" ]; then
-# we're upgrading. test if we're enabled, and if so, restart to reload the module.
-       if [ -e /etc/apache2/sites-enabled/occi-ssl ]; then
-               reload_apache
-       fi
-       exit 0
 fi
 
 if [ -e /etc/apache2/apache2.conf ]; then
-# enable the site and SSL module
        a2enmod ssl >/dev/null || :
-       a2ensite occi-ssl >/dev/null || :
        reload_apache
 fi
 
+#DEBHELPER#
+
 exit 0
diff --git a/rocci-server/debian/rocci-server-apache.prerm b/rocci-server/debian/rocci-server-apache.prerm
deleted file mode 100644 (file)
index 0c9bd2d..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/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
index ad8262f..03916c5 100644 (file)
@@ -8,8 +8,6 @@ lib     usr/lib/rocci-server
 public usr/lib/rocci-server
 spec   usr/lib/rocci-server
 test   usr/lib/rocci-server
-# XXX: dirty hack - bundle all gems
-vendor usr/lib/rocci-server
 Capfile        usr/lib/rocci-server
 Rakefile       usr/lib/rocci-server
 Gemfile        usr/lib/rocci-server
@@ -17,4 +15,4 @@ Gemfile.lock  usr/lib/rocci-server
 Guardfile      usr/lib/rocci-server
 config.ru      usr/lib/rocci-server
 
-debian/occi-ssl        usr/lib/doc/rocci-server/examples/etc/apache2/sites-available
+debian/occi-ssl.conf   usr/lib/doc/rocci-server/examples/etc/apache2/sites-available
diff --git a/rocci-server/debian/rocci-server.prerm b/rocci-server/debian/rocci-server.prerm
deleted file mode 100644 (file)
index 0c9bd2d..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/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
index d968cef..f082927 100755 (executable)
@@ -10,17 +10,21 @@ binary:
                -e 's,^\(\s*\)#\s*\(PassengerGroup\).*,\1\2 rocci,i' \
                -e 's,^\(\s*\)#\s*\(SetEnv\s*ROCCI_SERVER_LOG_DIR\).*,\1\2 /var/log/rocci-server,i' \
                -e 's,^\(\s*\)#\s*\(PassengerFriendlyErrorPages\).*,\1\2 off,' \
-               > debian/occi-ssl
-       dh $@
+               > debian/occi-ssl.conf
+       dh $@ --buildsystem=ruby --with ruby
+
+override_dh_install:
+       dh_apache2 -procci-server-apache
+       dh_install
 
 override_dh_installdocs:
        dh_installdocs --link-doc=$(p_name)
 
 override_dh_fixperms:
        dh_fixperms
-       chmod 0600 debian/rocci-server-apache/etc/apache2/sites-available/occi-ssl
+       chmod 0600 debian/rocci-server-apache/etc/apache2/sites-available/occi-ssl.conf
 
 %:
-       dh $@ --buildsystem=ruby --with ruby --fail-missing
+       dh $@ --buildsystem=ruby --with ruby
 
-.PHONY: override_dh_installdocs override_dh_fixperms
+.PHONY: binary override_dh_install override_dh_installdocs override_dh_fixperms