From: Oliver Ertl Date: Wed, 18 Jul 2007 14:16:39 +0000 (+0000) Subject: subversion: X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;h=fb5e806054ba480c79679beafc668215b90ab532 subversion: * Add a init script which uses UCI * Add a default UCI configuration file SVN-Revision: 8040 --- diff --git a/net/subversion/Makefile b/net/subversion/Makefile index f9c2d9840c..9258e5bd3a 100644 --- a/net/subversion/Makefile +++ b/net/subversion/Makefile @@ -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 index 0000000000..3297c8de1d --- /dev/null +++ b/net/subversion/files/subversion.config @@ -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 index 0000000000..f83e22ec07 --- /dev/null +++ b/net/subversion/files/subversion.init @@ -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 +}