[Fusionforge-commits] r7273 - trunk/gforge

Alexandre Neymann neymanna at libremir.placard.fr.eu.org
Thu Apr 2 10:53:01 CEST 2009


Author: neymanna
Date: 2009-04-02 10:53:01 +0200 (Thu, 02 Apr 2009)
New Revision: 7273

Modified:
   trunk/gforge/fusionforge.spec
Log:
rpm use install-bd.sh to configure bd

Modified: trunk/gforge/fusionforge.spec
===================================================================
--- trunk/gforge/fusionforge.spec	2009-04-02 08:42:48 UTC (rev 7272)
+++ trunk/gforge/fusionforge.spec	2009-04-02 08:53:01 UTC (rev 7273)
@@ -1,4 +1,4 @@
-%define dbhost			localhost
+#%define dbhost			localhost
 %define dbname			gforge
 %define dbuser			gforge
 
@@ -240,14 +240,34 @@
 	su -l postgres -c "psql -c \"CREATE USER gforge_nss WITH PASSWORD '$GFORGEDATABASE_PASSWORD' NOCREATEUSER\" %{dbname} >/dev/null 2>&1"
 	su -l postgres -c "psql -c \"CREATE USER gforge_mta WITH PASSWORD '$GFORGEDATABASE_PASSWORD' NOCREATEUSER\" %{dbname} >/dev/null 2>&1"
 	
+	# replacing variables in configuration files
+        perl -pi -e "
+                s/DB_HOST/"%{dbhost}"/g;
+                s/DB_NAME/"%{dbname}"/g;
+                s/DB_USER/"%{dbuser}"/g;
+                s/DB_PASSWORD/"$GFORGEDATABASE_PASSWORD"/g;
+                s/SYSTEM_NAME/"%{sitename}"/g;
+                s/RANDOM_ID/"$SESSID"/g;
+                s/HOST_NAME/"%{hostname}"/g" %{GFORGE_CONF_DIR}/gforge.conf
+
+        #admin email
+        adminemail=$(echo "%{adminemail}"| sed 's|@|\\\@|g')
+        perl -pi -e "
+                s/SERVER_ADMIN/"$adminemail"/g" %{GFORGE_CONF_DIR}/gforge.conf
+	
 	# updating PostgreSQL configuration
-	if ! grep -i '^ *host.*%{dbname}.*' /var/lib/pgsql/data/pg_hba.conf >/dev/null 2>&1; then
-		echo 'host %{dbname} %{dbuser} 127.0.0.1 255.255.255.255 md5' >> /var/lib/pgsql/data/pg_hba.conf
- 		echo 'local %{dbname} gforge_mta md5md5md5md5md5' >> /var/lib/pgsql/data/pg_hba.conf
-		echo 'local %{dbname} gforge_nss trust' >> /var/lib/pgsql/data/pg_hba.conf
-		%reloadpostgresql
-	fi
+	#if ! grep -i '^ *host.*%{dbname}.*' /var/lib/pgsql/data/pg_hba.conf >/dev/null 2>&1; then
+	#	echo 'host %{dbname} %{dbuser} 127.0.0.1 255.255.255.255 md5' >> /var/lib/pgsql/data/pg_hba.conf
+ 	#	echo 'local %{dbname} gforge_mta md5md5md5md5md5' >> /var/lib/pgsql/data/pg_hba.conf
+	#	echo 'local %{dbname} gforge_nss trust' >> /var/lib/pgsql/data/pg_hba.conf
+	#	%reloadpostgresql
+	#fi
 
+	sh %{GFORGE_BIN_DIR}/install-db.sh configure-files
+        mv /var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/data/pg_hba.conf-orig
+        mv /var/lib/pgsql/data/pg_hba.conf.gforge-new /var/lib/pgsql/data/pg_hba.conf
+        %reloadpostgresql
+
 	# adding "noreply" alias
 	for i in /etc/postfix/aliases /etc/mail/aliases /etc/aliases ; do
 		if [ -f $i ]; then
@@ -262,21 +282,6 @@
 	# generating random session ID
 	%randstr SESSID 32
 
-	# replacing variables in configuration files
-	perl -pi -e "
-		s/DB_HOST/"%{dbhost}"/g;
-		s/DB_NAME/"%{dbname}"/g;
-		s/DB_USER/"%{dbuser}"/g;
-		s/DB_PASSWORD/"$GFORGEDATABASE_PASSWORD"/g;
-		s/SYSTEM_NAME/"%{sitename}"/g;
-		s/RANDOM_ID/"$SESSID"/g;
-		s/HOST_NAME/"%{hostname}"/g" %{GFORGE_CONF_DIR}/gforge.conf
-		
-	#admin email
- 	adminemail=$(echo "%{adminemail}"| sed 's|@|\\\@|g')
- 	perl -pi -e "
- 		s/SERVER_ADMIN/"$adminemail"/g" %{GFORGE_CONF_DIR}/gforge.conf
- 
  	#path of jpgraph.php
  	path_jpgraph=$(rpm -ql php-jpgraph | grep jpgraph.php | sed 's/\(.*\)jpgraph.php/\1/')
  	perl -pi -e "




More information about the Fusionforge-commits mailing list