[med-svn] r12306 - trunk/packages/biomaj/trunk/debian

Olivier Sallou osallou at alioth.debian.org
Wed Oct 3 08:23:12 UTC 2012


Author: osallou
Date: 2012-10-03 08:23:12 +0000 (Wed, 03 Oct 2012)
New Revision: 12306

Added:
   trunk/packages/biomaj/trunk/debian/biomaj-configure
Modified:
   trunk/packages/biomaj/trunk/debian/biomaj.install
   trunk/packages/biomaj/trunk/debian/changelog
   trunk/packages/biomaj/trunk/debian/postinst
   trunk/packages/biomaj/trunk/debian/postrm
   trunk/packages/biomaj/trunk/debian/rules
Log:
fix conffile update, use template file

Added: trunk/packages/biomaj/trunk/debian/biomaj-configure
===================================================================
--- trunk/packages/biomaj/trunk/debian/biomaj-configure	                        (rev 0)
+++ trunk/packages/biomaj/trunk/debian/biomaj-configure	2012-10-03 08:23:12 UTC (rev 12306)
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+set -e
+
+# Source debconf library.
+. /usr/share/debconf/confmodule
+
+ant_home="/usr/share/ant"
+biomaj_root="/usr/share/biomaj"
+jdk_home=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::")
+db_type="MySQL"
+db_get biomaj/mysql_host
+db_url="jdbc:mysql://$RET/biomaj_log"
+db_get biomaj/mysql_login
+db_login="$RET"
+db_get biomaj/mysql_passwd
+db_passwd="$RET"
+
+tomcat_port="0"
+
+cd $biomaj_root
+
+if [ ! -e /etc/biomaj/db_properties/global.properties ]; then
+  # If no configuration file exits, create one with template and debconf configuration
+  cp /usr/share/biomaj/global.properties.tpl  /etc/biomaj/db_properties/global.properties
+fi
+
+java -cp $biomaj_root/bin Configurator java_home:=$jdk_home ant_home:=$ant_home biomaj_root:=$biomaj_root db_type:=$db_type db_url:=$db_url db_login:=$db_login db_passwd:=$db_passwd
+


Property changes on: trunk/packages/biomaj/trunk/debian/biomaj-configure
___________________________________________________________________
Added: svn:executable
   + *

Modified: trunk/packages/biomaj/trunk/debian/biomaj.install
===================================================================
--- trunk/packages/biomaj/trunk/debian/biomaj.install	2012-10-01 13:12:35 UTC (rev 12305)
+++ trunk/packages/biomaj/trunk/debian/biomaj.install	2012-10-03 08:23:12 UTC (rev 12306)
@@ -9,3 +9,4 @@
 etc/biomaj
 usr/bin
 usr/share/biomaj/console_help.txt  usr/share/biomaj/
+debian/biomaj-configure usr/bin/

Modified: trunk/packages/biomaj/trunk/debian/changelog
===================================================================
--- trunk/packages/biomaj/trunk/debian/changelog	2012-10-01 13:12:35 UTC (rev 12305)
+++ trunk/packages/biomaj/trunk/debian/changelog	2012-10-03 08:23:12 UTC (rev 12306)
@@ -2,6 +2,8 @@
 
   [ Olivier Sallou ]
   * debian/copyright: Fix copyright URL
+  * debian/rules, debian/postinst, debian/postrm: fix conffile update
+    conflicting with Debian Policy (Closes: #688433).
 
  -- Olivier Sallou <osallou at debian.org>  Wed, 01 Aug 2012 15:59:55 +0200
 

Modified: trunk/packages/biomaj/trunk/debian/postinst
===================================================================
--- trunk/packages/biomaj/trunk/debian/postinst	2012-10-01 13:12:35 UTC (rev 12305)
+++ trunk/packages/biomaj/trunk/debian/postinst	2012-10-03 08:23:12 UTC (rev 12306)
@@ -22,6 +22,10 @@
 
       cd $biomaj_root
 
+      if [ ! -e /etc/biomaj/db_properties/global.properties ]; then
+        # If no configuration file exits, create one with template and debconf configuration
+        cp /usr/share/biomaj/global.properties.tpl  /etc/biomaj/db_properties/global.properties
+      fi
       java -cp $biomaj_root/bin Configurator java_home:=$jdk_home ant_home:=$ant_home biomaj_root:=$biomaj_root db_type:=$db_type db_url:=$db_url db_login:=$db_login db_passwd:=$db_passwd
 
         if [ ! -e /usr/share/biomaj/sql/migration ]; then

Modified: trunk/packages/biomaj/trunk/debian/postrm
===================================================================
--- trunk/packages/biomaj/trunk/debian/postrm	2012-10-01 13:12:35 UTC (rev 12305)
+++ trunk/packages/biomaj/trunk/debian/postrm	2012-10-03 08:23:12 UTC (rev 12306)
@@ -15,6 +15,10 @@
     if [ -e /usr/share/biomaj ]; then
     rm -rf /usr/share/biomaj
     fi
+
+    # Remove generated conf file
+    rm -f /etc/biomaj/db_properties/global.properties
+
     echo "Warning, BioMAJ database for MySQL is not deleted by process removal."
     ;;
     remove|upgrade|failed-upgrade|abort-install|disappear)

Modified: trunk/packages/biomaj/trunk/debian/rules
===================================================================
--- trunk/packages/biomaj/trunk/debian/rules	2012-10-01 13:12:35 UTC (rev 12305)
+++ trunk/packages/biomaj/trunk/debian/rules	2012-10-03 08:23:12 UTC (rev 12306)
@@ -20,6 +20,10 @@
 	ant -Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 -f usr/share/biomaj/build.xml
 	javac -source 1.5 -target 1.5 -d usr/share/biomaj/bin usr/share/biomaj/bin/Configurator.java
 
+override_dh_install:
+	dh_install
+	mv debian/biomaj/etc/biomaj/db_properties/global.properties debian/biomaj/usr/share/biomaj/global.properties.tpl
+
 override_dh_clean:
 	dh_clean
 	rm -rf usr/share/biomaj/build




More information about the debian-med-commit mailing list