[med-svn] r18911 - trunk/packages/orthanc/trunk/debian

Sebastien Jodogne jodogne-guest at moszumanska.debian.org
Thu Mar 5 10:34:22 UTC 2015


Author: jodogne-guest
Date: 2015-03-05 10:34:21 +0000 (Thu, 05 Mar 2015)
New Revision: 18911

Added:
   trunk/packages/orthanc/trunk/debian/prerm
Removed:
   trunk/packages/orthanc/trunk/debian/orthanc-sqlite.postinst
Modified:
   trunk/packages/orthanc/trunk/debian/control
   trunk/packages/orthanc/trunk/debian/postinst
   trunk/packages/orthanc/trunk/debian/postrm
   trunk/packages/orthanc/trunk/debian/rules
Log:
refactoring of orthanc continued

Modified: trunk/packages/orthanc/trunk/debian/control
===================================================================
--- trunk/packages/orthanc/trunk/debian/control	2015-03-04 22:25:13 UTC (rev 18910)
+++ trunk/packages/orthanc/trunk/debian/control	2015-03-05 10:34:21 UTC (rev 18911)
@@ -34,6 +34,7 @@
 Package: orthanc
 Architecture: any
 Depends: dcmtk,
+	 adduser,
 	 ${misc:Depends},
 	 ${shlibs:Depends},
 	 orthanc-sqlite (= ${binary:Version}) | orthanc-postgresql
@@ -57,7 +58,7 @@
 
 Package: orthanc-sqlite
 Architecture: any
-Depends: adduser, ${misc:Depends}
+Depends: ${misc:Depends}
 Conflicts: orthanc-postgresql
 Description: SQLite back-end for Orthanc
  Orthanc aims at providing a simple, yet powerful DICOM server for

Deleted: trunk/packages/orthanc/trunk/debian/orthanc-sqlite.postinst
===================================================================
--- trunk/packages/orthanc/trunk/debian/orthanc-sqlite.postinst	2015-03-04 22:25:13 UTC (rev 18910)
+++ trunk/packages/orthanc/trunk/debian/orthanc-sqlite.postinst	2015-03-05 10:34:21 UTC (rev 18911)
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-set -e
-
-case $1 in
-    configure)
-        # Configure the permissions of the required directories
-        chown -R orthanc:orthanc /var/lib/orthanc
-        chmod 0775 /var/lib/orthanc
-        ;;
-esac
-
-#DEBHELPER#

Modified: trunk/packages/orthanc/trunk/debian/postinst
===================================================================
--- trunk/packages/orthanc/trunk/debian/postinst	2015-03-04 22:25:13 UTC (rev 18910)
+++ trunk/packages/orthanc/trunk/debian/postinst	2015-03-05 10:34:21 UTC (rev 18911)
@@ -7,8 +7,8 @@
         # Add the "orthanc" user
         if ! getent passwd orthanc > /dev/null; then
             adduser --system --quiet \
-                --home /var/lib/orthanc --no-create-home \
-                --shell /bin/bash --group --gecos "Orthanc Administrator" orthanc
+                    --home /var/lib/orthanc --no-create-home \
+                    --shell /bin/bash --group --gecos "Orthanc Administrator" orthanc
         fi
         if test "`id -u orthanc`" -eq 0; then
             echo "The orthanc administrative user must not be root." >&2
@@ -21,9 +21,28 @@
 
         # Configure the permissions of the required directories
         chown -R orthanc:orthanc /etc/orthanc
+        chown -R orthanc:orthanc /var/lib/orthanc
+
         chmod 0775 /etc/orthanc
         chmod 0664 /etc/orthanc/orthanc.json
-        ;;
+	chmod 0775 /var/lib/orthanc
+
+	# Start the Orthanc service after installation
+        # https://www.debian.org/doc/debian-policy/ch-opersys.html#s9.3.3.2
+        if which invoke-rc.d >/dev/null 2>&1; then
+            invoke-rc.d orthanc start
+        else
+            /etc/init.d/orthanc start
+        fi
+	;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+	;;
+
+    *)
+	echo "postinst called with unknown argument \`$1'" >&2
+	exit 1
+	;;
 esac
 
 #DEBHELPER#

Modified: trunk/packages/orthanc/trunk/debian/postrm
===================================================================
--- trunk/packages/orthanc/trunk/debian/postrm	2015-03-04 22:25:13 UTC (rev 18910)
+++ trunk/packages/orthanc/trunk/debian/postrm	2015-03-05 10:34:21 UTC (rev 18911)
@@ -6,11 +6,12 @@
 
 case $1 in
     purge)
+	# Remove the "/etc/orthanc" directory
         if test -d "/etc/orthanc"; then
             rmdir --ignore-fail-on-non-empty "/etc/orthanc" || true
         fi
 
-        # Remove the "orthanc" user
+        # Remove the "orthanc" group and user
         if getent passwd orthanc >/dev/null; then
                 if [ -x /usr/sbin/deluser ]; then
                         deluser --system orthanc
@@ -21,6 +22,15 @@
                         delgroup --system orthanc
                 fi
         fi
+	;;
+
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+	;;
+
+    *)
+	echo "postrm called with unknown argument \`$1'" >&2
+	exit 1
+	;;	
 esac
 
 #DEBHELPER#

Added: trunk/packages/orthanc/trunk/debian/prerm
===================================================================
--- trunk/packages/orthanc/trunk/debian/prerm	                        (rev 0)
+++ trunk/packages/orthanc/trunk/debian/prerm	2015-03-05 10:34:21 UTC (rev 18911)
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+set -e
+
+VERSION=%VERSION%
+
+case $1 in
+    remove|upgrade|deconfigure)
+	# Stop the Orthanc service
+        # https://www.debian.org/doc/debian-policy/ch-opersys.html#s9.3.3.2
+        if which invoke-rc.d >/dev/null 2>&1; then
+            invoke-rc.d orthanc stop
+        else
+            /etc/init.d/orthanc stop
+        fi
+	;;
+
+    failed-upgrade)
+	;;
+
+    *)
+	echo "prerm called with unknown argument \`$1'" >&2
+	exit 1
+	;;
+esac
+
+#DEBHELPER#


Property changes on: trunk/packages/orthanc/trunk/debian/prerm
___________________________________________________________________
Added: svn:executable
   + *

Modified: trunk/packages/orthanc/trunk/debian/rules
===================================================================
--- trunk/packages/orthanc/trunk/debian/rules	2015-03-04 22:25:13 UTC (rev 18910)
+++ trunk/packages/orthanc/trunk/debian/rules	2015-03-05 10:34:21 UTC (rev 18911)
@@ -64,10 +64,18 @@
 	dh_install Build/Orthanc usr/sbin
 
 override_dh_installinit:
-	dh_installinit --name=orthanc
+        # Install "debian/orthanc-sqlite.orthanc.init" as
+        # "/etc/init.d/orthanc.init", but do not start/stop the
+        # "orthanc" service from the orthanc-sqlite package. It is
+        # stopped/started from prerm/postinst in the sqlite package.
+	dh_installinit --package=orthanc-sqlite --name=orthanc --no-start
 
 override_dh_installchangelogs:
 	dh_installchangelogs -k NEWS
 
+override_dh_compress:
+        # Do not compress the samples
+	dh_compress -XOrthancClientSamples -XOrthancPluginSamples -XSamples
+
 get-orig-source:
 	uscan --verbose --force-download --repack --compression xz




More information about the debian-med-commit mailing list