[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-devel] Debian package enhancements
From: |
Matthew A. Nicholson |
Subject: |
[Monotone-devel] Debian package enhancements |
Date: |
Wed, 18 May 2005 10:35:23 -0500 |
User-agent: |
Debian Thunderbird 1.0.2 (X11/20050331) |
This patch fixes a missing build-dep of texinfo and adds init script support for
monotone. This patch is not complete as it does not create a hooks file or
create a database. Once I am finished (if ever) I will have the necessary
postinstall hooks to do those tasks. If some one else feels the need go ahead
and build from my work.
--
Matthew A. Nicholson
Digium
diff -ruN monotone-0.19/debian/control monotone-0.19.new/debian/control
--- monotone-0.19/debian/control 2005-04-05 00:44:20.000000000 -0500
+++ monotone-0.19.new/debian/control 2005-05-18 10:31:42.919667632 -0500
@@ -2,7 +2,7 @@
Section: devel
Priority: optional
Maintainer: graydon hoare <address@hidden>
-Build-Depends: debhelper (>> 4.0.0), libboost-dev (>= 1.30.2),
libboost-regex-dev (>= 1.30.2), libboost-date-time-dev (>= 1.30.2),
libboost-test-dev (>= 1.30.2), libboost-filesystem-dev (>= 1.31.0)
+Build-Depends: debhelper (>> 4.0.0), libboost-dev (>= 1.30.2),
libboost-regex-dev (>= 1.30.2), libboost-date-time-dev (>= 1.30.2),
libboost-test-dev (>= 1.30.2), libboost-filesystem-dev (>= 1.31.0), texinfo
Standards-Version: 3.5.9
Package: monotone
diff -ruN monotone-0.19/debian/monotone.default
monotone-0.19.new/debian/monotone.default
--- monotone-0.19/debian/monotone.default 1969-12-31 18:00:00.000000000
-0600
+++ monotone-0.19.new/debian/monotone.default 2005-05-18 09:58:58.213348392
-0500
@@ -0,0 +1,17 @@
+# init.d config file for monotone
+
+# this must be set to 1 for monotone to start
+START=0
+
+# the address and or port (ADDRESS[:PORT]) monotone should listen on
+ADDRESS=0.0.0.0
+
+# the database to use
+DB=/var/lib/monotone/default.db
+
+# Collections that monotone should serve (seperated by white space)
+COLLECTIONS="com.collection \
+ com.collection.branch \
+ collection.com \
+ collection.com/branch"
+
diff -ruN monotone-0.19/debian/monotone.init
monotone-0.19.new/debian/monotone.init
--- monotone-0.19/debian/monotone.init 1969-12-31 18:00:00.000000000 -0600
+++ monotone-0.19.new/debian/monotone.init 2005-05-18 10:02:47.287523824
-0500
@@ -0,0 +1,114 @@
+#! /bin/sh
+#
+# monotone Monotone server init script.
+#
+# Author: Matthew A. Nicholson <address@hidden>.
+#
+# Version: v0.0.1 March 29, 2005 address@hidden
+#
+### BEGIN INIT INFO
+# Provides: monotone
+# Required-Start: $network $local_fs
+# Required-Stop: $network $local_fs
+# Default-Start: 3 4 5
+# Default-Stop: 0 1 2 6
+# Short-Description: Monotone server.
+### END INIT INFO
+
+set -e
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DESC="Monotone Server"
+NAME=monotone
+DAEMON=/usr/bin/$NAME
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Gracefully exit if the package has been removed.
+test -x $DAEMON || exit 0
+
+# Read config file
+. /etc/default/$NAME
+
+if [ $START -ne 1 ]; then
+ echo "$NAME configured in /etc/default/monotone not to start."
+ exit 0
+fi
+
+#
+# Function that starts the daemon/service.
+#
+d_start() {
+ start-stop-daemon --start --quiet --make-pidfile --pidfile $PIDFILE \
+ --exec $DAEMON -- --db=$DB --norc \
+ --rcfile=/etc/monotone/hooks.lua serve \
+ $ADDRESS $COLLECTIONS >> /var/log/monotone.log 2>&1 &
+
+}
+
+#
+# Function that stops the daemon/service.
+#
+d_stop() {
+ start-stop-daemon --stop --quiet --pidfile $PIDFILE \
+ --name $NAME
+
+
+# kill `ps x | grep monotone.*serve | grep -v grep | awk -- '{print
$1}'` &> /dev/null \
+# or echo "Failed: monotone not running"
+
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service.
+#
+#d_reload() {
+# start-stop-daemon --stop --quiet --pidfile $PIDFILE \
+# --name $NAME --signal 1
+#}
+
+case "$1" in
+ start)
+ echo -n "Starting $DESC: $NAME"
+ d_start || echo -n ...failed
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: $NAME"
+ d_stop || echo -n ...failed
+ echo "."
+ ;;
+ #reload)
+ #
+ # If the daemon can reload its configuration without
+ # restarting (for example, when it is sent a SIGHUP),
+ # then implement that here.
+ #
+ # If the daemon responds to changes in its config file
+ # directly anyway, make this an "exit 0".
+ #
+ # echo -n "Reloading $DESC configuration..."
+ # d_reload
+ # echo "done."
+ #;;
+ restart|force-reload)
+ #
+ # If the "reload" option is implemented, move the "force-reload"
+ # option to the "reload" entry above. If not, "force-reload" is
+ # just the same as "restart".
+ #
+ echo -n "Stopping $DESC: $NAME"
+ d_stop || echo -n ...failed
+ echo "."
+ echo -n "Starting $DESC: $NAME"
+ d_start || echo -n ...failed
+ echo "."
+ ;;
+ *)
+ # echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+ echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff -ruN monotone-0.19/debian/README.Debian
monotone-0.19.new/debian/README.Debian
--- monotone-0.19/debian/README.Debian 1969-12-31 18:00:00.000000000 -0600
+++ monotone-0.19.new/debian/README.Debian 2005-05-18 09:59:03.823495520
-0500
@@ -0,0 +1,15 @@
+monotone for Debian
+-------------------
+
+An init script for monotone has been included with this package. To use it you
+must edit /etc/default/monotone and install the proper links in your /etc/rc*.d
+directories as follows:
+
+update-rc.d monotone defaults
+
+This command should be run as root and will add the necessary startup links.
+You can also just start the monotone server manually:
+
+/etc/init.d/monotone start
+
+ -- Matthew A. Nicholson <address@hidden> Tue, 29 Mar 2005 12:11:07 -0600
diff -ruN monotone-0.19/debian/rules monotone-0.19.new/debian/rules
--- monotone-0.19/debian/rules 2005-03-20 05:05:48.000000000 -0600
+++ monotone-0.19.new/debian/rules 2005-05-18 09:58:30.059628408 -0500
@@ -86,7 +86,7 @@
# dh_installemacsen
# dh_installpam
# dh_installmime
-# dh_installinit
+ dh_installinit
# dh_installcron
# dh_installinfo
dh_installman
- [Monotone-devel] Debian package enhancements,
Matthew A. Nicholson <=