diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index 064b2ba..0000000 --- a/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -monotone-0.30.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..529fe03 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +monotone-0.38.tar.gz diff --git a/Makefile b/Makefile deleted file mode 100644 index 659e999..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: monotone -# $Id$ -NAME := monotone -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/README.monotone-server b/README.monotone-server index d5d2299..a2640d3 100644 --- a/README.monotone-server +++ b/README.monotone-server @@ -10,7 +10,7 @@ server instances from people using monotone.) The /etc/monotone directory serves as ~/.monotone for the server. This directory and its contents are not writable by the "monotone" user ID under -which the network server runs. The database lives in /var/db/monotone, +which the network server runs. The database lives in /var/lib/monotone, which the "monotone" user ID must write to. The init.d script will generate a private key for the server to use, if diff --git a/monotone.init b/monotone.init index b367162..967ab15 100644 --- a/monotone.init +++ b/monotone.init @@ -8,6 +8,20 @@ # pidfile: /var/run/monotone/monotone-server.pid # config: /etc/sysconfig/monotone # config: /etc/monotone/monotonerc +# +### BEGIN INIT INFO +# Provides: monotone +# Required-Start: $local_fs $network $named $time +# Required-Stop: $local_fs $network +# Short-Description: start and stop Monotone netsync protocol server +# Description: 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, exchanges work over plain network protocols, +# performs history-sensitive merging, and delegates trust +# functions to client-side RSA certificates. +### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions @@ -29,6 +43,8 @@ MTSERVER=/usr/sbin/monotone-server MONOTONE_PIDFILE=/var/run/monotone/monotone-server.pid MONOTONE_LOGFILE=${MONOTONE_LOGFILE:-/var/log/monotone.log} MONOTONE_OLDDB=/var/db/monotone/server.db +MONOTONE_OLDDBFILE=/var/db/monotone/server.mtn +MONOTONE_OLDPPFILE=/var/db/monotone/passphrase.lua random_passphrase() { @@ -39,11 +55,34 @@ random_passphrase() umask 077 +check_db_version() +{ + db_version=`runuser -s /bin/bash - ${MONOTONE_USER:-monotone} \ + -c "LC_ALL=C \ + $MT $MONOTONE_RCOPTS $MONOTONE_DBOPTS \ + db version"` || exit 2 + set -- $db_version + [ "$5" == "(usable)" ] + return $? +} + # See how we were called. case "$1" in start) + if [ -e $MONOTONE_OLDDBFILE -a ! -e $MONOTONE_DBFILE ]; then + echo -n $"Moving" "$MONOTONE_OLDDBFILE" $"to" "$MONOTONE_DBFILE" + if mv "$MONOTONE_OLDDBFILE" "$MONOTONE_DBFILE"; then + failure + echo + exit + else + success + echo + fi + rmdir 2> /dev/null /var/db/monotone + fi if [ -e $MONOTONE_DBFILE ]; then - $0 migrate + check_db_version || $0 migrate elif [ -e $MONOTONE_OLDDB ]; then echo -n $"Pre-0.26 monotone database must be migrated by hand: " failure @@ -84,11 +123,11 @@ case "$1" in [ $RETVAL = 0 ] && rm -f /var/lock/subsys/monotone echo ;; - restart) + restart|force-reload) $0 stop $0 start ;; - condrestart) + condrestart|try-restart) [ -e /var/lock/subsys/monotone ] && $0 restart ;; status) @@ -97,10 +136,10 @@ case "$1" in ;; init) echo -n $"Initializing database" "${MONOTONE_DBFILE}: " - { [ -d /var/db/monotone ] || + { [ -d /var/lib/monotone ] || /usr/bin/install -o ${MONOTONE_USER:-monotone} \ -g ${MONOTONE_GROUP:-monotone} \ - -m 0770 -d /var/db/monotone; } && + -m 0770 -d /var/lib/monotone; } && runuser -s /bin/bash - ${MONOTONE_USER:-monotone} -c "umask 007; \ $MT $MONOTONE_RCOPTS $MONOTONE_DBOPTS db init" && success $"database initialization" || @@ -109,8 +148,14 @@ case "$1" in echo ;; genkey) - MONOTONE_KEYID=${2:-${MONOTONE_KEYID:-`/bin/hostname -f`}} - MONOTONE_PPFILE=${MONOTONE_PPFILE:-/var/db/monotone/passphrase.lua} + MONOTONE_KEYID=${2:-${MONOTONE_KEYID:-monotone@`/bin/hostname -f`}} + MONOTONE_PPFILE=${MONOTONE_PPFILE:-/etc/monotone/passphrase.lua} + if [ -s "$MONOTONE_PPFILE" -a -s "$MONOTONE_KEYDIR/$MONOTONE_KEYID" ] + then + echo >&2 "$0:" $"Server key already installed" + echo >&2 "$0:" $"To lose old key remove file" "$MONOTONE_PPFILE" + exit 1 + fi echo -n $"Generating RSA key for server $MONOTONE_KEYID" tmp=/tmp/mtserver$$ if @@ -120,6 +165,7 @@ case "$1" in genkey $MONOTONE_KEYID > /dev/null 2>&1) && /bin/chgrp ${MONOTONE_GROUP:-monotone} \ "$MONOTONE_KEYDIR/$MONOTONE_KEYID" && + /bin/chmod 0640 "$MONOTONE_KEYDIR/$MONOTONE_KEYID" && cat > $tmp < /dev/null 2>&1 || : fi -%postun +%preun if [ $1 -eq 0 ] then /sbin/install-info --delete %{_infodir}/monotone.info %{_infodir}/dir > /dev/null 2>&1 || : @@ -124,9 +133,8 @@ fi %{_bindir}/mtn %{_infodir}/monotone.info* -%{_mandir}/man1/mtn.1* %{_datadir}/emacs/site-lisp/monotone*.el* - +%{_sysconfdir}/bash_completion.d %files server %doc README.monotone-server @@ -141,13 +149,16 @@ fi %attr(0440,root,monotone) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) %{_sysconfdir}/monotone/passphrase.lua %attr(0640,root,monotone) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) %{_sysconfdir}/monotone/read-permissions %attr(0640,root,monotone) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) %{_sysconfdir}/monotone/write-permissions -%dir %attr(0770,monotone,monotone) %{_localstatedir}/db/monotone -%attr(0660,monotone,monotone) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) %{_localstatedir}/db/monotone/server.mtn +%dir %attr(0770,monotone,monotone) %{_localstatedir}/lib/monotone +%attr(0660,monotone,monotone) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) %{_localstatedir}/lib/monotone/server.mtn %pre server -# Add the "monotone" user -/usr/sbin/useradd -c "Monotone Netsync Server" \ - -s /sbin/nologin -r -d %{_localstatedir}/db/monotone monotone 2> /dev/null || : +# Add "monotone" user per http://fedoraproject.org/wiki/Packaging/UsersAndGroups +getent group monotone > /dev/null || groupadd -r monotone +getent passwd monotone > /dev/null || +useradd -r -g monotone -r -d %{_localstatedir}/lib/monotone -s /sbin/nologin \ + -c "Monotone Netsync Server" monotone +exit 0 %post server # Register the monotone service @@ -164,6 +175,52 @@ fi %changelog +* Sat Dec 22 2007 Roland McGrath - 0.38-2 +- Fix monotone-server user creation. (#426607) +- Moved monotone-server database to /var/lib. (#426608) +- Use monotone@ in server key name. (#426609) + +* Fri Dec 21 2007 Roland McGrath - 0.38-1 +- Updated for 0.38 release. + +* Sat Oct 27 2007 Roland McGrath - 0.37-3 +- Updated for 0.37 release. +- Prevent destroying old passphrase file with 'service monotone genkey'. +- Put LSB standard comments in monotone.init for monotone-server subpackage. + +* Tue Aug 28 2007 Roland McGrath - 0.36-2 +- Clean up %%pre script per packaging guidelines. +- Disable ppc and ppc64 builds temporarily since make check fails. (#259161) + +* Fri Aug 3 2007 Roland McGrath - 0.36-1 +- Updated for 0.36 release. + +* Fri Jul 06 2007 Florian La Roche - 0.35-4 +- add more requires + +* Wed May 16 2007 Roland McGrath - 0.35-3 +- Fix locale dependency in monotone-server init script. (#213893) + +* Wed May 9 2007 Roland McGrath - 0.35-2 +- Updated for 0.35 release. +- Avoid unnecessary "db migrate" in monotone-server init script. (#213893) + +* Wed Apr 4 2007 Roland McGrath - 0.34-1 +- Updated for 0.34 release. + +* Thu Mar 1 2007 Roland McGrath - 0.33-1 +- Updated for 0.33 release. +- Install monotone.bash_completion file. + +* Wed Feb 28 2007 Roland McGrath - 0.32-1 +- Updated for 0.32 release. + +* Thu Dec 21 2006 Kevin Fenzi - 0.31-2 +- Bump and rebuild to fix upgrade path + +* Sat Nov 11 2006 Roland McGrath - 0.31-1 +- Updated for 0.31 release. + * Tue Oct 10 2006 Roland McGrath - 0.30-1 - Updated for 0.30 release. - Fix service script to work around buggy init.d/functions. (#198761) diff --git a/monotone.sysconfig b/monotone.sysconfig index a0a5c23..a61496a 100644 --- a/monotone.sysconfig +++ b/monotone.sysconfig @@ -1,10 +1,10 @@ MONOTONE_CONFDIR=/etc/monotone MONOTONE_KEYDIR=/etc/monotone/private-keys -MONOTONE_DBFILE=/var/db/monotone/server.mtn +MONOTONE_DBFILE=/var/lib/monotone/server.mtn MONOTONE_PPFILE=/etc/monotone/passphrase.lua MONOTONE_RCOPTS="--confdir=$MONOTONE_CONFDIR" MONOTONE_DBOPTS="--db=$MONOTONE_DBFILE --keydir=$MONOTONE_KEYDIR" MONOTONE_PPOPTS="--rcfile=$MONOTONE_PPFILE" -MONOTONE_SERVE_OPTS="'*'" +MONOTONE_SERVE_OPTS="" diff --git a/sources b/sources index 88f2945..930bdba 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -94a1f8369162f7a7df8596b365a1d846 monotone-0.30.tar.gz +c1a0d2619f451a664289b042c104860d monotone-0.38.tar.gz