Subversion, Latex, Cent-OS (Linux)

Useful Subversion Links

http://www.abbeyworkshop.com/howto/misc/svn01/

Command reference:

http://www.digilife.be/quickreferences/QRC/Subversion%20Quick%20Reference%20Card.pdf

Installation of Subversion as an Apache-Module

Based on the guide

http://www.uweziegenhagen.de/academic/publications/svndtk.pdf

see also

http://linuxwave.blogspot.com/2008/02/installing-subversion-with-apache-on.html

Apache and Subversion: http://subversion.apache.org/

I want to use subversion and Linux (Cent-OS). In Cent-OS the apache-2 packet is called (yum search apache)

yum install httpd

Next we need the subversion packet. We search for it

# yum search apache | grep svn
mod_dav_svn.i386 : Apache server module for Subversion server.

Installation:

yum install mod_dav_svn.i386

Finally:

yum install subversion

Then I created a folder for the repository according to the guide. However, the file /etc/apache2/sites-available/default is not available in CentOs. I modified

gedit /etc/httpd/conf.d/subversion.conf

To start the apache server type

/sbin/service httpd start

To do this on every startup I used http://dev.antoinesolutions.com/apache-server

/sbin/chkconfig –levels 235 httpd on

Then I found a test-page on http://localhost/ but I could not access http://localhost/svn/

So somehow the integration does not work so far. I followed http://svnbook.red-bean.com/en/1.0/ch06s04.html

Open the config-File

gedit /etc/httpd/conf/httpd.conf

Added the line

LoadModule dav_svn_module     modules/mod_dav_svn.so

at the end of all the LoadModule commands, then a restart…

/sbin/service httpd restart

and obtained the message

Stopping httpd:                                            [  OK  ]
Starting httpd: [Tue Feb 08 13:35:55 2011] [warn] module dav_svn_module is already loaded, skipping

so this seems to be not necessary… I also added

<Location /repos>
DAV svn
SVNPath /home/theo/smeuren/samba/user/subversion-repo
</Location>

to the config-file, restarted, no effect…

The reason for all of this is due to the file

/etc/httpd/conf.d/subversion.conf

where all this configurations are allready in. So this file is used and I removed everything from httpd.conf again..

Also uncommenting

NameVirtualHost *:80

in httpd.conf did not work http://dev.antoinesolutions.com/apache-server

Finally I found out that the webpage should be according to <Location /repos>

http://localhost/repos/

Then it displazed information but seems to be broken. Finally I solved the problem: I could not change the owner of the files on the share to apache as suggested here

http://linuxwave.blogspot.com/2008/02/installing-subversion-with-apache-on.html

chown apache.apache -R repos — change ownership of ‘repos’ to apach

seems to be crucial..

Installation of Subversion on UBUNTU (10.10)

sudo apt-get install apache2

sudo apt-get install libapache2-svn

sudo apt-get install subversion

Installation of RabbitVCS

according to http://wiki.rabbitvcs.org/wiki/install/rhelcentos5

yum install pygtk2 subversion subversion-devel gcc gcc-c++ neon-devel python-devel pygtk2-devel eel2 eel2-devel python-configobj nautilus-devel meld

But two packages do not exist

No package python-configobj available.
No package meld available.

We install them by hand

http://meld.sourceforge.net/

make, make install

http://www.voidspace.org.uk/python/configobj.html#downloading (http://pypi.python.org/pypi/configobj/)

python setup.py install

To compile I needed

yum install intltool.i386

Then I followed step 3:

3. Download nautilus-python bindings at http://ftp.gnome.org/pub/GNOME/sources/nautilus-python

  • Make sure you get v0.5.0, NOT v0.5.1
  • Build/install with: ./configure ; make; su -c ‘make install’

Then I followed Step 5: (there is no step 4)

Download and build the pysvn extension source kit. You’ll need one built to work for subversion 1.4. Version 1.6.3 works well.

cd Source
python setup.py backport
python setup.py configure
make
mkdir /usr/lib/python2.4/site-packages/pysvn
cp pysvn/__init__.py /usr/lib/python2.4/site-packages/pysvn
cp pysvn/_pysvn_2_4.so /usr/lib/python2.4/site-packages/pysvn

Finally step 6:

Download the tarball and from the top folder type:

python setup.py install

Finally, we configure the clients… (go to the subfolders…)

Once that is done working, look in the clients folder and read the README file for each client/plugin to learn how they are installed.

RabbitVCS NautilusOld Extension

cd clients/nautilusold/

cp RabbitVCS.py /usr/lib/nautilus/extensions-1.0/python

Restart nautilus with the following commands:
$ nautilus -q
$ nohup nautilus > /dev/null &

It did not work, I do not see any context-menu…

Finally I also copied the extensions to my local plugin-folder. Since I had to use the old nautilus-extensions, everything seems to be not too cool. Anyhow, it is working now.

Subversion Web-Access

http://www.websvn.info/

under Ubuntu:

sudo apt-get install websvn

Under Ubuntu the configuration is then found in (http://www.howtoforge.com/debian_subversion_websvn)

/etc/websvn/config.php

There one has to uncomment and modify the following line

$config->parentPath(‘Path to repository’);

Apache and a different user name and group

I want to force apache to run under my personal user name and group. This can be done according to http://www.linuxquestions.org/questions/slackware-14/how-to-change-apache-user-and-group-392738/

User
Group

in httpd.conf

works perfect.

In Ubuntu one has to check /etc/apache2/apache.conf

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

Therefore we set in the file /etc/apache2/envvar

export APACHE_RUN_USER=xxx
export APACHE_RUN_GROUP=xxx

Subversion and Latex

A book about subversion: http://svnbook.red-bean.com/en/1.5/svn-book.pdf

Subversion workflow

I start a new project using

cd ~/samba/user/svn/repos/ (go to the repository path)

svnadmin create “NAME”  (create a project NAME)

It has the adress

http://localhost/svn/repos/NAME/

Import an existing project to this svn-repository for the first time:

svn import http://localhost/svn/repos/NAME/ -m “project created” (import to project NAME, comment project created)

Commiting changes:

svn ci -m “LOGMESSAGE”

Accessing Subversion information from LaTex using svn-multi. This package can be included using

\usepackage[table]{svn-multi}
\svnidlong
{$HeadURL$}
{$LastChangedDate$}
{$LastChangedRevision$}
{$LastChangedBy$}

After the Names between the dollar signs the corresponding informations are added during a commit by subversion.

Before one can use it one has to enable the corresponding Subversion keywords to be updated for the LaTex-File which contains them http://www.technovelty.de/subversion-wie-benutzt-man-keywords, http://ftp.uni-erlangen.de/mirrors/CTAN/macros/latex/contrib/svn/svn.pdf

svn propset svn:keywords “Date Id HeadURL LastChangedDate LastChangedRevision LastChangedBy” NAMEOFFILE.tex

Attention: Do not simply copy this, ensure you use the right quotes!!!!

In the LaTex-Document one can print a table with all important information

\tableofrevisions

One can browse all projects using WebSVN:

http://localhost/WebSVN/

Using subversion via sshfs

At home I mount the remote folder (containing my repositories)

sshfs -o idmap=user user@server: /home/me/remote

Then I can use at home my subversion-installation and access this repository. If the apache2 is running under my one user name at home and the idmap=user is used (https://help.ubuntu.com/community/SSHFS#Usage) no problems arise and I can access the repository.

Subversion version conflict

At home I work on Ubuntu 10.10 and at work I have to use a CentOS 5 which uses older code. After updating my repository at work I obtained the error

svn: This client is too old to work with working copy

http://blog.root1024.ch/betriebssystem/linux/debian-linux-betriebssystem/this-client-is-too-old-to-work-with-working-copy/

So I have to update my subversion client…

A  yum info subversion returned

Installed Packages
Name       : subversion
Arch       : i386
Version    : 1.4.2

The current version is http://subversion.tigris.org/downloads/subversion-1.6.15.tar.gz as of 2011-02-16. So I had to compile the sources again.

After upgrading I could again commit my files!

Subversion and WebSVN – Version conflict

I obtained the following error after manually updating to Subversion 1.6.x

Repository uses a newer format than Subversion 1.4.2 can read. (“Expected FS format ‘2’; found format ‘4’.”)

I have now more detailed information. Both under my onw user name and the root account I have

svn –version
svn, version 1.6.15 (r1038135)
compiled Feb 16 2011, 17:10:06

However, I did not rebuild the apache-module, therefore apache replies

Powered by Subversion version 1.4.2 (r22196).

(Direct access to the repository)

From the direct webinterface I can still brows all repositories created with subversion 1.4.x but not the newer one. I obtain an error page

Could not open the requested SVN filesystem

The WebSVN does not work completely, even the old repositories are not displayed properly.

So I think I have to rebuild the apache-module…

Compiling the apache-module of subversion

A naief configure resulted in

==================================================================
WARNING: skipping the build of mod_dav_svn
try using –with-apxs
==================================================================

According to http://narolainfotech.blogspot.com/2009/04/installation-of-apache-extention-tool.html I also installed

yum install apr-util-devel.i386
yum install expat-devel.i386
yum install apr-devel.i386

but they where already installed.

Now I found out that I need http://www.centos.org/modules/newbb/viewtopic.php?viewmode=flat&topic_id=3808&forum=31

and now it is located under /usr/sbin/apxs and I could configure subversion using

sh configure –with-apxs=/usr/sbin/apxs

Everything went well. After make and make install I obtained

svn –version
svn, version 1.6.15 (r1038135)
compiled Feb 22 2011, 13:52:51

However, another /sbin/service httpd restart did not show any difference. However I obtained

Starting httpd: [Tue Feb 22 14:05:03 2011] [warn] module dav_svn_module is already loaded, skipping

So I copied the module by hand

cp subversion/mod_dav_svn/.libs/mod_dav_svn.so /usr/lib/httpd/modules/mod_dav_svn.so

And I restarted apache again… I stoped it and started it again and finally

Powered by Subversion version 1.6.15 (r1038135).

So now the module is also the correct version… Now the WebSVN remains…

The problem was

/usr/local/bin/svn –version

returned the proper version. however

/usr/bin/svn –version

did not. So the fix was simply

cp /usr/local/bin/svn* /usr/bin


Compiling subversion

2011-02-22: Have a look at section Compiling the apache-module of subversion. This should also be compiled in order to avoid version conflicts…

(1) obtain the latest version from http://subversion.apache.org/source-code.html

I tried to configure the code and obtained

An appropriate version of sqlite could not be found.  We recommmend
3.6.13, but require at least 3.4.0.

yum returned

Package sqlite-3.3.6-5.i386 already installed and latest version

So we have to install it from http://www.sqlite.org/. I used http://www.sqlite.org/sqlite-autoconf-3070500.tar.gz Configure and make went fine and also make install worked.

After I installed sqlite the subverion configure went through without further problems. Then I used make and  I obtained

/home/theo/smeuren/install/subversion-1.6.15/subversion/libsvn_subr/.libs/libsvn_subr-1.so: undefined reference to `sqlite3_open_v2′
/home/theo/smeuren/install/subversion-1.6.15/subversion/libsvn_subr/.libs/libsvn_subr-1.so: undefined reference to `sqlite3_config’
/home/theo/smeuren/install/subversion-1.6.15/subversion/libsvn_subr/.libs/libsvn_subr-1.so: undefined reference to `sqlite3_initialize’
/home/theo/smeuren/install/subversion-1.6.15/subversion/libsvn_subr/.libs/libsvn_subr-1.so: undefined reference to `sqlite3_prepare_v2′
/home/theo/smeuren/install/subversion-1.6.15/subversion/libsvn_subr/.libs/libsvn_subr-1.so: undefined reference to `sqlite3_threadsafe’

It seems to be a known problem http://www.svnforum.org/threads/36857-SQLite-compiled-for-3.6.13-but-running-with-3.3.6

The right hint can be found in the INSTALL file according to http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&viewType=browseAll&dsMessageId=2059450

There one finds

13. SQLite  (REQUIRED)

Subversion (starting with version 1.6) requires SQLite version
3.4.0 or above, and you can meet this dependency several ways:
* Use an SQLite amalgamation file.
* Specify an SQLite installation to use.
* Let Subversion find an installed SQLite.

To use an SQLite-provided amalgamation, just drop sqlite3.c into
Subversion’s sqlite-amalgamation/ directory, or point to it with the
–with-sqlite configure option.  This file also ships with the Subversion
dependencies distribution, or you can download it from SQLite:

http://www.sqlite.org/download.html

So I created a sqlite-amalgamation directory and put the sqlite3.c from the sqlite-sources there. After that I configured again and finally tried make. It worked!!!

After make install I obtained

svn –version

svn, version 1.6.15 (r1038135)
compiled Feb 16 2011, 17:10:06

Problem creating new repository

I obtained the following error: svn: Couldn’t perform atomic initialization

The solution was given by http://www.azazia.com/kb/entry/62

I had to use

svnadmin create –pre-1.6-compatible –fs-type fsfs xxx

SVN 200 OK error

http://stackoverflow.com/questions/1025377/an-svn-error-200-ok-when-checking-out-from-my-online-repo

change the repository URL for a working copy

http://blogs.dovetailsoftware.com/blogs/kmiller/archive/2007/04/10/how-to-change-the-url-of-your-svn-repository

svn switch --relocate FROM TO

SVN Error: File or directory is out of date; try updating

http://bealetech.com/blogs/sean/2010/01/subversion-file-or-directory-out-date-try-updating
http://www.resounddesign.co.uk/blog/2-pesky-svn-problems-fixed

For me going to the folder which contains the problematic file and writing svn update allowed me to fix the problem in the appearing dialog.

How to obtain a list of all unversioned files

http://stackoverflow.com/questions/216049/how-do-i-get-a-list-of-all-unversioned-files-from-svn

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: