[Pkg-phototools-commits] [SCM] openjpeg packaging branch, master, updated. 1.3+dfsg-4-66-g25760e6
Mathieu Malaterre
mathieu.malaterre at gmail.com
Fri Apr 20 09:41:38 UTC 2012
The following commit has been merged in the master branch:
commit 25760e659327463ff2d3ed2abce4afee4c795a3d
Author: Mathieu Malaterre <mathieu.malaterre at gmail.com>
Date: Fri Apr 20 11:38:27 2012 +0200
Automatically start the openjpip server
diff --git a/debian/control b/debian/control
index 5d2a273..be67046 100644
--- a/debian/control
+++ b/debian/control
@@ -10,15 +10,15 @@ Homepage: http://www.openjpeg.org
Build-Depends:
debhelper (>= 9)
, cmake (>= 2.8.0)
- , javahelper (>= 0.40)
+ , javahelper (>= 0.37~)
, default-jdk
, libxerces2-java
- , libtiff5-dev
+ , libtiff5-dev | libtiff-dev
, libpng-dev
, liblcms2-dev
, zlib1g-dev
, libfcgi-dev
- , libcurl4-gnutls-dev
+ , libcurl4-gnutls-dev | libcurl-ssl-dev
, doxygen
Standards-Version: 3.9.3
Section: libs
@@ -104,7 +104,7 @@ Description: JPEG 2000 java based viewer for basic remote JPIP access
Package: openjpip-server
Section: graphics
Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}, libwww-perl
Description: JPIP server for JPEG 2000 files
OpenJPIP software is an implementation of JPEG 2000 Part9: Interactivity tools,
APIs and protocols (JPIP). For more info about JPIP, check the website:
diff --git a/debian/libopenjpeg-dev.links b/debian/libopenjpeg-dev.links
new file mode 100644
index 0000000..fd54244
--- /dev/null
+++ b/debian/libopenjpeg-dev.links
@@ -0,0 +1 @@
+usr/include/openjpeg-1.5/openjpeg.h usr/include/openjpeg.h
diff --git a/debian/openjpip-server.README.Debian b/debian/openjpip-server.README.Debian
new file mode 100644
index 0000000..5d612c0
--- /dev/null
+++ b/debian/openjpip-server.README.Debian
@@ -0,0 +1,14 @@
+After installation, you should have a working openjpip server simply do:
+
+$ cd /var/lib/openjpip-server/
+$ wget http://www.openjpeg.org/jpip/data/16.jp2
+
+In another shell start the decoding client (caching of image)
+
+$ opj_dec_server
+
+In yet another shell you can start a viewer:
+
+$ opj_viewer http://localhost/openjpip 16.jp2
+
+ -- Mathieu Malaterre <malat at debian.org> Thu, 19 Apr 2012 13:05:06 +0200
diff --git a/debian/openjpip-server.dirs b/debian/openjpip-server.dirs
new file mode 100644
index 0000000..e1a3f69
--- /dev/null
+++ b/debian/openjpip-server.dirs
@@ -0,0 +1 @@
+/var/lib/openjpip-server
diff --git a/debian/openjpip-server.openjpip.init b/debian/openjpip-server.openjpip.init
new file mode 100644
index 0000000..8b56961
--- /dev/null
+++ b/debian/openjpip-server.openjpip.init
@@ -0,0 +1,162 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: openjpip
+# Required-Start: $network $local_fs
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: openjpip server
+# Description: JPIP server for OpenJPEG
+# <...>
+# <...>
+### END INIT INFO
+
+# Author: Mathieu Malaterre <malat at debian.org>
+# ref: http://code.google.com/p/openjpeg/wiki/JPIP#Usage
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="openjpip server" # Introduce a short description here
+PORT=3000
+NAME=openjpip # Introduce the short server's name here
+SPAWN_FCGI="/usr/bin/spawn-fcgi"
+DAEMON=/usr/lib/openjpip-server/opj_server # Introduce the server's location here
+JP2DIR=/var/lib/openjpip-server # path were JP2 files are located
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+FCGI_USER="www-data"
+FCGI_GROUP="www-data"
+DAEMON_ARGS="" # Arguments to run the daemon with
+
+# Exit if the package is not installed
+[ -x $DAEMON ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+ # Return
+ # 0 if daemon has been started
+ # 1 if daemon was already running
+ # 2 if daemon could not be started
+ #start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
+ # || return 1
+ #start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
+ # $DAEMON_ARGS \
+ # || return 2
+ spawn-fcgi -U $FCGI_USER -G $FCGI_GROUP -p $PORT -P $PIDFILE -d $JP2DIR -- $DAEMON $DAEMON_ARGS
+ # Add code here, if necessary, that waits for the process to be ready
+ # to handle requests from services started subsequently which depend
+ # on this one. As a last resort, sleep for some time.
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+ # Return
+ # 0 if daemon has been stopped
+ # 1 if daemon was already stopped
+ # 2 if daemon could not be stopped
+ # other if a failure occurred
+ #start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+ #RETVAL="$?"
+ #[ "$RETVAL" = 2 ] && return 2
+ # Wait for children to finish too if this is a daemon that forks
+ # and if the daemon is only ever run from this initscript.
+ # If the above conditions are not satisfied then add some other code
+ # that waits for the process to drop all resources that could be
+ # needed by services started subsequently. A last resort is to
+ # sleep for some time.
+ #start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+ #[ "$?" = 2 ] && return 2
+ # Many daemons don't delete their pidfiles when they exit.
+ #rm -f $PIDFILE
+ #return "$RETVAL"
+ GET "http://localhost/openjpip?quitJPIP" > /dev/null
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service
+#
+do_reload() {
+ #
+ # If the daemon can reload its configuration without
+ # restarting (for example, when it is sent a SIGHUP),
+ # then implement that here.
+ #
+ #start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+ return 0
+}
+
+case "$1" in
+ start)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
+ do_start
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ stop)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ status)
+ status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+ ;;
+ #reload|force-reload)
+ #
+ # If do_reload() is not implemented then leave this commented out
+ # and leave 'force-reload' as an alias for 'restart'.
+ #
+ #log_daemon_msg "Reloading $DESC" "$NAME"
+ #do_reload
+ #log_end_msg $?
+ #;;
+ restart|force-reload)
+ #
+ # If the "reload" option is implemented then remove the
+ # 'force-reload' alias
+ #
+ log_daemon_msg "Restarting $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1)
+ do_start
+ case "$?" in
+ 0) log_end_msg 0 ;;
+ 1) log_end_msg 1 ;; # Old process is still running
+ *) log_end_msg 1 ;; # Failed to start
+ esac
+ ;;
+ *)
+ # Failed to stop
+ log_end_msg 1
+ ;;
+ esac
+ ;;
+ *)
+ #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+ echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+ exit 3
+ ;;
+esac
+
+:
diff --git a/debian/rules b/debian/rules
index 6cb38c0..11adb05 100755
--- a/debian/rules
+++ b/debian/rules
@@ -36,6 +36,9 @@ override_dh_strip:
override_dh_install:
dh_install --list-missing
+override_dh_installinit:
+ dh_installinit -popenjpip-server --name=openjpip
+
# http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a2be068c
override_dh_auto_install:
sed -i -e "s/FATAL_ERROR/STATUS/g" ./obj-*/CMakeFiles/Export/lib/*/openjpeg-1.5/OpenJPEGTargets-relwithdebinfo.cmake
--
openjpeg packaging
More information about the Pkg-phototools-commits
mailing list