synced and improved Debian and Univention packaging
authorLars Kneschke <l.kneschke@metaways.de>
Fri, 20 Jul 2012 05:16:00 +0000 (07:16 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 20 Jul 2012 08:24:29 +0000 (10:24 +0200)
Change-Id: I5b66dd6c251abdf4bb79e82444ea462499c43baa
Reviewed-on: https://gerrit.tine20.org/tine20/833
Tested-by: jenkins user
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
30 files changed:
scripts/packaging/Univention/debian/changelog
scripts/packaging/Univention/debian/control
scripts/packaging/Univention/debian/etc/apache.conf
scripts/packaging/Univention/debian/rules
scripts/packaging/Univention/debian/tine20-courses.install [new file with mode: 0644]
scripts/packaging/Univention/debian/tine20-tinebase.postinst
scripts/packaging/Univention/debian/tine20-tinebase.postrm
scripts/packaging/Univention/debian/tine20-tinebase.univention-config-registry [deleted file]
scripts/packaging/Univention/debian/tine20-webstack.postinst
scripts/packaging/Univention/debian/tine20.postinst
scripts/packaging/Univention/debian/tine20.postrm
scripts/packaging/Univention/debian/tine204ucs-webstack.install [deleted file]
scripts/packaging/build-tine20-packages.sh
scripts/packaging/debian/control
scripts/packaging/debian/copyright
scripts/packaging/debian/rules
scripts/packaging/debian/tine20-courses.install [new file with mode: 0644]
scripts/packaging/debian/tine20-tinebase.config [deleted file]
scripts/packaging/debian/tine20-tinebase.cron.d [new file with mode: 0644]
scripts/packaging/debian/tine20-tinebase.postinst
scripts/packaging/debian/tine20-tinebase.postrm
scripts/packaging/debian/tine20-tinebase.prerm [deleted file]
scripts/packaging/debian/tine20-webstack.config [new file with mode: 0644]
scripts/packaging/debian/tine20-webstack.postinst [new file with mode: 0644]
scripts/packaging/debian/tine20-webstack.postrm [moved from scripts/packaging/Univention/70tine204ucs.inst with 55% similarity, mode: 0644]
scripts/packaging/debian/tine20-webstack.templates [new file with mode: 0644]
scripts/packaging/debian/tine20.config [new file with mode: 0644]
scripts/packaging/debian/tine20.postinst [new file with mode: 0644]
scripts/packaging/debian/tine20.postrm [moved from scripts/packaging/Univention/debian/tine204ucs-webstack.postinst with 72% similarity]
scripts/packaging/debian/tine20.templates [moved from scripts/packaging/debian/tine20-tinebase.templates with 50% similarity]

index 9265e8c..79373f4 100644 (file)
@@ -1,5 +1,66 @@
-tine20 (2012.03.2-1) stable; urgency=low
+tine20 (2012.03.5-0) natty; urgency=low
 
   * New upstream release
+  * Closes #6678
 
- -- Lars Kneschke <l.kneschke@metaways.de>  Wed, 04 Apr 2012 10:20:47 +0200
+ -- Philipp Schüle <p.schuele@metaways.de>  Tue, 27 Jun 2012 10:49:13 +0200
+tine20 (2012.03.4-0) natty; urgency=low
+
+  * New upstream release
+
+ -- Philipp Schüle <p.schuele@metaways.de>  Mon, 26 Jun 2012 14:15:12 +0200
+tine20 (2012.03.3-0) natty; urgency=low
+
+  * New upstream release
+
+ -- Lars Kneschke <l.kneschke@metaways.de>  Wed, 24 May 2012 14:16:11 +0200
+tine20 (2012.03.2-0) natty; urgency=low
+
+  * New upstream release
+
+ -- Lars Kneschke <l.kneschke@metaways.de>  Wed, 12 Apr 2012 16:03:41 +0200
+
+tine20 (2012.03.1) natty; urgency=low
+
+  * New upstream release
+
+ -- Lars Kneschke <l.kneschke@metaways.de>  Tue, 06 Mar 2012 10:20:47 +0200
+
+tine20 (2012.03.1~beta2-0) natty; urgency=low
+
+  * New upstream release
+
+ -- Lars Kneschke <l.kneschke@metaways.de>  Mon, 06 Feb 2012 10:20:47 +0200
+
+tine20 (2012.03.1~beta1-0) natty; urgency=low
+
+  * New upstream release
+
+ -- Lars Kneschke <l.kneschke@metaways.de>  Sat, 08 Jan 2012 10:20:47 +0200
+
+tine20 (2011.05.3-1) unstable; urgency=low
+
+  * Initial Debian upload (Closes: #634940)
+
+ -- Lars Kneschke <l.kneschke@metaways.de>  Mon, 15 Aug 2011 10:20:59 +0200
+
+tine20 (2011.05.3-0) natty; urgency=low
+
+  * New upstream release
+
+ -- Lars Kneschke <l.kneschke@metaways.de>  Fri, 12 Aug 2011 10:20:47 +0200
+
+tine20 (2011.05.1-2) natty; urgency=low
+
+  * fixed php5.ini
+
+ -- Lars Kneschke <l.kneschke@metaways.de>  Mon, 20 Jun 2011 12:22:59 +0200
+
+tine20 (2011.05.1-1) natty; urgency=low
+
+  * New upstream release
+
+ -- Lars Kneschke <l.kneschke@metaways.de>  Mon, 20 Jun 2011 12:21:59 +0200
index 384cf8a..851b285 100644 (file)
@@ -10,8 +10,8 @@ Build-Depends: debhelper (>= 8), po-debconf,
  python-support (>= 0.90)
 Standards-Version: 3.9.2
 Homepage: http://www.tine20.org/
-Vcs-Git: http://git.tine20.org/git/tine20/scripts/packaging/Univention/
-Vcs-Browser: http://git.tine20.org/git/tine20/scripts/packaging/Univention/
+Vcs-Git: http://git.tine20.org/git/tine20/scripts/packaging/Univention/debian/
+Vcs-Browser: http://git.tine20.org/git/tine20/scripts/packaging/Univention/debian/
 
 Package: tine20-ucs
 Architecture: all
@@ -32,21 +32,6 @@ Description: Tine 2.0 integration package for Univention Corporate Server
  Integration package for installation and configuration of the Tine 2.0
  groupware solution on Univention Corporate Server.
 
-Package: tine20-webstack
-Architecture: all
-Depends: ${misc:Depends},
- ${tine20:Modules},
- wwwconfig-common, 
- apache2 | lighttpd | nginx,
- libapache2-mod-php5 | php5-fpm, 
- php5-mysql | php5-mysqli, 
- php5-mcrypt, 
- php5-gd,
- makepasswd
-Description: Tine 2.0 integration package for Univention Corporate Server
- Integration package for installation and configuration of the Tine 2.0
- groupware solution on Univention Corporate Server.
-
 Package: tine20
 Architecture: all
 Depends: ${misc:Depends}, 
@@ -71,10 +56,27 @@ Description: webbased groupware and crm - metapackage
   * History
   * PDF export
 
+Package: tine20-webstack
+Architecture: all
+Depends: ${misc:Depends},
+ ${tine20:Modules},
+ wwwconfig-common, 
+ apache2 | lighttpd | nginx,
+ libapache2-mod-php5 | php5-fpm, 
+ php5-mysql | php5-mysqli, 
+ php5-mcrypt, 
+ php5-gd,
+ makepasswd
+Recommends: mysql-client 
+Description: Tine 2.0 integration package for Univention Corporate Server
+ Integration package for installation and configuration of the Tine 2.0
+ groupware solution on Univention Corporate Server.
+
 Package: tine20-tinebase
 Architecture: all
 Depends: ${misc:Depends}, 
- makepasswd
+ makepasswd,
+ php5-cli
 Recommends: php5-ldap
 Description: webbased groupware and crm - core + addressbook module
  This packages contains the core librarys of Tine 2.0 and the addressbook module.
@@ -95,6 +97,13 @@ Description: webbased groupware and crm - calendar module
  This package contains the calendar module of Tine 2.0. Installing this package
  enables you to schedule events for your self and other Tine 2.0 users.
 
+Package: tine20-courses
+Architecture: all
+Depends: tine20-tinebase (= ${binary:Version})
+Description: webbased groupware and crm - courses module
+ This package contains the courses module of Tine 2.0. Installing this package
+ enables you to manage courses. Typically used by schools.
+
 Package: tine20-crm
 Architecture: all
 Depends: tine20-tinebase (= ${binary:Version})
index d3fa9d6..544db40 100644 (file)
@@ -34,8 +34,7 @@ Alias /Microsoft-Server-ActiveSync /usr/share/tine20/Microsoft-Server-ActiveSync
         php_admin_value include_path .:/usr/share/tine20:/usr/share/tine20/library:/etc/tine20
         php_admin_value open_basedir .:/usr/share/tine20:/var/lib/tine20:/tmp:/usr/share/php:/etc/tine20:/var/log/tine20
         php_admin_value session.gc_maxlifetime 86400
-        php_admin_value max_execution_time 90
-        php_admin_value memory_limit 64M
+        php_admin_value memory_limit 128M
         php_admin_value upload_max_filesize 20M
         php_admin_value post_max_size 20M
         php_admin_value safe_mode off
@@ -44,6 +43,7 @@ Alias /Microsoft-Server-ActiveSync /usr/share/tine20/Microsoft-Server-ActiveSync
         php_admin_flag magic_quotes_gpc off
         php_admin_flag magic_quotes_runtime off
         php_admin_flag register_globals off
+        php_value max_execution_time 90
     </IfModule>
     
     <IfModule mod_rewrite.c>
index 0cb7ae3..ff4d628 100755 (executable)
 # under the terms of the GNU Affero General Public License version 3
 # (GNU AGPL V3) as published by the Free Software Foundation.
 #
-# Binary versions of this program provided by Univention to you as
+# Binary versions of this program provided by Metaways to you as
 # well as other copyrighted, protected or trademarked materials like
 # Logos, graphics, fonts, specific documentations and configurations,
 # cryptographic keys etc. are subject to a license agreement between
-# you and Univention and not subject to the GNU AGPL V3.
+# you and Metaways and not subject to the GNU AGPL V3.
 #
 # In the case you use this program under the terms of the GNU AGPL V3,
 # the program is provided in the hope that it will be useful,
@@ -32,7 +32,7 @@
 #export DH_VERBOSE=1
 
 PACKAGES := $(shell dh_listpackages)
-MODULES = $(filter-out ucs ucs-udm webstack,$(patsubst tine20-%,%,$(filter tine20-%,$(PACKAGES))))
+MODULES = $(filter-out ucs ucs-udm webstack courses,$(patsubst tine20-%,%,$(filter tine20-%,$(PACKAGES))))
 
 %:
        dh  $@
@@ -42,7 +42,7 @@ override_dh_installdeb:
        dh_installdeb
        
        # generate list of available subpackages
-       (echo -n "tine20:Modules="; for x in $(MODULES); do echo -n "tine20-$$x,"; done; echo "") >> debian/tine20-webstack.substvars
+       (echo -n "tine20:Modules="; for x in $(MODULES); do echo -n "tine20-$$x (= \$${binary:Version}),"; done; echo "") >> debian/tine20-webstack.substvars
 
 # overwrite dh_fixperms to execute an additional shell script
 override_dh_fixperms:
diff --git a/scripts/packaging/Univention/debian/tine20-courses.install b/scripts/packaging/Univention/debian/tine20-courses.install
new file mode 100644 (file)
index 0000000..94b5147
--- /dev/null
@@ -0,0 +1 @@
+Courses        /usr/share/tine20
index c8c4bb8..61fedb7 100644 (file)
 #!/bin/sh
-#
-# Copyright 2012-2012 by Metaways Infosystems GmbH
-#
-# http://www.metaways.de/
-#
-# All rights reserved.
-#
-# The source code of this program is made available
-# under the terms of the GNU Affero General Public License version 3
-# (GNU AGPL V3) as published by the Free Software Foundation.
-#
-# Binary versions of this program provided by Univention to you as
-# well as other copyrighted, protected or trademarked materials like
-# Logos, graphics, fonts, specific documentations and configurations,
-# cryptographic keys etc. are subject to a license agreement between
-# you and Univention and not subject to the GNU AGPL V3.
-#
-# In the case you use this program under the terms of the GNU AGPL V3,
-# the program is provided in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public
-# License with the Debian GNU/Linux or Univention distribution in file
-# /usr/share/common-licenses/AGPL-3; if not, see
-# <http://www.gnu.org/licenses/>.
 
-#DEBHELPER#
+set -e
 
-. /usr/share/univention-lib/all.sh
+if [ "$1" = "configure" ]; then
 
-fix_permissions() {
+    # fix directory permissions
     for dir in sessions tmp cache files; do
         install -d -m 0750 -o www-data -g www-data /var/lib/tine20/$dir
     done
     
     chown www-data:www-data /var/log/tine20
     chmod 0750 /var/log/tine20    
-}
-
-. /usr/share/debconf/confmodule
-db_version 2.0
-
-if [ "$1" = "configure" ]; then
-
-    # fix directory permissions
-    fix_permissions
-    
-    # set ucr default values
-    univention-config-registry set \
-        tine20/cfg/server/mysql_host?'localhost' \
-        tine20/cfg/server/mysql_port?'3306' \
-        tine20/cfg/server/mysql_user?'tine20' \
-        tine20/cfg/server/mysql_password?'@&@/etc/tine20/mysql.secret@&@' \
-        tine20/cfg/server/mysql_database?'tine20' \
-        tine20/cfg/directory/cache?"/var/lib/tine20/cache" \
-        tine20/cfg/directory/files?"/var/lib/tine20/files" \
-        tine20/cfg/directory/sessions?"/var/lib/tine20/sessions" \
-        tine20/cfg/directory/tmp?"/var/lib/tine20/tmp"
-    
-    # make ucr values available as shell variables
-    eval "$(univention-config-registry shell)"
     
-    # create database if needed
-    mysqlPasswordFile="$(echo $tine20_cfg_server_mysql_password | sed -se 's/@&@//g')"
-    
-    if [ ! -e "$mysqlPasswordFile" -a "$tine20_cfg_server_mysql_host" = "localhost" ]; then
-        touch      "$mysqlPasswordFile"
-        chmod 0600 "$mysqlPasswordFile"
-        chown 0:0  "$mysqlPasswordFile"
-        
-        password=$(makepasswd --minchars=15 --maxchars=20)
-        echo "$password" > "$mysqlPasswordFile"
-    
-        mysqlCmd="mysql --defaults-file=/etc/mysql/debian.cnf"
-        echo "CREATE DATABASE IF NOT EXISTS $tine20_cfg_server_mysql_database;" | $mysqlCmd
-        echo "GRANT ALL ON $tine20_cfg_server_mysql_database.* TO '$tine20_cfg_server_mysql_user'@'localhost' IDENTIFIED BY '$password';" | $mysqlCmd
-    fi
-    
-    # create config.inc.php if needed
-    if [ ! -e /etc/tine20/config.inc.php ] ; then
-        cp /usr/share/doc/tine20-tinebase/examples/config.inc.php.dist /etc/tine20/config.inc.php
-        chmod 0640 /etc/tine20/config.inc.php
-        chown root:www-data /etc/tine20/config.inc.php
-
-        mysqlpassword=$(cat "$mysqlPasswordFile")
-        sed -i -e "s/_DBC_DBSERVER_/$tine20_cfg_server_mysql_host/g"   /etc/tine20/config.inc.php
-        sed -i -e "s/_DBC_DBNAME_/$tine20_cfg_server_mysql_database/g" /etc/tine20/config.inc.php
-        sed -i -e "s/_DBC_DBUSER_/$tine20_cfg_server_mysql_user/g"     /etc/tine20/config.inc.php
-        sed -i -e "s/_DBC_DBPASS_/$mysqlpassword/g"                    /etc/tine20/config.inc.php
-
-        setuppassword=$(makepasswd --minchars=10 --maxchars=15)
-        sed -i -e 's/_SETUPUSERNAME_/tine20setup/g' /etc/tine20/config.inc.php
-        sed -i -e "s/_SETUPPASSWORD_/$setuppassword/g" /etc/tine20/config.inc.php
-    fi
-    
-    ucr commit /var/www/ucs-overview/de.html /var/www/ucs-overview/en.html
-    
-    # setup webserver
-    webservers="apache2"
-    
-    if [ "$webservers" != "" ]; then
-
-        for webserver in $webservers; do
-            webserver=${webserver%,}
-            
-            # check if webserver is installed
-            test -x /usr/sbin/$webserver || continue
-    
-            case "$webserver" in
-                apache2)
-                    if [ -d /etc/apache2/mods-enabled ]; then
-                        if [ ! -f /etc/apache2/mods-enabled/rewrite.load -a ! -h /etc/apache2/mods-enabled/rewrite.load ]; then
-                            /usr/sbin/a2enmod rewrite
-                        fi
-                        if [ ! -f /etc/apache2/mods-enabled/expires.load -a ! -h /etc/apache2/mods-enabled/expires.load ]; then
-                            /usr/sbin/a2enmod expires
-                        fi
-                        if [ -f /etc/apache2/mods-available/php5.load ]; then
-                            if [ ! -f /etc/apache2/mods-enabled/php5.load -a ! -h /etc/apache2/mods-enabled/php5.load ]; then
-                                /usr/sbin/a2enmod php5
-                            fi 
-                        fi
-                    fi
-
-                    # create vhost configuration links
-                    servers="apache2"
-                    linkdestination_apache="../../tine20/apache.conf"
-                    linkname="tine20"
-        
-                    if [ -e /usr/share/wwwconfig-common/confd-link.sh ]; then
-                        . /usr/share/wwwconfig-common/confd-link.sh
-                    fi
-                    
-                    # mark webserver for restart (used by restart.sh)
-                    restart="$restart $webserver"
-                    
-                    ;;
-                
-            esac
-            
-        done
-        
-        # restart webserver
-        if [ -e /usr/share/wwwconfig-common/restart.sh ]; then
-            . /usr/share/wwwconfig-common/restart.sh
-        fi
+    # create link used by PHP when running as (fast)cgi
+    if [ ! -f /etc/php5/conf.d/tine20.ini -a ! -h /etc/php5/conf.d/tine20.ini ]; then
+        ln -s /etc/tine20/php5.ini /etc/php5/conf.d/tine20.ini
     fi
 
 fi
 
-# restart ud listener
-/etc/init.d/univention-directory-listener crestart
-
-exit 0
\ No newline at end of file
+#DEBHELPER#
\ No newline at end of file
index 7e98324..77b4db9 100644 (file)
@@ -1,33 +1,6 @@
 #!/bin/sh
-#
-# Copyright 2012-2012 by Metaways Infosystems GmbH
-#
-# http://www.metaways.de/
-#
-# All rights reserved.
-#
-# The source code of this program is made available
-# under the terms of the GNU Affero General Public License version 3
-# (GNU AGPL V3) as published by the Free Software Foundation.
-#
-# Binary versions of this program provided by Univention to you as
-# well as other copyrighted, protected or trademarked materials like
-# Logos, graphics, fonts, specific documentations and configurations,
-# cryptographic keys etc. are subject to a license agreement between
-# you and Univention and not subject to the GNU AGPL V3.
-#
-# In the case you use this program under the terms of the GNU AGPL V3,
-# the program is provided in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public
-# License with the Debian GNU/Linux or Univention distribution in file
-# /usr/share/common-licenses/AGPL-3; if not, see
-# <http://www.gnu.org/licenses/>.
 
-#DEBHELPER#
+set -e
 
 if [ -f /usr/share/debconf/confmodule ]; then
    . /usr/share/debconf/confmodule
@@ -35,52 +8,11 @@ fi
 
 db_version 2.0
 
-if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
-    webservers="apache2"
-
-    if [ "$webservers" != "" ]; then
-
-        for webserver in $webservers; do
-            webserver=${webserver%,}
-
-            # check if webserver is installed
-            test -x /usr/sbin/$webserver || continue
-    
-            case "$webserver" in
-                apache2)
-                    rm -f /etc/$webserver/conf.d/tine20
-                    
-                    # mark webserver for restart (used by restart.sh)
-                    restart="$restart $webserver"
-                    ;;
-            esac
-        done
-    
-        # restart webserver
-        if [ -e /usr/share/wwwconfig-common/restart.sh ]; then
-            . /usr/share/wwwconfig-common/restart.sh
-        fi
-        
-    fi
-fi
-
 if [ "$1" = "purge" ]; then
     
-    rm -f /etc/tine20/config.inc.php
-    if which ucf >/dev/null 2>&1; then
-        ucf --purge /etc/tine20/config.inc.php
-    fi
     rm -rf /var/lib/tine20
     rm -rf /var/log/tine20
     
 fi
 
-if [ "$1" = "purge" ] && [ -e /usr/share/debconf/confmodule ]; then
-       . /usr/share/debconf/confmodule
-       db_purge
-fi
-
 #DEBHELPER#
-
-exit 0
\ No newline at end of file
diff --git a/scripts/packaging/Univention/debian/tine20-tinebase.univention-config-registry b/scripts/packaging/Univention/debian/tine20-tinebase.univention-config-registry
deleted file mode 100644 (file)
index de37cee..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-Type: module
-Module: tine20-cfg.py
-Variables: tine20/*
-
-Type: multifile
-Multifile: var/www/ucs-overview/de.html
-
-Type: multifile
-Multifile: var/www/ucs-overview/en.html
-
-Type: subfile
-Multifile: var/www/ucs-overview/de.html
-Subfile: var/www/ucs-overview/de.html.d/42tine20-webaccess.html
-
-Type: subfile
-Multifile: var/www/ucs-overview/en.html
-Subfile: var/www/ucs-overview/en.html.d/42tine20-webaccess.html
index 3a48ae6..9465957 100644 (file)
 
 #DEBHELPER#
 
-fix_permissions() {
-    for dir in sessions tmp cache files; do
-        install -d -m 0750 -o www-data -g www-data /var/lib/tine20/$dir
-    done
-    
-    chown www-data:www-data /var/log/tine20
-    chmod 0750 /var/log/tine20    
-}
-
 . /usr/share/debconf/confmodule
 db_version 2.0
 
 if [ "$1" = "configure" ]; then
 
-    # fix directory permissions
-    fix_permissions
-    
     # setup webserver
     webservers="apache2"
     
@@ -99,4 +87,4 @@ if [ "$1" = "configure" ]; then
 
 fi
 
-exit 0
\ No newline at end of file
+exit 0
index d9bc6f7..2538dc2 100644 (file)
@@ -46,25 +46,28 @@ if [ "$1" = "configure" ]; then
         echo "$password" > "$mysqlPasswordFile"
     
         mysqlCmd="mysql --defaults-file=/etc/mysql/debian.cnf"
+        
         echo "CREATE DATABASE IF NOT EXISTS tine20;" | $mysqlCmd
         echo "GRANT ALL ON tine20.* TO 'tine20'@'localhost' IDENTIFIED BY '$password';" | $mysqlCmd
     fi
     
     # create config.inc.php if needed
-    if [ ! -e /etc/tine20/config.inc.php ] ; then
-        cp /usr/share/doc/tine20-tinebase/examples/config.inc.php.dist /etc/tine20/config.inc.php
-        chmod 0640 /etc/tine20/config.inc.php
-        chown root:www-data /etc/tine20/config.inc.php
+    tine20ConfigFile="/etc/tine20/config.inc.php"
+    
+    if [ ! -e "$tine20ConfigFile" ] ; then
+        cp /usr/share/doc/tine20-tinebase/examples/config.inc.php.dist "$tine20ConfigFile"
+        chmod 0640       "$tine20ConfigFile"
+        chown 0:www-data "$tine20ConfigFile"
 
         mysqlpassword=$(cat "$mysqlPasswordFile")
-        sed -i -e "s/_DBC_DBSERVER_/localhost/g"    /etc/tine20/config.inc.php
-        sed -i -e "s/_DBC_DBNAME_/tine20/g"         /etc/tine20/config.inc.php
-        sed -i -e "s/_DBC_DBUSER_/tine20/g"         /etc/tine20/config.inc.php
-        sed -i -e "s/_DBC_DBPASS_/$mysqlpassword/g" /etc/tine20/config.inc.php
+        sed -i -e "s/_DBC_DBSERVER_/localhost/g"    "$tine20ConfigFile"
+        sed -i -e "s/_DBC_DBNAME_/tine20/g"         "$tine20ConfigFile"
+        sed -i -e "s/_DBC_DBUSER_/tine20/g"         "$tine20ConfigFile"
+        sed -i -e "s/_DBC_DBPASS_/$mysqlpassword/g" "$tine20ConfigFile"
 
         setuppassword=$(makepasswd --minchars=10 --maxchars=15)
-        sed -i -e 's/_SETUPUSERNAME_/tine20setup/g'    /etc/tine20/config.inc.php
-        sed -i -e "s/_SETUPPASSWORD_/$setuppassword/g" /etc/tine20/config.inc.php
+        sed -i -e 's/_SETUPUSERNAME_/tine20setup/g'    "$tine20ConfigFile"
+        sed -i -e "s/_SETUPPASSWORD_/$setuppassword/g" "$tine20ConfigFile"
     fi
     
 fi
index ce36e55..d01fc19 100644 (file)
@@ -33,6 +33,7 @@ if [ "$1" = "purge" ]; then
     
     if [ -x /usr/bin/mysql ]; then
         mysqlCmd="/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf"
+        
         echo "DROP DATABASE IF EXISTS tine20;" | $mysqlCmd
         echo "REVOKE ALL ON tine20.* FROM 'tine20'@'localhost';" | $mysqlCmd
     fi
diff --git a/scripts/packaging/Univention/debian/tine204ucs-webstack.install b/scripts/packaging/Univention/debian/tine204ucs-webstack.install
deleted file mode 100644 (file)
index cd50f2b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-70tine204ucs.inst usr/lib/univention-install/
\ No newline at end of file
index dfd798a..03e6994 100755 (executable)
@@ -311,8 +311,10 @@ function prepareDebianPackaging()
     
     echo -n "preparing debian packaging directory in $PACKAGEDIR/tine20-$DEBIANVERSION ... "
     
-    (cd $PACKAGEDIR/tine20-$DEBIANVERSION; tar xf ../../../tine20/$RELEASE/tine20-allinone_$RELEASE.tar.bz2)
+    tar -C $PACKAGEDIR/tine20-$DEBIANVERSION -xf $BASEDIR/packages/tine20/$RELEASE/tine20-allinone_$RELEASE.tar.bz2
+    tar -C $PACKAGEDIR/tine20-$DEBIANVERSION -xf $BASEDIR/packages/tine20/$RELEASE/tine20-courses_$RELEASE.tar.bz2
     cp $BASEDIR/packages/tine20/$RELEASE/tine20-allinone_$RELEASE.tar.bz2 $PACKAGEDIR/tine20_$DEBIANVERSION.orig.tar.bz2
+    cp $BASEDIR/packages/tine20/$RELEASE/tine20-courses_$RELEASE.tar.bz2 $PACKAGEDIR/tine20_$DEBIANVERSION.orig-Courses.tar.bz2
     cp -r $BASEDIR/temp/debian $PACKAGEDIR/tine20-$DEBIANVERSION
 
     echo "done"
@@ -331,8 +333,10 @@ function prepareUniventionPackaging()
     
     echo -n "preparing univention packaging directory in $PACKAGEDIR/tine20-$DEBIANVERSION ... "
     
-    (cd $PACKAGEDIR/tine20-$DEBIANVERSION; tar xf ../../../tine20/$RELEASE/tine20-allinone_$RELEASE.tar.bz2)
+    tar -C $PACKAGEDIR/tine20-$DEBIANVERSION -xf $BASEDIR/packages/tine20/$RELEASE/tine20-allinone_$RELEASE.tar.bz2
+    tar -C $PACKAGEDIR/tine20-$DEBIANVERSION -xf $BASEDIR/packages/tine20/$RELEASE/tine20-courses_$RELEASE.tar.bz2
     cp $BASEDIR/packages/tine20/$RELEASE/tine20-allinone_$RELEASE.tar.bz2 $PACKAGEDIR/tine20_$DEBIANVERSION.orig.tar.bz2
+    cp $BASEDIR/packages/tine20/$RELEASE/tine20-courses_$RELEASE.tar.bz2 $PACKAGEDIR/tine20_$DEBIANVERSION.orig-Courses.tar.bz2
     cp -r $BASEDIR/temp/Univention/* $PACKAGEDIR/tine20-$DEBIANVERSION
 
     echo "done"
index 53c0f4d..1f0a759 100644 (file)
@@ -10,8 +10,9 @@ Vcs-Browser: http://git.tine20.org/git/tine20/scripts/packaging/debian/
 
 Package: tine20
 Architecture: all
-Depends: ${misc:Depends}, tine20-tinebase, 
-    ${tine20:Modules}
+Depends: ${misc:Depends}, 
+ tine20-webstack (= ${binary:Version}),
+ mysql-server
 Description: webbased groupware and crm - metapackage
  Tine 2.0 is an open source project which combines groupware and CRM in one
  consistent interface. Tine 2.0 is web-based and optimises collaboration and
@@ -31,21 +32,28 @@ Description: webbased groupware and crm - metapackage
   * History
   * PDF export
 
+Package: tine20-webstack
+Architecture: all
+Depends: ${misc:Depends},
+ ${tine20:Modules},
+ wwwconfig-common, 
+ apache2 | lighttpd | nginx,
+ libapache2-mod-php5 | php5-fpm, 
+ php5-mysql | php5-mysqli, 
+ php5-mcrypt, 
+ php5-gd,
+ makepasswd
+Recommends: mysql-client
+Description: Tine 2.0 integration package for Univention Corporate Server
+ Integration package for installation and configuration of the Tine 2.0
+ groupware solution on Univention Corporate Server.
+
 Package: tine20-tinebase
 Architecture: all
 Depends: ${misc:Depends}, 
-    httpd, 
-    libapache2-mod-php5 | php5 | php5-cgi | php5-fpm, 
-    dbconfig-common, 
-    wwwconfig-common, 
-    php5-mysql | php5-mysqli, 
-    php5-mcrypt, 
-    php5-gd 
-Recommends: mysql-client, 
-    php5-ldap, 
-    apache2 | lighttpd | httpd
-Suggests: mysql-server, 
-    www-browser
+ makepasswd,
+ php5-cli
+Recommends: php5-ldap
 Description: webbased groupware and crm - core + addressbook module
  This packages contains the core librarys of Tine 2.0 and the addressbook module.
  Installing this package enables you to manage user accounts and contacts. Also
@@ -65,6 +73,13 @@ Description: webbased groupware and crm - calendar module
  This package contains the calendar module of Tine 2.0. Installing this package
  enables you to schedule events for your self and other Tine 2.0 users.
 
+Package: tine20-courses
+Architecture: all
+Depends: tine20-tinebase (= ${binary:Version})
+Description: webbased groupware and crm - courses module
+ This package contains the courses module of Tine 2.0. Installing this package
+ enables you to manage courses. Typically used by schools.
+
 Package: tine20-crm
 Architecture: all
 Depends: tine20-tinebase (= ${binary:Version})
index b30c8be..a8da963 100644 (file)
@@ -4,7 +4,7 @@ Upstream-Contact: Lars Kneschke <l.kneschke@metaways.de>
 Source: http://www.tine20.org/download.html
 
 Files: *
-Copyright: Copyright (C) 2007-2011 Metaways Infosystems GmbH
+Copyright: Copyright 2007-2012 by Metaways Infosystems GmbH
 License: AGPL-3.0
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU Affero General Public License as published by
@@ -19,7 +19,7 @@ License: AGPL-3.0
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 Files: library/ExtJS/*
-Copyright: Copyright (c) 2006-2009, Ext JS, LLC
+Copyright: Copyright (C) 2006-2009, Ext JS, LLC
 License: GPL-3.0
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
index 85cbc9f..1c9737d 100755 (executable)
@@ -1,10 +1,38 @@
 #!/usr/bin/make -f
+#
+# Copyright 2012-2012 by Metaways Infosystems GmbH
+#
+# http://www.metaways.de/
+#
+# All rights reserved.
+#
+# The source code of this program is made available
+# under the terms of the GNU Affero General Public License version 3
+# (GNU AGPL V3) as published by the Free Software Foundation.
+#
+# Binary versions of this program provided by Metaways to you as
+# well as other copyrighted, protected or trademarked materials like
+# Logos, graphics, fonts, specific documentations and configurations,
+# cryptographic keys etc. are subject to a license agreement between
+# you and Metaways and not subject to the GNU AGPL V3.
+#
+# In the case you use this program under the terms of the GNU AGPL V3,
+# the program is provided in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public
+# License with the Debian GNU/Linux or Univention distribution in file
+# /usr/share/common-licenses/AGPL-3; if not, see
+# <http://www.gnu.org/licenses/>.
+
 
 # Uncomment this to turn on verbose mode.
-export DH_VERBOSE=1
+#export DH_VERBOSE=1
 
 PACKAGES := $(shell dh_listpackages)
-MODULES = $(filter-out tinebase,$(patsubst tine20-%,%,$(filter tine20-%,$(PACKAGES))))
+MODULES = $(filter-out webstack courses,$(patsubst tine20-%,%,$(filter tine20-%,$(PACKAGES))))
 
 %:
        dh  $@
@@ -14,7 +42,7 @@ override_dh_installdeb:
        dh_installdeb
        
        # generate list of available subpackages
-       (echo -n "tine20:Modules="; for x in $(MODULES); do echo -n "tine20-$$x,"; done; echo "") >> debian/tine20.substvars
+       (echo -n "tine20:Modules="; for x in $(MODULES); do echo -n "tine20-$$x (= \$${binary:Version}),"; done; echo "") >> debian/tine20-webstack.substvars
 
 # overwrite dh_fixperms to execute an additional shell script
 override_dh_fixperms:
diff --git a/scripts/packaging/debian/tine20-courses.install b/scripts/packaging/debian/tine20-courses.install
new file mode 100644 (file)
index 0000000..94b5147
--- /dev/null
@@ -0,0 +1 @@
+Courses        /usr/share/tine20
diff --git a/scripts/packaging/debian/tine20-tinebase.config b/scripts/packaging/debian/tine20-tinebase.config
deleted file mode 100644 (file)
index aa99034..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash 
-
-set -e
-
-# Source debconf library.
-. /usr/share/debconf/confmodule
-db_version 2.0
-
-if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
-    # currently we support mysql only
-    dbc_dbtypes="mysql"
-  
-    . /usr/share/dbconfig-common/dpkg/config
-    if ! dbc_go tine20 $@ ; then
-        echo 'Automatic configuration of database failed!'
-    fi
-fi
-
-db_input high tine20/webserver_type || true
-
-if [ ! -f /etc/tine20/config.inc.php ]; then
-    db_input high tine20/setupuser || true
-    db_input high tine20/setuppasswd || true
-fi
-
-db_go || true
-
diff --git a/scripts/packaging/debian/tine20-tinebase.cron.d b/scripts/packaging/debian/tine20-tinebase.cron.d
new file mode 100644 (file)
index 0000000..ac8d9e1
--- /dev/null
@@ -0,0 +1,4 @@
+SHELL=/bin/sh
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+* * * * *      www-data        /usr/bin/php -f /usr/share/tine20/tine20.php -- --method Tinebase.triggerAsyncEvents
index 6f44ee3..61fedb7 100644 (file)
 
 set -e
 
-fix_permissions() {
+if [ "$1" = "configure" ]; then
+
+    # fix directory permissions
     for dir in sessions tmp cache files; do
         install -d -m 0750 -o www-data -g www-data /var/lib/tine20/$dir
     done
     
     chown www-data:www-data /var/log/tine20
     chmod 0750 /var/log/tine20    
-}
-
-. /usr/share/debconf/confmodule
-db_version 2.0
-
-
-if [ "$1" = "configure" ]; then
-
-    fix_permissions
-    
-    db_get tine20/webserver_type
-    webservers="$RET"
-    
-    if [ "$webservers" != "" ]; then
-    
-        
-
-        for webserver in $webservers; do
-            webserver=${webserver%,}
-            
-            # check if webserver is installed
-            test -x /usr/sbin/$webserver || continue
     
-            case "$webserver" in
-                apache2)
-                    if [ -d /etc/apache2/mods-enabled ]; then
-                        if [ ! -f /etc/apache2/mods-enabled/rewrite.load -a ! -h /etc/apache2/mods-enabled/rewrite.load ]; then
-                            /usr/sbin/a2enmod rewrite
-                        fi
-                        if [ ! -f /etc/apache2/mods-enabled/expires.load -a ! -h /etc/apache2/mods-enabled/expires.load ]; then
-                            /usr/sbin/a2enmod expires
-                        fi
-                        if [ -f /etc/apache2/mods-available/php5.load ]; then
-                            if [ ! -f /etc/apache2/mods-enabled/php5.load -a ! -h /etc/apache2/mods-enabled/php5.load ]; then
-                                /usr/sbin/a2enmod php5
-                            fi 
-                        fi
-                    fi
-
-                    # create vhost configuration links
-                    servers="apache2"
-                    linkdestination_apache="../../tine20/apache.conf"
-                    linkname="tine20"
-        
-                    if [ -e /usr/share/wwwconfig-common/confd-link.sh ]; then
-                        . /usr/share/wwwconfig-common/confd-link.sh
-                    fi
-                    
-                    # mark webserver for restart (used by restart.sh)
-                    restart="$restart $webserver"
-                    
-                    ;;
-                
-                lighttpd)
-
-                    # create vhost configuration links
-                    servers="$webserver"
-                    linkdestination_lighttpd="../../tine20/lighttpd.conf"
-                    linkname="15-tine20.conf"
-        
-                    if [ -e /usr/share/wwwconfig-common/confd-link.sh ]; then
-                        . /usr/share/wwwconfig-common/confd-link.sh
-                    fi
-                    
-                    if [ -d /etc/$webserver/conf-available ]; then
-                        if [ ! -f /etc/$webserver/conf-enabled/10-expire.conf -a ! -h /etc/$webserver/conf-enabled/10-expire.conf ]; then
-                            /usr/sbin/lighttpd-enable-mod expire
-                        fi
-
-                        if [ ! -f /etc/$webserver/conf-enabled/15-tine20.conf -a ! -h /etc/$webserver/conf-enabled/15-tine20.conf ]; then
-                            /usr/sbin/lighttpd-enable-mod tine20
-                        fi
-                    fi
-                    
-                    # mark webserver for restart (used by restart.sh)
-                    restart="$restart $webserver"
-                    
-                    ;;
-            esac
-            
-        done
-        
-        # restart webserver
-        if [ -e /usr/share/wwwconfig-common/restart.sh ]; then
-            . /usr/share/wwwconfig-common/restart.sh
-        fi
-    
-    fi
-
-    if [ ! -e /etc/tine20/config.inc.php ]; then
-        . /usr/share/dbconfig-common/dpkg/postinst
-
-        dbc_generate_include='template:/etc/tine20/config.inc.php'
-        dbc_generate_include_owner='root:www-data'
-        dbc_generate_include_perms='640'
-        dbc_generate_include_args="-U -o template_infile=/usr/share/doc/tine20-tinebase/examples/config.inc.php.dist"
-        
-        dbc_go tine20 $@
-        
-        db_get tine20/setupuser
-        setupuser="$RET"
-        db_reset tine20/setupuser || true
-        
-        db_get tine20/setuppasswd
-        setuppasswd="$RET"
-        db_reset tine20/setuppasswd || true
-        
-        sed -i "s/_SETUPUSERNAME_/$setupuser/"   /etc/tine20/config.inc.php
-        sed -i "s/_SETUPPASSWORD_/$setuppasswd/" /etc/tine20/config.inc.php
-        
-    fi
-
     # create link used by PHP when running as (fast)cgi
     if [ ! -f /etc/php5/conf.d/tine20.ini -a ! -h /etc/php5/conf.d/tine20.ini ]; then
         ln -s /etc/tine20/php5.ini /etc/php5/conf.d/tine20.ini
     fi
 
 fi
+
+#DEBHELPER#
\ No newline at end of file
index 19141f2..77b4db9 100644 (file)
@@ -8,60 +8,11 @@ fi
 
 db_version 2.0
 
-# handle database removal
-if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then 
-    # currently we support mysql only
-    dbc_dbtypes="mysql"
-        
-    . /usr/share/dbconfig-common/dpkg/postrm 
-    dbc_go tine20 $@ 
-fi 
-
-if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
-    db_get tine20/webserver_type
-    webservers="$RET"
-
-    if [ "$webservers" != "" ]; then
-
-        for webserver in $webservers; do
-            webserver=${webserver%,}
-
-            # check if webserver is installed
-            test -x /usr/sbin/$webserver || continue
-    
-            case "$webserver" in
-                apache2)
-                    rm -f /etc/$webserver/conf.d/tine20
-                    
-                    # mark webserver for restart (used by restart.sh)
-                    restart="$restart $webserver"
-                    ;;
-            esac
-        done
-    
-        # restart webserver
-        if [ -e /usr/share/wwwconfig-common/restart.sh ]; then
-            . /usr/share/wwwconfig-common/restart.sh
-        fi
-        
-    fi
-fi
-
 if [ "$1" = "purge" ]; then
     
-    rm -f /etc/tine20/config.inc.php
-    if which ucf >/dev/null 2>&1; then
-        ucf --purge /etc/tine20/config.inc.php
-    fi
     rm -rf /var/lib/tine20
     rm -rf /var/log/tine20
     
 fi
 
-if [ "$1" = "purge" ] && [ -e /usr/share/debconf/confmodule ]; then
-       . /usr/share/debconf/confmodule
-       db_purge
-fi
-
 #DEBHELPER#
diff --git a/scripts/packaging/debian/tine20-tinebase.prerm b/scripts/packaging/debian/tine20-tinebase.prerm
deleted file mode 100644 (file)
index 7fe1305..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-set -e
-#set -x
-
-. /usr/share/debconf/confmodule
-. /usr/share/dbconfig-common/dpkg/prerm.mysql
-if ! dbc_go tine20 $@ ; then
-    echo 'Automatic database removal failed!'
-fi
-
-#DEBHELPER#
diff --git a/scripts/packaging/debian/tine20-webstack.config b/scripts/packaging/debian/tine20-webstack.config
new file mode 100644 (file)
index 0000000..f107dee
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash 
+
+set -e
+
+# Source debconf library.
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+db_input high tine20/webserver_type || true
+
+db_go || true
+
diff --git a/scripts/packaging/debian/tine20-webstack.postinst b/scripts/packaging/debian/tine20-webstack.postinst
new file mode 100644 (file)
index 0000000..37100cf
--- /dev/null
@@ -0,0 +1,117 @@
+#!/bin/sh
+#
+# Copyright 2012-2012 by Metaways Infosystems GmbH
+#
+# http://www.metaways.de/
+#
+# All rights reserved.
+#
+# The source code of this program is made available
+# under the terms of the GNU Affero General Public License version 3
+# (GNU AGPL V3) as published by the Free Software Foundation.
+#
+# Binary versions of this program provided by Univention to you as
+# well as other copyrighted, protected or trademarked materials like
+# Logos, graphics, fonts, specific documentations and configurations,
+# cryptographic keys etc. are subject to a license agreement between
+# you and Univention and not subject to the GNU AGPL V3.
+#
+# In the case you use this program under the terms of the GNU AGPL V3,
+# the program is provided in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public
+# License with the Debian GNU/Linux or Univention distribution in file
+# /usr/share/common-licenses/AGPL-3; if not, see
+# <http://www.gnu.org/licenses/>.
+
+#DEBHELPER#
+
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+if [ "$1" = "configure" ]; then
+
+    # setup webserver
+    db_get tine20/webserver_type
+    webservers="$RET"
+    
+    if [ "$webservers" != "" ]; then
+
+        for webserver in $webservers; do
+            webserver=${webserver%,}
+            
+            # check if webserver is installed
+            test -x /usr/sbin/$webserver || continue
+    
+            case "$webserver" in
+                apache2)
+                    if [ -d /etc/apache2/mods-enabled ]; then
+                        if [ ! -f /etc/apache2/mods-enabled/rewrite.load -a ! -h /etc/apache2/mods-enabled/rewrite.load ]; then
+                            /usr/sbin/a2enmod rewrite
+                        fi
+                        if [ ! -f /etc/apache2/mods-enabled/expires.load -a ! -h /etc/apache2/mods-enabled/expires.load ]; then
+                            /usr/sbin/a2enmod expires
+                        fi
+                        if [ -f /etc/apache2/mods-available/php5.load ]; then
+                            if [ ! -f /etc/apache2/mods-enabled/php5.load -a ! -h /etc/apache2/mods-enabled/php5.load ]; then
+                                /usr/sbin/a2enmod php5
+                            fi 
+                        fi
+                    fi
+
+                    # create vhost configuration links
+                    servers="apache2"
+                    linkdestination_apache="../../tine20/apache.conf"
+                    linkname="tine20"
+        
+                    if [ -e /usr/share/wwwconfig-common/confd-link.sh ]; then
+                        . /usr/share/wwwconfig-common/confd-link.sh
+                    fi
+                    
+                    # mark webserver for restart (used by restart.sh)
+                    restart="$restart $webserver"
+                    
+                    ;;
+                    
+                lighttpd)
+
+                    # create vhost configuration links
+                    servers="$webserver"
+                    linkdestination_lighttpd="../../tine20/lighttpd.conf"
+                    linkname="15-tine20.conf"
+        
+                    if [ -e /usr/share/wwwconfig-common/confd-link.sh ]; then
+                        . /usr/share/wwwconfig-common/confd-link.sh
+                    fi
+                    
+                    if [ -d /etc/$webserver/conf-available ]; then
+                        if [ ! -f /etc/$webserver/conf-enabled/10-expire.conf -a ! -h /etc/$webserver/conf-enabled/10-expire.conf ]; then
+                            /usr/sbin/lighttpd-enable-mod expire
+                        fi
+
+                        if [ ! -f /etc/$webserver/conf-enabled/15-tine20.conf -a ! -h /etc/$webserver/conf-enabled/15-tine20.conf ]; then
+                            /usr/sbin/lighttpd-enable-mod tine20
+                        fi
+                    fi
+                    
+                    # mark webserver for restart (used by restart.sh)
+                    restart="$restart $webserver"
+                    
+                    ;;
+                
+            esac
+            
+        done
+        
+        # restart webserver
+        if [ -e /usr/share/wwwconfig-common/restart.sh ]; then
+            . /usr/share/wwwconfig-common/restart.sh
+        fi
+    fi
+
+fi
+
+exit 0
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
similarity index 55%
rename from scripts/packaging/Univention/70tine204ucs.inst
rename to scripts/packaging/debian/tine20-webstack.postrm
index f2c0c48..6b98bba
@@ -1,7 +1,5 @@
 #!/bin/sh
 #
-# Tine 2.0 for UCS
-#
 # Copyright 2012-2012 by Metaways Infosystems GmbH
 #
 # http://www.metaways.de/
 # /usr/share/common-licenses/AGPL-3; if not, see
 # <http://www.gnu.org/licenses/>.
 
-VERSION=1
+if [ -f /usr/share/debconf/confmodule ]; then
+   . /usr/share/debconf/confmodule
+fi
+
+db_version 2.0
 
-. /usr/share/univention-join/joinscripthelper.lib
-. /usr/share/univention-lib/all.sh
+if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
+    db_get tine20/webserver_type
+    webservers="$RET"
 
-joinscript_init
+    if [ "$webservers" != "" ]; then
 
-eval "$(univention-config-registry shell)"
+        for webserver in $webservers; do
+            webserver=${webserver%,}
 
-# call server password change script
-/usr/lib/univention-server/server_password_change.d/50univention-mail-server prechange
-/usr/lib/univention-server/server_password_change.d/50univention-mail-server postchange
+            # check if webserver is installed
+            test -x /usr/sbin/$webserver || continue
+    
+            case "$webserver" in
+                apache2)
+                    rm -f /etc/$webserver/conf.d/tine20
+                    
+                    # mark webserver for restart (used by restart.sh)
+                    restart="$restart $webserver"
+                    ;;
+            esac
+        done
+    
+        # restart webserver
+        if [ -e /usr/share/wwwconfig-common/restart.sh ]; then
+            . /usr/share/wwwconfig-common/restart.sh
+        fi
+        
+    fi
+fi
 
-joinscript_save_current_version
+#DEBHELPER#
 
-exit 0
+exit 0
\ No newline at end of file
diff --git a/scripts/packaging/debian/tine20-webstack.templates b/scripts/packaging/debian/tine20-webstack.templates
new file mode 100644 (file)
index 0000000..4f479b1
--- /dev/null
@@ -0,0 +1,7 @@
+Template: tine20/webserver_type
+Type: multiselect
+Choices: apache2, lighttpd
+_Description: Web server to reconfigure automatically:
+ If you do not select a web server to reconfigure automatically, Tine 2.0
+ will not be usable until you reconfigure your webserver to enable
+ Tine 2.0.
diff --git a/scripts/packaging/debian/tine20.config b/scripts/packaging/debian/tine20.config
new file mode 100644 (file)
index 0000000..df2d93e
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash 
+
+set -e
+
+# Source debconf library.
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+if [ ! -f /etc/tine20/config.inc.php ]; then
+    db_input high tine20/setupuser || true
+    db_input high tine20/setuppasswd || true
+fi
+
+db_go || true
+
diff --git a/scripts/packaging/debian/tine20.postinst b/scripts/packaging/debian/tine20.postinst
new file mode 100644 (file)
index 0000000..cdc383b
--- /dev/null
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# Copyright 2012-2012 by Metaways Infosystems GmbH
+#
+# http://www.metaways.de/
+#
+# All rights reserved.
+#
+# The source code of this program is made available
+# under the terms of the GNU Affero General Public License version 3
+# (GNU AGPL V3) as published by the Free Software Foundation.
+#
+# Binary versions of this program provided by Univention to you as
+# well as other copyrighted, protected or trademarked materials like
+# Logos, graphics, fonts, specific documentations and configurations,
+# cryptographic keys etc. are subject to a license agreement between
+# you and Univention and not subject to the GNU AGPL V3.
+#
+# In the case you use this program under the terms of the GNU AGPL V3,
+# the program is provided in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public
+# License with the Debian GNU/Linux or Univention distribution in file
+# /usr/share/common-licenses/AGPL-3; if not, see
+# <http://www.gnu.org/licenses/>.
+
+#DEBHELPER#
+
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+if [ "$1" = "configure" ]; then
+
+    # create database if needed
+    mysqlPasswordFile="/etc/tine20/mysql.secret"
+    
+    if [ ! -e "$mysqlPasswordFile" ]; then
+        touch      "$mysqlPasswordFile"
+        chmod 0600 "$mysqlPasswordFile"
+        chown 0:0  "$mysqlPasswordFile"
+        
+        password=$(makepasswd --minchars=15 --maxchars=20)
+        echo "$password" > "$mysqlPasswordFile"
+    
+        mysqlCmd="mysql --defaults-file=/etc/mysql/debian.cnf"
+        
+        echo "CREATE DATABASE IF NOT EXISTS tine20;" | $mysqlCmd
+        echo "GRANT ALL ON tine20.* TO 'tine20'@'localhost' IDENTIFIED BY '$password';" | $mysqlCmd
+    fi
+    
+    # create config.inc.php if needed
+    tine20ConfigFile="/etc/tine20/config.inc.php"
+    
+    if [ ! -e "$tine20ConfigFile" ] ; then
+        cp /usr/share/doc/tine20-tinebase/examples/config.inc.php.dist "$tine20ConfigFile"
+        chmod 0640       "$tine20ConfigFile"
+        chown 0:www-data "$tine20ConfigFile"
+
+        db_get tine20/setupuser
+        setupuser="$RET"
+        db_reset tine20/setupuser || true
+        
+        db_get tine20/setuppasswd
+        setuppassword="$RET"
+        db_reset tine20/setuppasswd || true
+        
+        mysqlpassword=$(cat "$mysqlPasswordFile")
+
+        sed -i -e "s/_DBC_DBSERVER_/localhost/g"       "$tine20ConfigFile"
+        sed -i -e "s/_DBC_DBNAME_/tine20/g"            "$tine20ConfigFile"
+        sed -i -e "s/_DBC_DBUSER_/tine20/g"            "$tine20ConfigFile"
+        sed -i -e "s/_DBC_DBPASS_/$mysqlpassword/g"    "$tine20ConfigFile"
+        sed -i -e "s/_SETUPUSERNAME_/$setupuser/g"     "$tine20ConfigFile"
+        sed -i -e "s/_SETUPPASSWORD_/$setuppassword/g" "$tine20ConfigFile"
+    fi
+    
+fi
+
+exit 0
\ No newline at end of file
 
 #DEBHELPER#
 
-. /usr/share/univention-lib/all.sh
+if [ "$1" = "purge" ]; then
+    
+    if [ -x /usr/bin/mysql ]; then
+        mysqlCmd="/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf"
+        
+        echo "DROP DATABASE IF EXISTS tine20;" | $mysqlCmd
+        echo "REVOKE ALL ON tine20.* FROM 'tine20'@'localhost';" | $mysqlCmd
+    fi
 
-# excecute join script
-call_joinscript 70tine204ucs.inst
-
-# restart listener
-#/etc/init.d/univention-directory-listener crestart
+    rm -f /etc/tine20/config.inc.php
+    if which ucf >/dev/null 2>&1; then
+        ucf --purge /etc/tine20/config.inc.php
+    fi
+    rm -rf /etc/tine20
+    
+fi
 
 exit 0
\ No newline at end of file
@@ -1,11 +1,3 @@
-Template: tine20/webserver_type
-Type: multiselect
-Choices: apache2, lighttpd
-_Description: Web server to reconfigure automatically:
- If you do not select a web server to reconfigure automatically, Tine 2.0
- will not be usable until you reconfigure your webserver to enable
- Tine 2.0.
-
 Template: tine20/setupuser
 Type: string
 Default: tine20setup