install subversion client 1.8 on ubuntu 12.04

Apr 06, 2014 12:28


sudo sh -c 'echo "# WANdisco Open Source Repo" >> /etc/apt/sources.list.d/WANdisco.list'
sudo sh -c 'echo "deb http://opensource.wandisco.com/ubuntu precise svn18" >> /etc/apt/sources.list.d/WANdisco.list'
wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- | sudo apt-key add -
sudo apt-get update

To confirm that the new subversion package has been detected, run:

apt-cache show subversion | grep '^Version:'

If the 1.8 package is listed, you should then be able to install as normal:

sudo apt-get install subversion

(с) from here: http://askubuntu.com/questions/312568/where-can-i-find-a-subversion-1-8-binary

Subversion simple serve with svn:// and managment users in one place

* make folder for repositoryes, in my example this is "/srv/svn-reps"

#mkdir /srv/svn-reps

* add new user for run svn serve and grant access for folder:

#useradd subversion --create-home --home-dir /srv/svn-reps --shell /sbin/nologin
#chown -R subversion:subversion /srv/svn-reps

* make file /etc/init.d/svnserve - this is for autostart svnserve after reboot:
[/etc/init.d/svnserve]
#!/bin/sh -e

# Get LSB functions
. /lib/lsb/init-functions
. /etc/default/rcS

SVNSERVE=/usr/bin/svnserve
SVN_USER=subversion
SVN_GROUP=subversion
SVN_REPO_PATH=/srv/svn-reps

# Check that the package is still installed
[ -x $SVNSERVE ] || exit 0;

case "$1" in
start)
log_begin_msg "Starting svnserve..."
umask 002
if start-stop-daemon --start \
--chuid $SVN_USER:$SVN_GROUP \
--exec $SVNSERVE \
-- -d -r $SVN_REPO_PATH; then
log_end_msg 0
else
log_end_msg $?
fi
;;

stop)
log_begin_msg "Stopping svnserve..."
if start-stop-daemon --stop --exec $SVNSERVE; then
log_end_msg 0
else
log_end_msg $?
fi
;;

restart|force-reload)
"$0" stop && "$0" start
;;

*)
echo "Usage: /etc/init.d/svnserve {start|stop|restart|force-reload}"
exit 1
;;
esac

exit 0


So now we ready to create repositoryes:

#mkdir /srv/svn-reps/test1
#svnadmin create /srv/svn-reps/test1
#mkdir /srv/svn-reps/test2
#svnadmin create /srv/svn-reps/test2
#chown -R subversion:subversion /srv/svn-reps

We get some like this:

#ls -l /srv/svn-reps/
drwxr-xr-x 6 subversion subversion 4096 Apr 29 15:33 test1
drwxr-xr-x 6 subversion subversion 4096 Apr 29 15:35 test2

Now need copy or move two files from one repository,

#cp /srv/svn-reps/conf/test1/authz /srv/svn-reps/test1/conf/passwd /srv/svn-reps/

and modify each svnserve.conf in folders ./conf/test1 and ./conf/test2 to this context:
[svnserve.conf]
[general]
anon-access = none
auth-access = write
password-db = ../../passwd
authz-db = ../../authz

Now ready to manage users and groups in the two files /srv/svn-reps/authz and /srv/svn-reps/passwd:
Example passwd file:
[passwd]
[users]
user1 = pass1
user2 = pass2
user3 = pass3
user4 = pass4

Example authz file:
[authz]
[groups]
readonly = user4
admins = user1
developers = user2, user3
# ==========================
[:/]
@admins = rw
* =

[test1:/]
@readonly = r
@developers = rw
* =

[test2:/]
@readonly = r
@developers = rw
* =

разработка, tools, программирование, svn, subversion, shell, linux

Previous post Next post
Up