# # # rename "debian/README.Debian" # to "debian/monotone.README.Debian" # # rename "debian/TODO.Debian" # to "debian/monotone.TODO.Debian" # # rename "debian/docs" # to "debian/monotone.docs" # # rename "debian/info" # to "debian/monotone.info" # # add_file "debian/monotone-server.README.Debian" # content [7b7ed61fad1f8a60a1b249dec1c6b3dad3acf733] # # add_file "debian/monotone-server.dirs" # content [11bc3e5e89f9f329ffe6701765af1acaf18194a5] # # add_file "debian/monotone-server.monotone.default" # content [920f2a6f1e6f5dc1833c6f8470db2327d79f3936] # # add_file "debian/monotone-server.monotone.init" # content [c29734464885597a7bd8589294e44d8202793adf] # # add_file "debian/monotone-server.postinst" # content [a9b56e3c095363daae9e8ca9dea79ff679a6db6a] # # add_file "debian/monotone-server.prerm" # content [655682258e6b65f34d298ff5209bc042fe87e073] # # add_file "debian/monotone.dirs" # content [c0bced501ce4731522e5b728dd34db871ba54b17] # # add_file "debian/monotone.install" # content [1224066d671c3d52202deec77a4e338ca17f51f4] # # patch "contrib/monotone.bash_completion" # from [d942f24e3f430c7e12fceeb7a58e088e45211971] # to [d03afdef8e888c8e263c2d023c0cff23fc4a6c87] # # patch "debian/control" # from [9476e79f8358ecb87a8e1c88bcd527973be62cd3] # to [cdd1fd5b651354ddefb3538b0913d703638c4958] # # patch "debian/monotone.docs" # from [2d3662c90d12b7c5fb629bf5b29043bc077755bf] # to [8be5e08b2f78838ff1214bb98084fb566be6b060] # # patch "debian/rules" # from [fe72fe2cb65bfb118258945b73978e05c506a700] # to [ae7eb306a79b67c8c70d88225c08753e3e7533e9] # ============================================================ --- debian/monotone-server.README.Debian 7b7ed61fad1f8a60a1b249dec1c6b3dad3acf733 +++ debian/monotone-server.README.Debian 7b7ed61fad1f8a60a1b249dec1c6b3dad3acf733 @@ -0,0 +1,8 @@ +monotone for Debian +------------------- + +In order to use the monotone-server package, monotone should first be +configured in the /etc/monotone/hooks.lua and /etc/default/monotone packages. +The server will not start until this is done. + + -- Matthew A. Nicholson Sun, 30 Oct 2005 2:26:00 -0600 ============================================================ --- debian/monotone-server.dirs 11bc3e5e89f9f329ffe6701765af1acaf18194a5 +++ debian/monotone-server.dirs 11bc3e5e89f9f329ffe6701765af1acaf18194a5 @@ -0,0 +1,2 @@ +var/lib/monotone +etc/monotone ============================================================ --- debian/monotone-server.monotone.default 920f2a6f1e6f5dc1833c6f8470db2327d79f3936 +++ debian/monotone-server.monotone.default 920f2a6f1e6f5dc1833c6f8470db2327d79f3936 @@ -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 + +# Branches that monotone should serve (seperated by white space) +BRANCHES='com.domain.* + com.domain.branch + domain.com/* + domain.com/branch' + ============================================================ --- debian/monotone-server.monotone.init c29734464885597a7bd8589294e44d8202793adf +++ debian/monotone-server.monotone.init c29734464885597a7bd8589294e44d8202793adf @@ -0,0 +1,115 @@ +#! /bin/sh +# +# monotone Monotone server init script. +# +# Author: Matthew A. Nicholson . +# +# 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 +if [ -r /etc/default/$NAME ]; then + . /etc/default/$NAME +fi + + +# +# Function that starts the daemon/service. +# +d_start() { + if [ "$START" -ne 1 ]; then + echo -e "\n$NAME configured in /etc/default/$NAME not to start." + return 0 + fi + + start-stop-daemon --start --quiet --make-pidfile --pidfile $PIDFILE \ + --exec $DAEMON --chuid monotone --chdir /var/lib/monotone -- \ + --db=$DB --norc --rcfile=/etc/monotone/hooks.lua serve \ + $ADDRESS $BRANCHES >> /var/log/monotone.log 2>&1 & + +} + +# +# Function that stops the daemon/service. +# +d_stop() { + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --name $NAME --user monotone + + +# 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 ============================================================ --- debian/monotone-server.postinst a9b56e3c095363daae9e8ca9dea79ff679a6db6a +++ debian/monotone-server.postinst a9b56e3c095363daae9e8ca9dea79ff679a6db6a @@ -0,0 +1,66 @@ +#! /bin/sh +# postinst script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# + +case "$1" in + configure) + + MTN_DB=/var/lib/monotone/default.db + MTN_HOME=/var/lib/monotone + + # create monotone user and fix permissions of files + if [ -z "`id -u monotone 2> /dev/null`" ]; then + /usr/sbin/adduser --system --group --home $MTN_HOME --no-create-home --disabled-password --quiet monotone --gecos "Monotone" + chmod 0740 $MTN_HOME + chmod 0740 /etc/monotone + chown monotone.monotone /etc/monotone + fi + + if [ -e $MTN_DB ]; then + echo "Monotone database exists." + else + echo "Creating Monotone database..." + /usr/bin/monotone --db $MTN_DB db init + chmod 0600 $MTN_DB + echo "Creating Monotone server keypair..." + echo -ne "$MTN_KEY_PASSWD\n$MTN_KEY_PASSWD\n" | /usr/bin/monotone \ + --db $MTN_DB genkey $MTN_KEY &> /dev/null + /usr/bin/monotone --db $MTN_DB pubkey $MTN_KEY > $MTN_HOME/$MTN_KEY.pubkey + echo "Monotone database created successfully." + fi + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + ============================================================ --- debian/monotone-server.prerm 655682258e6b65f34d298ff5209bc042fe87e073 +++ debian/monotone-server.prerm 655682258e6b65f34d298ff5209bc042fe87e073 @@ -0,0 +1,41 @@ +#! /bin/sh +# prerm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove) + # if the proper debconf variable is set, delete the database + ;; + upgrade|deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + ============================================================ --- debian/monotone.dirs c0bced501ce4731522e5b728dd34db871ba54b17 +++ debian/monotone.dirs c0bced501ce4731522e5b728dd34db871ba54b17 @@ -0,0 +1,1 @@ +etc/bash_completion.d ============================================================ --- debian/monotone.install 1224066d671c3d52202deec77a4e338ca17f51f4 +++ debian/monotone.install 1224066d671c3d52202deec77a4e338ca17f51f4 @@ -0,0 +1,1 @@ +debian/tmp/usr ============================================================ --- contrib/monotone.bash_completion d942f24e3f430c7e12fceeb7a58e088e45211971 +++ contrib/monotone.bash_completion d03afdef8e888c8e263c2d023c0cff23fc4a6c87 @@ -1,4 +1,5 @@ # -*- shell-script -*- +# vim: set ft=sh: # bash completion for monotone 0.18 # Author: Olivier Andrieu @@ -42,6 +43,10 @@ COMPREPLY=( $(compgen -W "$(monotone $mono_db list branches 2> /dev/null)" -- ${cur#*=} ) ) } +_monotone_tags() { + COMPREPLY=( $(compgen -W "$(monotone $mono_db list tags 2> /dev/null | awk '{print $1}')" -- ${cur#*=} ) ) +} + _monotone() { local cur prev mono_db @@ -68,6 +73,10 @@ cur="${cur#*=}" _filedir ;; + --root=* ) + cur="${cur#*=}" + _filedir -d + ;; --branch=* ) _monotone_branches ;; @@ -76,19 +85,22 @@ ;; --ticker=* ) cur="${cur#*=}" - COMPREPLY=( $(compgen -W 'count dot' -- $cur ) ) + COMPREPLY=( $(compgen -W 'count dot none' -- $cur ) ) ;; --revision=* ) _monotone_complete revision ;; -* ) - COMPREPLY=( $(compgen -W '--debug --dump --quiet --help --nostd --norc\ - --rcfile --key --db --branch --version --full-version\ - --ticker --revision --message' -- $cur) ) + COMPREPLY=( $(compgen -W '--debug --dump --quiet --help --version + --full-version --xargs --ticker --nostd --norc + --rcfile --key --db --root --verbose -k -d -@ + -m -b -r --branch --message --date --author + --depth --execute'\ + -- $cur) ) ;; * ) case $prev in - --db | -d | --rcfile | --dump ) + --db | -d | --rcfile | --dump | --root ) _filedir ;; --branch | -b ) @@ -103,105 +115,109 @@ --revision | -r ) _monotone_complete revision ;; - db ) - COMPREPLY=( $(compgen -W 'init info version dump load migrate execute check changesetify rebuild' -- $cur ) ) - ;; - cdiff | diff | annotate ) + db ) + COMPREPLY=( $(compgen -W 'init info version dump load migrate execute kill_rev_locally kill_branch_certs_locally kill_tag_locally check changesetify rebuild set_epoch' -- $cur ) ) + ;; + cdiff | diff | annotate ) COMPREPLY=( $(compgen -W '--revision' -- $cur ) ) - _filedir - ;; - log | approve | disapprove | comment | tag | testresult | cert | explicit_merge | trusted | update ) - _monotone_complete revision - ;; - ls | list ) - COMPREPLY=( $(compgen -W 'certs keys branches epochs tags vars known unknown ignored missing' -- $cur ) ) - ;; - attr ) - COMPREPLY=( $(compgen -W 'get set drop' -- $cur ) ) - ;; - co | checkout ) - _filedir -d - _monotone_complete revision - ;; - status | cvs_import | add | drop | rename | revert | identify ) - _filedir - ;; - cat ) - COMPREPLY=( $(compgen -W 'file manifest revision' -- $cur) ) - ;; + _filedir + ;; + log | approve | disapprove | comment | tag | testresult | cert | explicit_merge | trusted | update ) + _monotone_complete revision + ;; + ls | list ) + COMPREPLY=( $(compgen -W 'certs keys branches epochs tags vars known unknown ignored missing' -- $cur ) ) + ;; + attr ) + COMPREPLY=( $(compgen -W 'get set drop' -- $cur ) ) + ;; + co | checkout ) + _filedir -d + _monotone_complete revision + ;; + status | cvs_import | add | drop | rm | rename | mv | revert | identify ) + _filedir + ;; + complete ) + COMPREPLY=( $(compgen -W 'revision manifest file key' -- $cur) ) + ;; + cat ) + COMPREPLY=( $(compgen -W 'file manifest revision' -- $cur) ) + ;; push | pull | serve | sync ) - COMPREPLY=( $(compgen -A hostname -- $cur) ) - ;; - pubkey | privkey ) - _monotone_keys $prev - ;; - chkeypass | dropkey ) - _monotone_keys privkey - ;; - propagate | reindex ) - _monotone_branches - ;; - * ) - if (( $COMP_CWORD >= 2 )) ; then - local prev2=${COMP_WORDS[COMP_CWORD-2]} - case $prev2 in - cdiff | diff | explicit_merge ) - _monotone_complete revision - ;; - co | checkout | rename | annotate ) - _filedir -d - ;; - cat ) - _monotone_complete $prev - ;; - log | attr ) - _filedir - ;; - list ) - if [ $prev == certs ] ; then - _monotone_complete revision - _monotone_complete manifest - _monotone_complete file - fi - ;; - push | pull | serve | sync | propagate ) + COMPREPLY=( $(compgen -A hostname -- $cur) ) + ;; + pubkey | privkey ) + _monotone_keys $prev + ;; + chkeypass | dropkey ) + _monotone_keys privkey + ;; + propagate | reindex ) + _monotone_branches + ;; + * ) + if (( $COMP_CWORD >= 2 )) ; then + local prev2=${COMP_WORDS[COMP_CWORD-2]} + case $prev2 in + cdiff | diff | explicit_merge ) + _monotone_complete revision + ;; + co | checkout | rename | mv | annotate ) + _filedir + ;; + cat ) + _monotone_complete $prev + ;; + log | attr ) + _filedir + ;; + list ) + if [ $prev == certs ] ; then + _monotone_complete revision + _monotone_complete manifest + _monotone_complete file + fi + ;; + push | pull | serve | sync | propagate ) _monotone_branches - ;; - * ) - if (( $COMP_CWORD >= 3 )) ; then - local prev3=${COMP_WORDS[COMP_CWORD-3]} - case $prev3 in - explicit_merge ) - _monotone_complete revision - _monotone_branches - ;; - *) - unset prev2 - unset prev3 - esac - else - unset prev2 - fi - ;; - esac - fi - if [ -z "$prev2" ] ; then - COMPREPLY=( $(compgen -W 'db agraph \ - annotate cat cdiff complete diff list log ls status \ - cert chkeypass dropkey genkey trusted \ - pull push reindex serve sync \ - privkey pubkey read \ - cvs_import \ - approve comment disapprove tag testresult \ - checkout co explicit_merge heads merge propagate refresh_inodeprints setup \ - set unset \ - add attr commit drop identify rename revert update' -- $cur) ) - fi - ;; + ;; + * ) + if (( $COMP_CWORD >= 3 )) ; then + local prev3=${COMP_WORDS[COMP_CWORD-3]} + case $prev3 in + explicit_merge ) + _monotone_complete revision + _monotone_branches + ;; + *) + unset prev2 + unset prev3 + esac + else + unset prev2 + fi + ;; + esac + fi + if [ -z "$prev2" ] ; then + COMPREPLY=( $(compgen -W 'automate db agraph fload fmerge lca lcad + rcs_import annotate cat complete diff + list log ls status cert chkeypass dropkey + genkey trusted pull push reindex serve + sync certs fdata fdelta mdata mdelta + privkey pubkey rdata read cvs_import + approve comment disapprove tag testresult + checkout co explicit_merge fcommit heads + merge propagate refresh_inodeprints setup + set unset add attr ci commit drop + identify mv rename revert rm update' -- $cur) ) + fi + ;; esac ;; esac return 0 } +complete -F _monotone -o filenames monotone -complete -F _monotone -o default monotone ============================================================ --- debian/control 9476e79f8358ecb87a8e1c88bcd527973be62cd3 +++ debian/control cdd1fd5b651354ddefb3538b0913d703638c4958 @@ -18,3 +18,16 @@ branches and extensible metadata, uses an efficient peer-to-peer network protocol, performs history-sensitive merging, and delegates trust functions to client-side RSA certificates. + +Package: monotone-server +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, monotone +Description: A distributed version (revision) control system + Monotone is a free, distributed version control system. It provides + fully disconnected operation, manages complete tree versions, keeps + its state in a local transactional database, supports overlapping + branches and extensible metadata, uses an efficient peer-to-peer + network protocol, performs history-sensitive merging, and delegates + trust functions to client-side RSA certificates. + . + This package contains files to make running a monotone server eaiser. ============================================================ --- debian/docs 2d3662c90d12b7c5fb629bf5b29043bc077755bf +++ debian/monotone.docs 8be5e08b2f78838ff1214bb98084fb566be6b060 @@ -5,8 +5,5 @@ README README.changesets UPGRADE -monotone.html figures contrib -debian/README.Debian -debian/TODO.Debian ============================================================ --- debian/rules fe72fe2cb65bfb118258945b73978e05c506a700 +++ debian/rules ae7eb306a79b67c8c70d88225c08753e3e7533e9 @@ -1,6 +1,9 @@ #!/usr/bin/make -f include /usr/share/cdbs/1/rules/buildcore.mk include /usr/share/cdbs/1/class/autotools.mk include /usr/share/cdbs/1/rules/debhelper.mk #include /usr/share/cdbs/1/rules/simple-patchsys.mk + +install/monotone:: + cp contrib/monotone.bash_completion debian/monotone/etc/bash_completion.d/monotone