[Pkg-tcltk-commits] r1078 - in openacs/tags: . 5.5.1+dfsg-6/debian

geox-guest at alioth.debian.org geox-guest at alioth.debian.org
Sun Sep 5 14:21:28 UTC 2010


Author: geox-guest
Date: 2010-09-05 14:21:19 +0000 (Sun, 05 Sep 2010)
New Revision: 1078

Added:
   openacs/tags/5.5.1+dfsg-6/
   openacs/tags/5.5.1+dfsg-6/debian/README.Debian
   openacs/tags/5.5.1+dfsg-6/debian/changelog
   openacs/tags/5.5.1+dfsg-6/debian/postinst
Removed:
   openacs/tags/5.5.1+dfsg-6/debian/README.Debian
   openacs/tags/5.5.1+dfsg-6/debian/changelog
   openacs/tags/5.5.1+dfsg-6/debian/postinst
Log:
[svn-buildpackage] Tagging openacs 5.5.1+dfsg-6

Deleted: openacs/tags/5.5.1+dfsg-6/debian/README.Debian
===================================================================
--- openacs/trunk/debian/README.Debian	2010-09-04 23:34:45 UTC (rev 1073)
+++ openacs/tags/5.5.1+dfsg-6/debian/README.Debian	2010-09-05 14:21:19 UTC (rev 1078)
@@ -1,42 +0,0 @@
-OpenACS for Debian
-------------------
-
-- DFSG repackaged
------------------
-
-The following files have been deleted from the original tarball becaus
-e are not DFSG compliant:
-
-* /usr/share/openacs/packages/acs-templating/www/resources/xinha-nightly/iconsets/Tango/*
-* /usr/share/openacs/packages/acs-templating/www/resources/xinha-nightly/images/tango/*
-* /usr/share/openacs/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/plugins/media/img/flv_player.swf
-
-- After Install
----------------
-
-The OpenACS install process will create the database, but will not
-populate it with tables. Point a browser at http://localhost:8000/
-to finish the install.
-
-The address and port that OpenACS will listen on can be configured
-in /etc/aolserver4/conf.d/openacs.sh.
-
-- Grant OpenACS user access on PostgreSQL
------------------------------------------
-
-To grant access manually, you have to edit the
-/etc/postgresql/8.X/main/pg_hba.conf file, adding a line
-with the database, user and method to connect (for example, method 
-can be 'trust' if no password is used, or 'md5' otherwise):
-
-# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
-local   openacs     user                              trust
-
-- Full OpenACS documentation:
------------------------------
-
-* http://openacs.org/doc/current/
-* http://openacs.org/xowiki/
-
-
- -- Hector Romojaro <hromojaro at dia.uned.es>  Tue, 29 Dec 2009 12:16:39 +0100 

Copied: openacs/tags/5.5.1+dfsg-6/debian/README.Debian (from rev 1077, openacs/trunk/debian/README.Debian)
===================================================================
--- openacs/tags/5.5.1+dfsg-6/debian/README.Debian	                        (rev 0)
+++ openacs/tags/5.5.1+dfsg-6/debian/README.Debian	2010-09-05 14:21:19 UTC (rev 1078)
@@ -0,0 +1,51 @@
+OpenACS for Debian
+------------------
+
+- DFSG repackaged
+-----------------
+
+The following files have been deleted from the original tarball becaus
+e are not DFSG compliant:
+
+* /usr/share/openacs/packages/acs-templating/www/resources/xinha-nightly/iconsets/Tango/*
+* /usr/share/openacs/packages/acs-templating/www/resources/xinha-nightly/images/tango/*
+* /usr/share/openacs/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/plugins/media/img/flv_player.swf
+
+- PostgreSQL dependency
+-----------------------
+
+OpenACS debian package does not depend strictly on postgresql package (it just "suggests" it), because it is possible
+to install it with an external postgresql database server.
+
+If the package is going to be installed in the same machine as the PostgreSQL server, please remember to install
+the postgresql package first (apt-get install postgresql).
+
+- After Install
+---------------
+
+The OpenACS install process will create the database, but will not
+populate it with tables. Point a browser at http://localhost:8000/
+to finish the install.
+
+The address and port that OpenACS will listen on can be configured
+in /etc/aolserver4/conf.d/openacs.sh.
+
+- Grant OpenACS user access on PostgreSQL
+-----------------------------------------
+
+To grant access manually, you have to edit the
+/etc/postgresql/8.X/main/pg_hba.conf file, adding a line
+with the database, user and method to connect (for example, method 
+can be 'trust' if no password is used, or 'md5' otherwise):
+
+# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
+local   openacs     user                              trust
+
+- Full OpenACS documentation:
+-----------------------------
+
+* http://openacs.org/doc/current/
+* http://openacs.org/xowiki/
+
+
+ -- Hector Romojaro <hromojaro at dia.uned.es>  Tue, 29 Dec 2009 12:16:39 +0100 

Deleted: openacs/tags/5.5.1+dfsg-6/debian/changelog
===================================================================
--- openacs/trunk/debian/changelog	2010-09-04 23:34:45 UTC (rev 1073)
+++ openacs/tags/5.5.1+dfsg-6/debian/changelog	2010-09-05 14:21:19 UTC (rev 1078)
@@ -1,116 +0,0 @@
-openacs (5.5.1+dfsg-5) unstable; urgency=low
-
-  * Removed non DFSG files, check README.Debian for details. Closes: #591207
-  * Updated standards to 3.9.1
-  * Fixed postinst script that failed to reload postgresql. 
-
- -- Hector Romojaro <hromojaro at dia.uned.es>  Sun, 05 Sep 2010 00:51:43 +0200
-
-openacs (5.5.1-4) unstable; urgency=low
-
-  * Updated translations:
-    - Spanish. Closes: #579512
-  * Fixed bashisms. Closes: #581133
-
- -- Hector Romojaro <hromojaro at dia.uned.es>  Tue, 11 May 2010 09:57:30 +0200
-
-openacs (5.5.1-3) unstable; urgency=low
-
-  * Updated standards to 3.8.4 (no changes required)
-  * Added debian/source/format file, with value of 1.0.
-  * Updated translations:
-    - Vietnamese.
-    - Czech. Closes: #565882
-    - Portuguese. Closes: #575166
-
- -- Hector Romojaro <hromojaro at dia.uned.es>  Tue, 20 Apr 2010 19:13:44 +0200
-
-openacs (5.5.1-2) unstable; urgency=low
-
-  * Changed aolserver4-daemon dependency to >= 4.5.1-11
-  * Added watch file. 
-  * Added get-orig-source on debian/rules.
-  * debian/control reviewed by the debian-l10n-english team (thanks 
-  Ben Finney)
-  * Template bugs (thanks Thomas Mueller, Christian Perrier
-  and Justin B. Rye)
-    - Reviewed by the debian-l10n-english team
-    - Removed openacs/notconfigured, openacs/pg_grant_access_manual*,
-    openacs/create_tables and openacs/dba_confirm.
-  * Added after install and manual database access instructions to 
-  README.Debian.
-  * Debconf Translation Updates
-    - Norwegian.
-    - Slovak. Closes: #564097
-    - Russian. Closes: #564102
-    - Swedish. Closes: #564130
-    - French. Closes: #564178
-    - Finnish. Closes: #564493
-    - German. Closes: #564674
-    - Catalan
-    - Czech
-    - Danish
-    - Spanish
-    - Euskara
-    - Galician
-    - Italian
-    - Korean
-    - Malay
-    - Dutch
-    - Portuguese
-    - Brazilian Portuguese
-    - Vietnamese
-
- -- Hector Romojaro <hromojaro at dia.uned.es>  Mon, 18 Jan 2010 16:25:38 +0100
-
-openacs (5.5.1-1) unstable; urgency=low
-
-  * New upstream release
-  * Changed aolserver4-daemon dependency to >= 4.5.1-7
-  * Updated to the new aolserver config environment:
-    - Basic config stored on /etc/aolserver4/conf.d/openacs.sh.
-    - Removed init script, now the instance is started by the 
-      aolserver init script.
-    - Removed /etc/default/openacs.
-    - Updated daemontools script and README.
-  * Removed tsearch checks, because it is built into postgresql since 8.3.
-  * Removed README.tsearch
-  * Added README.source
-  * Added tinymce and Crystal iconset for xinha licenses to copyright file.
-  * Removed Xinha Tango Iconset because of its non DFSG compliant license.
-
- -- Hector Romojaro <hromojaro at dia.uned.es>  Sat, 21 Nov 2009 00:20:39 +0100
-
-openacs (5.4.3-3) unstable; urgency=low
-
-  [ Hector Romojaro ]
-  * Updated standards to 3.8.2.
-
-  [ Francesco Paolo Lovergine ]
-  * Added me as an uploader.
-  * Updated standards to 3.8.3. 
-  * Added Homepage field to debian/control.
-  * Added Vcs-* field to debian/control.
-  * Now using dh_prep instead of dh_clean -k.
-
- -- Francesco Paolo Lovergine <frankie at debian.org>  Mon, 07 Sep 2009 15:20:37 +0200
-
-openacs (5.4.3-2) unstable; urgency=low
-
-  * Removed nscache from config.tcl
-  * Fixed install.tcl to show the command to restart the server once installed.
-
- -- Hector Romojaro <hromojaro at dia.uned.es>  Wed, 22 Apr 2009 12:06:21 +0200
-
-openacs (5.4.3-1) unstable; urgency=low
-
-  * Removed aolserver4-nscache dependency 
-
- -- Hector Romojaro <hromojaro at dia.uned.es>  Thu, 26 Mar 2009 17:58:58 +0100
-
-openacs (5.4.3) unstable; urgency=low
-
-  * Initial release (Closes: #483126)
-
- -- Hector Romojaro <hromojaro at dia.uned.es>  Tue, 28 Oct 2008 20:01:49 +0200
-

Copied: openacs/tags/5.5.1+dfsg-6/debian/changelog (from rev 1077, openacs/trunk/debian/changelog)
===================================================================
--- openacs/tags/5.5.1+dfsg-6/debian/changelog	                        (rev 0)
+++ openacs/tags/5.5.1+dfsg-6/debian/changelog	2010-09-05 14:21:19 UTC (rev 1078)
@@ -0,0 +1,123 @@
+openacs (5.5.1+dfsg-6) unstable; urgency=low
+
+  * Success to install even if postgresql is not installed.
+  * Added info about PostgreSQL dependency to README.Debian. 
+
+ -- Hector Romojaro <hromojaro at dia.uned.es>  Sun, 05 Sep 2010 15:56:09 +0200
+
+openacs (5.5.1+dfsg-5) unstable; urgency=low
+
+  * Removed non DFSG files, check README.Debian for details. Closes: #591207
+  * Updated standards to 3.9.1
+  * Fixed postinst script that failed to reload postgresql. 
+
+ -- Hector Romojaro <hromojaro at dia.uned.es>  Sun, 05 Sep 2010 00:51:43 +0200
+
+openacs (5.5.1-4) unstable; urgency=low
+
+  * Updated translations:
+    - Spanish. Closes: #579512
+  * Fixed bashisms. Closes: #581133
+
+ -- Hector Romojaro <hromojaro at dia.uned.es>  Tue, 11 May 2010 09:57:30 +0200
+
+openacs (5.5.1-3) unstable; urgency=low
+
+  * Updated standards to 3.8.4 (no changes required)
+  * Added debian/source/format file, with value of 1.0.
+  * Updated translations:
+    - Vietnamese.
+    - Czech. Closes: #565882
+    - Portuguese. Closes: #575166
+
+ -- Hector Romojaro <hromojaro at dia.uned.es>  Tue, 20 Apr 2010 19:13:44 +0200
+
+openacs (5.5.1-2) unstable; urgency=low
+
+  * Changed aolserver4-daemon dependency to >= 4.5.1-11
+  * Added watch file. 
+  * Added get-orig-source on debian/rules.
+  * debian/control reviewed by the debian-l10n-english team (thanks 
+  Ben Finney)
+  * Template bugs (thanks Thomas Mueller, Christian Perrier
+  and Justin B. Rye)
+    - Reviewed by the debian-l10n-english team
+    - Removed openacs/notconfigured, openacs/pg_grant_access_manual*,
+    openacs/create_tables and openacs/dba_confirm.
+  * Added after install and manual database access instructions to 
+  README.Debian.
+  * Debconf Translation Updates
+    - Norwegian.
+    - Slovak. Closes: #564097
+    - Russian. Closes: #564102
+    - Swedish. Closes: #564130
+    - French. Closes: #564178
+    - Finnish. Closes: #564493
+    - German. Closes: #564674
+    - Catalan
+    - Czech
+    - Danish
+    - Spanish
+    - Euskara
+    - Galician
+    - Italian
+    - Korean
+    - Malay
+    - Dutch
+    - Portuguese
+    - Brazilian Portuguese
+    - Vietnamese
+
+ -- Hector Romojaro <hromojaro at dia.uned.es>  Mon, 18 Jan 2010 16:25:38 +0100
+
+openacs (5.5.1-1) unstable; urgency=low
+
+  * New upstream release
+  * Changed aolserver4-daemon dependency to >= 4.5.1-7
+  * Updated to the new aolserver config environment:
+    - Basic config stored on /etc/aolserver4/conf.d/openacs.sh.
+    - Removed init script, now the instance is started by the 
+      aolserver init script.
+    - Removed /etc/default/openacs.
+    - Updated daemontools script and README.
+  * Removed tsearch checks, because it is built into postgresql since 8.3.
+  * Removed README.tsearch
+  * Added README.source
+  * Added tinymce and Crystal iconset for xinha licenses to copyright file.
+  * Removed Xinha Tango Iconset because of its non DFSG compliant license.
+
+ -- Hector Romojaro <hromojaro at dia.uned.es>  Sat, 21 Nov 2009 00:20:39 +0100
+
+openacs (5.4.3-3) unstable; urgency=low
+
+  [ Hector Romojaro ]
+  * Updated standards to 3.8.2.
+
+  [ Francesco Paolo Lovergine ]
+  * Added me as an uploader.
+  * Updated standards to 3.8.3. 
+  * Added Homepage field to debian/control.
+  * Added Vcs-* field to debian/control.
+  * Now using dh_prep instead of dh_clean -k.
+
+ -- Francesco Paolo Lovergine <frankie at debian.org>  Mon, 07 Sep 2009 15:20:37 +0200
+
+openacs (5.4.3-2) unstable; urgency=low
+
+  * Removed nscache from config.tcl
+  * Fixed install.tcl to show the command to restart the server once installed.
+
+ -- Hector Romojaro <hromojaro at dia.uned.es>  Wed, 22 Apr 2009 12:06:21 +0200
+
+openacs (5.4.3-1) unstable; urgency=low
+
+  * Removed aolserver4-nscache dependency 
+
+ -- Hector Romojaro <hromojaro at dia.uned.es>  Thu, 26 Mar 2009 17:58:58 +0100
+
+openacs (5.4.3) unstable; urgency=low
+
+  * Initial release (Closes: #483126)
+
+ -- Hector Romojaro <hromojaro at dia.uned.es>  Tue, 28 Oct 2008 20:01:49 +0200
+

Deleted: openacs/tags/5.5.1+dfsg-6/debian/postinst
===================================================================
--- openacs/trunk/debian/postinst	2010-09-04 23:34:45 UTC (rev 1073)
+++ openacs/tags/5.5.1+dfsg-6/debian/postinst	2010-09-05 14:21:19 UTC (rev 1078)
@@ -1,201 +0,0 @@
-#! /bin/sh -e
-# postinst script for openacs 
-#
-# see: dh_installdeb(1)
-#
-# summary of how this script can be called:
-#        * <postinst> `configure' <most-recently-configured-version>
-#        * <old-postinst> `abort-upgrade' <new version>
-#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
-#          <new-version>
-#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
-#          <failed-install-package> <version> `removing'
-#          <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-#
-# quoting from the policy:
-#     Any necessary prompting should almost always be confined to the
-#     post-installation script, and should be protected with a conditional
-#     so that unnecessary prompting doesn't happen if a package's
-#     installation fails and the `postinst' is called with `abort-upgrade',
-#     `abort-remove' or `abort-deconfigure'.
-
-get_config() {
-    db_get openacs/db_host
-    db_host="$RET"
-
-    db_type="postgres7"
-    db_port=5432 
-
-    db_get openacs/dba_name
-    dba_name="$RET"
-
-    db_get openacs/dba_password
-    dba_password="$RET"
-
-    db_get openacs/dbu_name
-    dbu_name="$RET"
-
-    db_get openacs/dbu_password
-    dbu_password="$RET"
- 
-    db_get openacs/pg_grant_access
-    if [ ! -z "$RET" ]; then
-        grant_access="$RET"
-    else
-        grant_access="false"
-    fi
-}
-
-db_not_installed() {
-    echo "Please install the chosen OpenACS SGBD: postgresql, then try"
-    echo "dpkg-reconfigure openacs"
-}
-
-case "$1" in
-    configure)
-	. /usr/share/debconf/confmodule
-	db_version 2.0
-
-	# Read debconf and edit the config file accordingly
-	get_config
-	db_stop
-	exec 0<&1
-	
-	 # Care about the repository
-        repository=/var/lib/openacs
-        if [ -d $repository ]; then
-            # set the owner and change rights accordingly
-            chown -R www-data:www-data $repository
-            chmod 0755 $repository
-        fi
-
-	# Care about the log directory
-	logdir=/var/log/aolserver4/openacs
-        if [ -d $logdir ]; then
-            # set the owner and change rights accordingly
-            chown -R www-data:www-data $logdir
-            chmod 0755 $logdir
-        fi
-	
-	# Care about the app dir
-        appdir=/usr/share/openacs
-        if [ -d $appdir ]; then
-            # set the owner and change rights accordingly
-            chown -R www-data:www-data $appdir
-        fi
-
-	# care about the database creation
-	dbname=openacs
-	dbserver=$db_host
-	dbadmin=$dba_name
-	dbadmpass=$dba_password
-	dbuser=$dbu_name
-        dbpass=$dbu_password
-
-	. /usr/share/wwwconfig-common/pgsql-createuser.sh
-	if [ "$status" = "error" ]
-	then
-		err=1
-		echo $error
-	fi
-	. /usr/share/wwwconfig-common/pgsql-createdb.sh
-	if [ "$status" = "error" ]
-	then
-		err=1
-		echo $error
-	fi
-	
-	# Modify the pg_hba.conf to grant openacs user access to postgresql
-	# 1- Do we want to do that?
-	if [ "$grant_access" = true ]; then
-
-		# 2- Where is the pg_hba.conf from this database instance?
-		dbuser=$dba_name
-                dbpass=$dba_password
-		. /usr/share/wwwconfig-common/pgsql.get
-		pg_hba_file=$($pgsqlcmd -c "SELECT * from pg_settings where name='hba_file';" 2>/dev/null | grep hba | cut -d\| -f2)
-		pg_version=$(echo "$pg_hba_file" | cut -d\/ -f4)
-		if [ "$status" = "error" ]
-          		then
-                	err=1
-                	echo $error
-          	else
-			# 3- Modify the file
-			# Select connection method
-			if [ "A$dbu_password" != "A" ]; then 	
-				# No Blank Password
-				pg_conn_method="md5"
-			else
-				# Blank Password
-				pg_conn_method="trust"
-			fi
-			# Delete all lines between ## Openacs ... ## and ########### from previous configurations.
-			# Insert connection line after the first local connection line (the postgres user connection line).
-			sed -i "/^## Openacs package debconf changes (DO NOT EDIT BYHAND) ##/,/^##########################################################/d;1,/^local/{
-        /^local/a ## Openacs package debconf changes (DO NOT EDIT BYHAND) ##\nlocal   openacs     $dbu_name                              $pg_conn_method\n##########################################################
-} " $pg_hba_file
-			
-			# 4-Reload postgresql conf
-			/etc/init.d/postgresql reload
-		fi
-	fi
-
-	# Modify config.tcl with debconf values
-	dbuser=$dbu_name
-        dbpass=$dbu_password	
-	sed -i "/^    set db_host/,/^    set db_user/d;s/## Debconf changes (DO NOT EDIT BYHAND) ##/&\n    set db_host               $dbserver\n    set db_password           \"$dbpass\"\n    set db_port               \"5432\"\n    set db_user               $dbuser/" /etc/openacs/config.tcl
-
-	# Install plpgsql on database and enable compatibility options
-	dbuser=$dba_name
-	dbpass=$dba_password
-	sqlfile=$(mktemp)
-	echo "CREATE LANGUAGE plpgsql;
-		ALTER DATABASE openacs SET add_missing_from = on;
-		ALTER DATABASE openacs SET default_with_oids = on;
-		ALTER DATABASE openacs SET regex_flavor = extended;
-		" > $sqlfile
-        . /usr/share/wwwconfig-common/pgsql-exec.sh
-	rm -f $sqlfile
-
-	# Restart aolserver
-	invoke-rc.d aolserver4 restart
-
-        if [ "$status" = "error" ]
-        then
-                err=1
-                echo $error
-        fi
-
-	
-	if [ "$err" = "1" ]
-	then
-		echo "-------------------------------------------------------------"
-		echo "I've tried my best to create the OpenACS user and database"
-		echo "but an error has occurred"
-		echo "-------------------------------------------------------------"
-		echo "You will have to set up the OpenACS user and database yourself"
-		echo "-------------------------------------------------------------"
-	fi
-
-    ;;
-
-    abort-upgrade|abort-remove|abort-deconfigure)
-
-    ;;
-
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
-

Copied: openacs/tags/5.5.1+dfsg-6/debian/postinst (from rev 1077, openacs/trunk/debian/postinst)
===================================================================
--- openacs/tags/5.5.1+dfsg-6/debian/postinst	                        (rev 0)
+++ openacs/tags/5.5.1+dfsg-6/debian/postinst	2010-09-05 14:21:19 UTC (rev 1078)
@@ -0,0 +1,206 @@
+#! /bin/sh -e
+# postinst script for openacs 
+#
+# see: dh_installdeb(1)
+#
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+#
+# quoting from the policy:
+#     Any necessary prompting should almost always be confined to the
+#     post-installation script, and should be protected with a conditional
+#     so that unnecessary prompting doesn't happen if a package's
+#     installation fails and the `postinst' is called with `abort-upgrade',
+#     `abort-remove' or `abort-deconfigure'.
+
+get_config() {
+    db_get openacs/db_host
+    db_host="$RET"
+
+    db_type="postgres7"
+    db_port=5432 
+
+    db_get openacs/dba_name
+    dba_name="$RET"
+
+    db_get openacs/dba_password
+    dba_password="$RET"
+
+    db_get openacs/dbu_name
+    dbu_name="$RET"
+
+    db_get openacs/dbu_password
+    dbu_password="$RET"
+ 
+    db_get openacs/pg_grant_access
+    if [ ! -z "$RET" ]; then
+        grant_access="$RET"
+    else
+        grant_access="false"
+    fi
+}
+
+db_not_installed() {
+    echo "Please install the chosen OpenACS SGBD: postgresql, then try"
+    echo "dpkg-reconfigure openacs"
+}
+
+case "$1" in
+    configure)
+	. /usr/share/debconf/confmodule
+	db_version 2.0
+
+	# Read debconf and edit the config file accordingly
+	get_config
+	db_stop
+	exec 0<&1
+	
+	 # Care about the repository
+        repository=/var/lib/openacs
+        if [ -d $repository ]; then
+            # set the owner and change rights accordingly
+            chown -R www-data:www-data $repository
+            chmod 0755 $repository
+        fi
+
+	# Care about the log directory
+	logdir=/var/log/aolserver4/openacs
+        if [ -d $logdir ]; then
+            # set the owner and change rights accordingly
+            chown -R www-data:www-data $logdir
+            chmod 0755 $logdir
+        fi
+	
+	# Care about the app dir
+        appdir=/usr/share/openacs
+        if [ -d $appdir ]; then
+            # set the owner and change rights accordingly
+            chown -R www-data:www-data $appdir
+        fi
+
+	# care about the database creation
+	dbname=openacs
+	dbserver=$db_host
+	dbadmin=$dba_name
+	dbadmpass=$dba_password
+	dbuser=$dbu_name
+        dbpass=$dbu_password
+	
+	# is the database server available? Then create the user.
+        . /usr/share/wwwconfig-common/pgsql-createuser.sh > /dev/null
+        if [ "$status" = "error" ]
+        then
+                err=1
+                echo "* Error trying to connect to Postgresql server."
+                if [ "$db_host" = "localhost" ]
+                then
+                        echo "(TIP: is the postgresql package installed?)"
+                fi
+        else
+		. /usr/share/wwwconfig-common/pgsql-createdb.sh
+		if [ "$status" = "error" ]
+		then
+			err=1
+			echo $error
+		fi
+	
+		# Modify the pg_hba.conf to grant openacs user access to postgresql
+		# 1- Do we want to do that?
+		if [ "$grant_access" = true ]; then
+	
+			# 2- Where is the pg_hba.conf from this database instance?
+			dbuser=$dba_name
+	                dbpass=$dba_password
+			. /usr/share/wwwconfig-common/pgsql.get
+			pg_hba_file=$($pgsqlcmd -c "SELECT * from pg_settings where name='hba_file';" 2>/dev/null | grep hba | cut -d\| -f2)
+			pg_version=$(echo "$pg_hba_file" | cut -d\/ -f4)
+			if [ "$status" = "error" ]
+          			then
+                		err=1
+	                	echo $error
+        	  	else
+				# 3- Modify the file
+				# Select connection method
+				if [ "A$dbu_password" != "A" ]; then 	
+					# No Blank Password
+					pg_conn_method="md5"
+				else
+					# Blank Password
+					pg_conn_method="trust"
+				fi
+				# Delete all lines between ## Openacs ... ## and ########### from previous configurations.
+				# Insert connection line after the first local connection line (the postgres user connection line).
+				sed -i "/^## Openacs package debconf changes (DO NOT EDIT BYHAND) ##/,/^##########################################################/d;1,/^local/{
+        /^local/a ## Openacs package debconf changes (DO NOT EDIT BYHAND) ##\nlocal   openacs     $dbu_name                              $pg_conn_method\n##########################################################
+} " $pg_hba_file
+			
+				# 4-Reload postgresql conf
+				/etc/init.d/postgresql reload
+			fi
+		fi
+
+		# Modify config.tcl with debconf values
+		dbuser=$dbu_name
+        	dbpass=$dbu_password	
+		sed -i "/^    set db_host/,/^    set db_user/d;s/## Debconf changes (DO NOT EDIT BYHAND) ##/&\n    set db_host               $dbserver\n    set db_password           \"$dbpass\"\n    set db_port               \"5432\"\n    set db_user               $dbuser/" /etc/openacs/config.tcl
+
+		# Install plpgsql on database and enable compatibility options
+		dbuser=$dba_name
+		dbpass=$dba_password
+		sqlfile=$(mktemp)
+		echo "CREATE LANGUAGE plpgsql;
+			ALTER DATABASE openacs SET add_missing_from = on;
+			ALTER DATABASE openacs SET default_with_oids = on;
+			ALTER DATABASE openacs SET regex_flavor = extended;
+			" > $sqlfile
+        	. /usr/share/wwwconfig-common/pgsql-exec.sh
+		rm -f $sqlfile
+
+		# Restart aolserver
+		invoke-rc.d aolserver4 restart
+
+	        if [ "$status" = "error" ]
+        	then
+                	err=1
+	                echo $error
+        	fi
+
+	
+		if [ "$err" = "1" ]
+		then
+			echo "-------------------------------------------------------------"
+			echo "I've tried my best to create the OpenACS user and database"
+			echo "but an error has occurred"
+			echo "-------------------------------------------------------------"
+			echo "You will have to set up the OpenACS user and database yourself"
+			echo "-------------------------------------------------------------"
+		fi
+	fi
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+




More information about the Pkg-tcltk-commits mailing list