subversion:
authorOliver Ertl <oliver@ertl-net.net>
Wed, 18 Jul 2007 14:16:39 +0000 (14:16 +0000)
committerOliver Ertl <oliver@ertl-net.net>
Wed, 18 Jul 2007 14:16:39 +0000 (14:16 +0000)
 * Add a init script which uses UCI
 * Add a default UCI configuration file

SVN-Revision: 8040

net/subversion/Makefile
net/subversion/files/subversion.config [new file with mode: 0644]
net/subversion/files/subversion.init [new file with mode: 0755]

index f9c2d9840c29055d06a363041409be35fc023c41..9258e5bd3a8602466ff0b6a624fe855e81600c87 100644 (file)
@@ -93,6 +93,10 @@ endef
 define Package/subversion-server/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/svn{look,admin,dumpfilter,serve} $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_DATA) ./files/subversion.config $(1)/etc/config/subversion
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/subversion.init $(1)/etc/init.d/subversion
 endef
 
 $(eval $(call BuildPackage,subversion-libs))
diff --git a/net/subversion/files/subversion.config b/net/subversion/files/subversion.config
new file mode 100644 (file)
index 0000000..3297c8d
--- /dev/null
@@ -0,0 +1,3 @@
+config subversion
+       option path     '/var/local/svn'
+       option port     '3690'
diff --git a/net/subversion/files/subversion.init b/net/subversion/files/subversion.init
new file mode 100755 (executable)
index 0000000..f83e22e
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+START=50
+
+start_service () {
+       local section="$1"
+       config_get path "$section" path
+       config_get port "$section" port
+
+       if [ ! -d "$path" ]; then
+               echo "The subversion repository (${path}) does not exist."
+               echo "Create a new repository and/or change the path in /etc/config/subversion"
+               echo
+               echo "Create a new subversion repository with:"
+               echo "        mkdir -p /srv"
+               echo "        svnadmin create --fs-type fsfs /srv/svn"
+               echo
+               echo "Changing the path using UCI (default path is: /var/local/svn):"
+               echo "        uci set subversion.cfg1.path="/srv/svn""
+               echo "        uci commit"
+               echo "        /etc/init.d/subversion restart"
+               exit 1
+       fi
+
+       svnserve -d --listen-port ${port} -r ${path}
+}
+
+start() {
+       config_load "subversion"
+       config_foreach start_service subversion
+}
+
+stop() {
+       killall -9 svnserve
+}
+
+restart() {
+       stop
+       start
+}