pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/monotone-server Initial import of monotone-serve...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d3cfd810d655
branches:  trunk
changeset: 487286:d3cfd810d655
user:      jmmv <jmmv%pkgsrc.org@localhost>
date:      Wed Jan 12 12:52:50 2005 +0000

description:
Initial import of monotone-server, version 0.16 (number matches the
devel/monotone package it depends on):

Monotone is a free distributed version control system.  It provides a
simple, single-file transactional version store, with fully disconnected
operation and an efficient peer-to-peer synchronization protocol.  It
understands history-sensitive merging, lightweight branches, integrated
code review and 3rd party testing.  It uses cryptographic version naming
and client-side RSA certificates.  It has good internationalization
support, has no external dependencies, runs on NetBSD, Linux, Solaris,
OSX and Windows (among others), and is licensed under the GNU GPL.

This package provides all the necessary stuff to easily configure a
dedicated Monotone server.  Of special interest are the included rc.d
script and the monotone-server-init script, which will greatly simplify
the whole process.

diffstat:

 devel/monotone-server/DESCR                         |   13 ++
 devel/monotone-server/MESSAGE                       |    7 +
 devel/monotone-server/Makefile                      |   68 ++++++++++++
 devel/monotone-server/PLIST                         |    5 +
 devel/monotone-server/files/branches.conf           |    8 +
 devel/monotone-server/files/hooks.conf              |   40 +++++++
 devel/monotone-server/files/monotone-server-init.sh |  109 ++++++++++++++++++++
 devel/monotone-server/files/monotone.sh             |   35 ++++++
 8 files changed, 285 insertions(+), 0 deletions(-)

diffs (truncated from 317 to 300 lines):

diff -r f5675005f3f3 -r d3cfd810d655 devel/monotone-server/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/monotone-server/DESCR       Wed Jan 12 12:52:50 2005 +0000
@@ -0,0 +1,13 @@
+Monotone is a free distributed version control system.  It provides a
+simple, single-file transactional version store, with fully disconnected
+operation and an efficient peer-to-peer synchronization protocol.  It
+understands history-sensitive merging, lightweight branches, integrated
+code review and 3rd party testing.  It uses cryptographic version naming
+and client-side RSA certificates.  It has good internationalization
+support, has no external dependencies, runs on NetBSD, Linux, Solaris,
+OSX and Windows (among others), and is licensed under the GNU GPL.
+
+This package provides all the necessary stuff to easily configure a
+dedicated Monotone server.  Of special interest are the included rc.d
+script and the monotone-server-init script, which will greatly simplify
+the whole process.
diff -r f5675005f3f3 -r d3cfd810d655 devel/monotone-server/MESSAGE
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/monotone-server/MESSAGE     Wed Jan 12 12:52:50 2005 +0000
@@ -0,0 +1,7 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1.1.1 2005/01/12 12:52:50 jmmv Exp $
+
+You should now run 'monotone-server-init' to finish installation _before_
+enabling the server.  Then, follow the on-screen instructions.
+
+===========================================================================
diff -r f5675005f3f3 -r d3cfd810d655 devel/monotone-server/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/monotone-server/Makefile    Wed Jan 12 12:52:50 2005 +0000
@@ -0,0 +1,68 @@
+# $NetBSD: Makefile,v 1.1.1.1 2005/01/12 12:52:50 jmmv Exp $
+#
+
+DISTNAME=      monotone-server-0.16
+CATEGORIES=    devel
+MASTER_SITES=  # empty
+DISTFILES=     # empty
+
+MAINTAINER=    jmmv%NetBSD.org@localhost
+HOMEPAGE=      http://www.venge.net/monotone/
+COMMENT=       Simplifies the configuration of a dedicated Monotone server
+
+DEPENDS+=      monotone>=0.16:../../devel/monotone
+
+EXTRACT_ONLY=  # empty
+NO_BUILD=      yes
+NO_BUILDLINK=  yes
+NO_CHECKSUM=   yes
+USE_PKGINSTALL=        yes
+WRKSRC=                ${WRKDIR}
+
+RCD_SCRIPTS=           monotone
+
+PKG_SYSCONFSUBDIR=     monotone-server
+
+BUILD_DEFS+=           MONOTONE_GROUP MONOTONE_USER
+
+EXAMPLEDIR=            ${PREFIX}/share/examples/monotone-server
+CONF_FILES_PERMS=      ${EXAMPLEDIR}/branches.conf \
+                       ${PKG_SYSCONFDIR}/branches.conf \
+                       ${MONOTONE_USER} ${MONOTONE_GROUP} 600
+CONF_FILES_PERMS+=     ${EXAMPLEDIR}/hooks.conf \
+                       ${PKG_SYSCONFDIR}/hooks.conf \
+                       ${MONOTONE_USER} ${MONOTONE_GROUP} 600
+
+PKG_USERS=             ${MONOTONE_USER}:${MONOTONE_GROUP}::Monotone\\ dedicated\\ server:${VARBASE}/monotone:${SH}
+PKG_GROUPS=            ${MONOTONE_GROUP}
+
+SUBST_CLASSES+=                vars
+SUBST_STAGE.vars=      do-configure
+SUBST_MESSAGE.vars=    "Configuring sources."
+SUBST_FILES.vars=      ${WRKSRC}/*
+SUBST_SED.vars=                -e 's|@MONOTONE@|${PREFIX}/bin/monotone|g'
+SUBST_SED.vars+=       -e 's|@MONOTONE_GROUP@|${MONOTONE_GROUP}|g'
+SUBST_SED.vars+=       -e 's|@MONOTONE_USER@|${MONOTONE_USER}|g'
+SUBST_SED.vars+=       -e 's|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g'
+SUBST_SED.vars+=       -e 's|@SH@|${SH}|g'
+SUBST_SED.vars+=       -e 's|@VARBASE@|${VARBASE}|g'
+
+FILES_SUBST+=          MONOTONE_GROUP=${MONOTONE_GROUP}
+FILES_SUBST+=          MONOTONE_USER=${MONOTONE_USER}
+
+INSTALLATION_DIRS=     sbin
+
+do-extract:
+.for f in branches.conf hooks.conf monotone-server-init.sh
+       ${CP} ${FILESDIR}/${f} ${WRKSRC}
+.endfor
+.undef f
+
+do-install:
+       ${INSTALL_SCRIPT} ${WRKSRC}/monotone-server-init.sh \
+               ${PREFIX}/sbin/monotone-server-init
+       ${INSTALL_DATA_DIR} ${EXAMPLEDIR}
+       ${INSTALL_DATA} ${WRKSRC}/branches.conf ${EXAMPLEDIR}/branches.conf
+       ${INSTALL_DATA} ${WRKSRC}/hooks.conf ${EXAMPLEDIR}/hooks.conf
+
+.include "../../mk/bsd.pkg.mk"
diff -r f5675005f3f3 -r d3cfd810d655 devel/monotone-server/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/monotone-server/PLIST       Wed Jan 12 12:52:50 2005 +0000
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2005/01/12 12:52:50 jmmv Exp $
+sbin/monotone-server-init
+share/examples/monotone-server/branches.conf
+share/examples/monotone-server/hooks.conf
+@dirrm share/examples/monotone-server
diff -r f5675005f3f3 -r d3cfd810d655 devel/monotone-server/files/branches.conf
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/monotone-server/files/branches.conf Wed Jan 12 12:52:50 2005 +0000
@@ -0,0 +1,8 @@
+# $NetBSD: branches.conf,v 1.1.1.1 2005/01/12 12:52:50 jmmv Exp $
+#
+# This file belongs to the monotone-server package.  It lists all branches
+# that will be served by Monotone, each one in its own line.
+#
+
+#net.example.project1
+#net.example.project2.subbranch
diff -r f5675005f3f3 -r d3cfd810d655 devel/monotone-server/files/hooks.conf
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/monotone-server/files/hooks.conf    Wed Jan 12 12:52:50 2005 +0000
@@ -0,0 +1,40 @@
+-- $NetBSD: hooks.conf,v 1.1.1.1 2005/01/12 12:52:50 jmmv Exp $
+-- 
+-- This file belongs to the monotone-server package.  This is the typical
+-- ~/.monotonerc configuration file, but is system-wide.
+-- 
+
+function get_passphrase(identity)
+--    if (identity == "PUT_KEYNAME_HERE") then
+--        return "PUT_PASSPHRASE_HERE"
+--    end
+    return false
+end
+
+function get_netsync_read_permitted (collection, identity)
+--    if (collection == "net.example.project1") then
+--        if (identity == "user1%example.org@localhost") then return true end
+--    end
+--    if (collection == "net.example.project2.subbranch") then
+--        if (identity == "user1%example.org@localhost") then return true end
+--        if (identity == "user2%example.org@localhost") then return true end
+--    end
+    return false
+end
+
+function get_netsync_write_permitted (collection, identity)
+--    if (collection == "net.example.project1") then
+--        if (identity == "user1%example.org@localhost") then return true end
+--    end
+--    if (collection == "net.example.project2.subbranch") then
+--        if (identity == "user1%example.org@localhost") then return true end
+--        if (identity == "user2%example.org@localhost") then return true end
+--    end
+    return false
+end
+
+function get_netsync_anonymous_read_permitted (collection)
+--    if (collection == "net.example.project1") then return true end
+--    if (collection == "net.example.project2.branch2") then return true end
+    return false
+end
diff -r f5675005f3f3 -r d3cfd810d655 devel/monotone-server/files/monotone-server-init.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/monotone-server/files/monotone-server-init.sh       Wed Jan 12 12:52:50 2005 +0000
@@ -0,0 +1,109 @@
+#!@SH@
+#
+# $NetBSD: monotone-server-init.sh,v 1.1.1.1 2005/01/12 12:52:50 jmmv Exp $
+#
+
+progname=$(basename $0)
+
+MONOTONE=@MONOTONE@
+MONOTONE_GROUP=@MONOTONE_GROUP@
+MONOTONE_USER=@MONOTONE_USER@
+PKG_SYSCONFDIR=@PKG_SYSCONFDIR@
+VARBASE=@VARBASE@
+
+if [ $(id -u) -ne 0 ]; then
+    echo "${progname}: this program must be run as \`root'" 1>&2
+    exit 1
+fi
+
+cat <<EOF
+The monotone package is currently configured to use the
+${VARBASE}/monotone directory to hold the public database.
+You may now change this default path to something else that is
+more suitable for your system, if you wish.
+
+EOF
+
+printf "Enter home directory [${VARBASE}/monotone]: "
+read home
+: ${home:=${VARBASE}/monotone}
+
+if [ ${home} != ${VARBASE}/monotone ]; then
+
+    if ! usermod -d ${home} ${MONOTONE_USER}; then
+        echo "cannot modify home directory of user " \
+             "\`${MONOTONE_USER}'" 1>&2
+        exit 1
+    fi
+
+    echo "monotone_home=${home}" >>${PKG_SYSCONFDIR}/rc.conf
+fi
+
+cat <<EOF
+
+In order to serve a collection, you must now create a public/private key
+pair to access the database.  This has to be _different_ to the key pair
+you use for development; it will only be used by the server process.
+
+The key name should be in the form of an email address.  Typicall, it will
+be something like monotone@your_host_name.
+
+I have determined that monotone@$(hostname) is probably a good choice.
+
+EOF
+printf "Enter key name [monotone@$(hostname)]: "
+read keyname
+: ${keyname:=monotone@$(hostname)}
+
+if [ ! -d ${home} ]; then
+    echo "Initializing new home directory: \`${home}'"
+    mkdir -p ${home}
+    chmod 755 ${home}
+    chown ${MONOTONE_USER}:${MONOTONE_GROUP} ${home}
+fi
+
+cd ${home}
+
+echo "Initializing database: \`${home}'/monotone.db"
+${MONOTONE} --db=monotone.db db init
+
+cat <<EOF
+
+Monotone will now ask you for a passphrase to protect the key pair we are
+creating.  Choose a hard one and write it down temporarily; you will need
+to put it in one of the configuration files in a later step.  After that,
+you can forget about it (assuming you have a safe copy).
+
+EOF
+
+${MONOTONE} --db=monotone.db genkey ${keyname}
+${MONOTONE} --db=monotone.db pubkey ${keyname} >${keyname}-public
+${MONOTONE} --db=monotone.db privkey ${keyname} >${keyname}-private
+
+chown ${MONOTONE_USER}:${MONOTONE_GROUP} monotone.db \
+      ${keyname}-public ${keyname}-private
+chmod 600 monotone.db
+chmod 444 ${keyname}-public
+chmod 400 ${keyname}-private
+
+cat <<EOF
+
+Initialization process finished!
+
+You should now backup the following files and store them in a safe place
+in case you need to reconstruct the database from scratch:
+
+    ${home}/${keyname}-public
+    ${home}/${keyname}-private
+
+At last, edit the following files to finish the configuration of your
+new server:
+
+    ${PKG_SYSCONFDIR}/branches.conf
+    ${PKG_SYSCONFDIR}/hooks.conf
+
+Once finished, use the installed rc.d script (monotone) to start the
+dedicated server process.
+EOF
+
+exit 0
diff -r f5675005f3f3 -r d3cfd810d655 devel/monotone-server/files/monotone.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/monotone-server/files/monotone.sh   Wed Jan 12 12:52:50 2005 +0000
@@ -0,0 +1,35 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: monotone.sh,v 1.1.1.1 2005/01/12 12:52:50 jmmv Exp $
+#
+# PROVIDE: monotone
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+if [ -f "@PKG_SYSCONFDIR@/rc.conf" ]; then
+    . @PKG_SYSCONFDIR@/rc.conf
+fi
+
+if [ -f "@PKG_SYSCONFDIR@/branches.conf" ]; then
+    monotone_branches=$(cat @PKG_SYSCONFDIR@/branches.conf | grep -v '^#')
+fi
+
+: ${monotone_group=@MONOTONE_GROUP@}



Home | Main Index | Thread Index | Old Index