User Tools

Site Tools


en:developer:install_svn

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:developer:install_svn [2017/07/11 08:50] – [Installing Perl: compiling perl from source] anupamaen:developer:install_svn [2023/03/13 01:46] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== SVN Installation ====== 
  
-===== Windows ===== 
  
  
-===== Mac =====+====== SVN Installation ====== 
 + 
 +===== Windows =====
  
-===== Linux =====+===== Linux and Mac =====
  
 This covers installing subversion from a source tarball, for client-type uses. This document is based on an install of Subversion-1.4.3.tar.gz, but the install procedure should be similar for other versions as well. This does NOT cover installing Subversion as a server - some other steps are required for that. And it does not cover the procedure for compiling the 'bleeding-edges' version of subversion, which is a little different and more complicated (starting with the fact that you need subversion already installed in order to do it...?) This covers installing subversion from a source tarball, for client-type uses. This document is based on an install of Subversion-1.4.3.tar.gz, but the install procedure should be similar for other versions as well. This does NOT cover installing Subversion as a server - some other steps are required for that. And it does not cover the procedure for compiling the 'bleeding-edges' version of subversion, which is a little different and more complicated (starting with the fact that you need subversion already installed in order to do it...?)
Line 21: Line 21:
 zlib is a library with a number of compression and decompression functions, used by Subversion internally. This is usually installed so feel free to start the installation without checking, just remember that if the installation fails, it might be because zlib is not installed. zlib is a library with a number of compression and decompression functions, used by Subversion internally. This is usually installed so feel free to start the installation without checking, just remember that if the installation fails, it might be because zlib is not installed.
  
-==== Neon ====+==== Neon - for older versions of Subversion ====
 You will need neon installed in order to access the Greenstone repository over the internet, via WebDAV. You will need neon installed in order to access the Greenstone repository over the internet, via WebDAV.
 Neon ensures that the subversion client program can handle repositories hosted on http, not just those on a local disk. (Also, if you are going to be hosting repositories over http, you will need neon so you can test those repositories.) Neon ensures that the subversion client program can handle repositories hosted on http, not just those on a local disk. (Also, if you are going to be hosting repositories over http, you will need neon so you can test those repositories.)
  
 +==== OpenSSL, Scons, Serf - for newer versions of Subversion (e.g. 1.8.18) ====
 +You will need to grab and compile up OpenSSL, grab and untar Scons and use this to compile up Serf.
 ==== A note on dependencies ==== ==== A note on dependencies ====
 Subversion offers a dependencies tarball, containing APR, APR-Util, Neon and zlib. Instructions on using this are in the INSTALL file in the root directory of the subversion tarball. However, if you are installing on a system which already has some of this software installed, a subversion installation which tries to install new copies of them might not go smoothly. For that reason, I recommend checking what you have and don't have installed on your system first, and installing what's missing yourself, before installing subversion. Subversion offers a dependencies tarball, containing APR, APR-Util, Neon and zlib. Instructions on using this are in the INSTALL file in the root directory of the subversion tarball. However, if you are installing on a system which already has some of this software installed, a subversion installation which tries to install new copies of them might not go smoothly. For that reason, I recommend checking what you have and don't have installed on your system first, and installing what's missing yourself, before installing subversion.
Line 66: Line 68:
 When compiling apr, if you encounter the error When compiling apr, if you encounter the error
 <code>rm: cannot remove `libtoolT': No such file or directory</code> <code>rm: cannot remove `libtoolT': No such file or directory</code>
-then follow the instructions at https://stackoverflow.com/questions/18091991/error-while-compiling-apache-apr-make-file-not-found+then follow the instructions at https://stackoverflow.com/questions/18091991/error-while-compiling-apache-apr-make-file-not-found copied below 
 + 
 +<code> 
 +Edit your configure file 
 + 
 +Change the line 
 + 
 +    $RM "$cfgfile" 
 + 
 +to 
 + 
 +    $RM -f "$cfgfile" 
 + 
 +This will resolve the error 
 + 
 +    rm: cannot remove `libtoolT': No such file or directory 
 + 
 +Then try run configure. That's it :) 
 +</code> 
  
 Now locate the ''apr-1-config'' and ''apu-1-config'' programs. In my case they are were at ''/research/oranfry/apr/bin/apr-1-config'' and ''/research/oranfry/apu/bin/apu-1-config''. The program binary files may be named slightly differently, for example, they could simply be named ''apr-config'' and ''apu-config''. Remember the location of these programs for use in the last step, [[#install_subversion_itself|Install Subversion Itself]]. Now locate the ''apr-1-config'' and ''apu-1-config'' programs. In my case they are were at ''/research/oranfry/apr/bin/apr-1-config'' and ''/research/oranfry/apu/bin/apu-1-config''. The program binary files may be named slightly differently, for example, they could simply be named ''apr-config'' and ''apu-config''. Remember the location of these programs for use in the last step, [[#install_subversion_itself|Install Subversion Itself]].
Line 74: Line 95:
 ''#include<zlib.h>'' as the first line. If it compiles without error, zlib is installed. If not, installation instructions can be found at [[http://www.zlib.net/|the zlib website]]. ''#include<zlib.h>'' as the first line. If it compiles without error, zlib is installed. If not, installation instructions can be found at [[http://www.zlib.net/|the zlib website]].
  
 +==== Installing older versions of Subversion ====
 === Install Neon === === Install Neon ===
 Check if you have neon by running: Check if you have neon by running:
Line 85: Line 107:
 If you have a suitable version of neon, make a note of the neon home directory for use in the last step, [[#Intall_Subersion_itself|Install Subversion Itself]]. If you have a suitable version of neon, make a note of the neon home directory for use in the last step, [[#Intall_Subersion_itself|Install Subversion Itself]].
  
-If you don't have neon, or need to install a newer version, get a recent copy it from the [[http://webdav.org/neon/|WebDAV website]] in a ''.tar.gz'' archive. Install it with:+If you don't have neon, or need to install a newer version, get a recent copy it from the [[http://webdav.org/neon/|WebDAV website]] or [[http://www.linuxfromscratch.org/blfs/view/svn/basicnet/neon.html|alt link]] in a ''.tar.gz'' archive. Install it with:
 <code> <code>
 cd /research/oranfry/sources cd /research/oranfry/sources
Line 115: Line 137:
 </code> </code>
  
-The configure may fail and require you to have sqlite3.c. The fail message will instruct you to grab the latest sqlite3 amalgamation tar (it will provide a link to a stable version that worked: http://www.sqlite.org/sqlite-amalgamation-3.6.13.tar.gz), decompress it and copy the sqlite3.c into a special new subdirectory of your subversion-X.X.X folder.+The configure may fail and require you to have sqlite3.c. The fail message will instruct you to grab the latest sqlite3 amalgamation tar
 + 
 +For older versions of subversion, it will provide a link to the following version: http://www.sqlite.org/sqlite-amalgamation-3.6.13.tar.gz, decompress it and copy the sqlite3.c into a special new subdirectory of your subversion-X.X.X folder.
 <code>mkdir /full/path/to/subversion-X.X.X/sqlite-amalgamation <code>mkdir /full/path/to/subversion-X.X.X/sqlite-amalgamation
 cp sqlite-3.6.13/sqlite3.c /full/path/to/subversion-X.X.X/sqlite-amalgamation/sqlite3.c</code> cp sqlite-3.6.13/sqlite3.c /full/path/to/subversion-X.X.X/sqlite-amalgamation/sqlite3.c</code>
 After following these instructions in the fail message, re-run the configure step and then proceed to make and make install. After following these instructions in the fail message, re-run the configure step and then proceed to make and make install.
  
-Now, subversion is installed in ''/research/oranfry/subversion''. To use the ''svn'' command, put ''/research/oranfry/subversion/bin'' into your path.+Now, subversion is installed in ''/research/oranfry/subversion''. To use the ''svn'' command, put ''/research/oranfry/subversion/bin'' into your path
 +<code> 
 +export PATH=/research/oranfry/subversion/bin:$PATH 
 +</code>
  
 +==== Installing newer versions of Subversion like Subversion 1.8.18 ====
 +You'd need apr and apr-util built and installed, as described further above.
  
 +I'm assuming we unpack the following tar.gz files into a ''sources'' folder and put their built installed versions into a ''packages'' folder.
 +
 +1. **Scons**\\ Grab the tar.gz file at https://sourceforge.net/projects/scons/files/scons-local/2.3.0/
 +and unpack into a ''scons'' folder. (Unpacking the tar.gz file directly will put the script files at the same level as the tar.gz.)
 +
 +<code>
 +cd sources
 +mkdir scons
 +mv scons-local-2.3.0.tar.gz scons/.
 +cd scons
 +tar -xvzf scons-local-2.3.0.tar.gz
 +(You can put the tar file back to where it used to be)
 +</code>
 +
 +2. **OpenSSL**\\ Grab openssl from https://www.openssl.org/source/ (https://www.openssl.org/source/old/1.0.2/ - grab 1.0.2l for Litre) and unpack into ''sources'' folder.
 +
 +<code>
 +cd sources
 +tar -xvzf openssl-1.0.2l.tar.gz
 +cd openssl-1.0.2l
 +
 +export CFLAGS="-fPIC $CFLAGS" 
 +  # the above may or may not be needed for successfully compiling up Serf in step 3.
 +  # However the ''shared'' flag to the ./config command below is definitely
 +  # the solution that fixed Serf compile failures 
 +
 +./config --openssldir=/Scratch/ak19/packages/openssl1.0.2l shared
 +[For macs, do instead:
 +./Configure darwin64-x86_64-cc --openssldir=/Path/To/packages/openssl1.0.2l shared]
 +make
 +make install
 +</code>
 +
 +The ''shared'' flag is necessary to successfully compile up serf against openssl hereafter. See the note in the Serf section.
 +
 +//**Notes:**// \\ When building openssl for GS, need to create static libs and disable shared libs:\\ ''./config %%--%%openssldir=/Scratch/ak19/packages/openssl1.0.2l no-shared''
 +
 +''%%--%%openssldir'' works like ''%%--%%prefix'', but additionally puts ''bin'', ''include'', ''lib'' dirs with the ''openssl'' dir (which includes manuals) in the directory set with ''%%--%%openssldir''.
 +
 +''no-shared'' builds as static, turns off shared. So this represents the usual combination of ''%%--%%enable-static %%--%%disable-shared''. See https://wiki.openssl.org/index.php/Compilation_and_Installation or run ''./configure %%--%%help''
 +
 +
 +3. **Serf**\\ Grab and unpack serf from http://serf.apache.org/download \\ Then use the unpacked ''scons'' from step 2 to compile and install Serf.
 +
 +<code>
 +cd sources
 +tar -xvjf serf-1.3.9.tar.bz2
 +cd serf-1.3.9
 +
 +export CFLAGS="-fPIC $CFLAGS"
 +  # flow on effect from OpenSSL, may not be required there nor here.
 +
 +../scons/scons.py APR=/Scratch/ak19/packages/apr1.6.2 APU=/Scratch/ak19/packages/apr-util1.6.2 OPENSSL=/Scratch/ak19/packages/openssl1.0.2l PREFIX=/Scratch/ak19/packages/serf1.3.9
 +
 +../scons/scons.py install
 +</code>
 +Between the configure and scons install steps, you may not need to bother doing the scons check step in the Serf README:\\ ''../scons/scons.py check'' \\
 +The ''scons.py check'' step results in lots of failures, but it may not be essential, see
 +https://stackoverflow.com/questions/34231885/serf-1-3-8-install-using-scons-is-failing
 +https://www.mail-archive.com/[email protected]/msg01219.html
 +
 +
 +At the end of installing serf, the installed version of serf should contain ''lib'' and ''includes'' folders.
 +
 +//**Note:**// When compiling up serf, if it fails with the error message
 +<code>
 + /usr/bin/ld: /Scratch/ak19/packages/openssl1.0.2l/lib/libssl.a(s23_clnt.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
 + /Scratch/ak19/packages/openssl1.0.2l/lib/libssl.a: error adding symbols: Bad value
 +</code>
 +then it may have nothing to do with exporting CFLAGS with ''-fPIC'' set, since setting this was at least insufficient to make the error go away.\\ Instead, it means that OpenSSL should have been compiled with ''enable-shared'' turned on, i.e. ''./config shared ...'' or ''./config %%--%%shared ...'' in step 2. See https://stackoverflow.com/questions/1147890/relocation-r-x86-64-32-against-a-local-symbol-error
 +
 +4. **Subversion**\\ Can now at last compile up a new version of subversion //with serf//:
 +
 +<code>
 +cd sources
 +tar -xvzf subversion-1.8.18.tar.gz
 +cd subversion-1.8.18
 +</code>
 +
 +[BEGIN: NOT FOR SVN 1.9.9 AND/OR MAC OSX
 +
 +If you try configuring SVN 1.8.18, you may get an error about missing sql-lite. For subversion 1.8.18, follow the instructions that the configure error message provides:
 +<code>get the sqlite 3.7.15.1 amalgamation from:
 +    http://www.sqlite.org/sqlite-amalgamation-3071501.zip
 +unpack the archive using unzip and rename the resulting
 +directory to:
 +/Scratch/ak19/sources/subversion-1.8.18/sqlite-amalgamation
 +</code>
 +Then you'd re-run the configure command and onwards.
 +
 +Alternatively, you can prepare your subversion package before configuring:
 +
 +<code>
 +cd sources
 +wget http://www.sqlite.org/sqlite-amalgamation-3071501.zip
 +unzip sqlite-amalgamation-3071501.zip
 +mv sqlite-amalgamation-3071501 subversion-1.8.18/sqlite-amalgamation
 +  #needs to be renamed
 +</code>
 +
 +END] 
 +
 +Now proceed with the usual configure, make and make install. There are two locations in the configure command where Serf should be specified:
 +
 +<code>
 +export CFLAGS="-fPIC $CFLAGS"
 +  # flow on effect from OpenSSL, may not be required there nor here.
 +
 +LDFLAGS="-Wl,-rpath,/Scratch/ak19/packages/serf1.3.9/lib $LDFLAGS" ./configure --prefix=/Scratch/ak19/packages/subversion1.8.18 --without-apxs --with-apr=/Scratch/ak19/packages/apr1.6.2/bin/apr-1-config --with-apr-util=/Scratch/ak19/packages/apr-util1.6.2/bin/apu-1-config --with-serf=/Scratch/ak19/packages/serf1.3.9 [--disable-neon-version-check --with-neon=/Scratch/ak19/packages/neon]
 +[--disable-neon-version-check and --with-neon are no longer recognised.]
 +Try adding: --enable-shared
 +
 +make
 +make install
 +</code>
 +
 +//**Note:**// You //need// to prepend to the ''./configure'' command the ''LDFLAGS'' set to the installed Serf's ''lib'' subfolder, else you'll be stuck always exporting ''LD_LIBRARY_PATH'' when running SVN, or exporting ''LD_LIBRARY_PATH'' from ''~/.bashrc''. Explained at https://stackoverflow.com/questions/28663316/svn-error-while-loading-shared-libraries-libserf-1-so-1-cannot-open-shared-ob
 +
 +5. Add the installed SVN's bin folder to the PATH, such as by exporting it in ''~/.bashrc'', before running svn commands. In ''~/.bashrc'':
 +<code>
 +export PATH=/path/to/installed/svn/bin:$PATH
 +(export LD_LIBRARY_PATH=/Scratch/ak19/packages/serf1.3.9/lib:$LD_LIBRARY_PATH
 +  ## stuck doing this only if you didn't compile up Subversion with the 
 +  ## configure command's LDFLAGS set to Serf's ''lib'' folder.)
 +</code>
 ===== Installing Perl: compiling perl from source ===== ===== Installing Perl: compiling perl from source =====
 The instructions are from https://perlmaven.com/how-to-build-perl-from-source-code The instructions are from https://perlmaven.com/how-to-build-perl-from-source-code
Line 138: Line 292:
 Once it's finished compiling, your perl is ready for use. To do so: make sure to always first set up your PATH to point to your new perl's **bin** subfolder in any terminal which should use your locally installed perl rather than the system perl: Once it's finished compiling, your perl is ready for use. To do so: make sure to always first set up your PATH to point to your new perl's **bin** subfolder in any terminal which should use your locally installed perl rather than the system perl:
 <code> <code>
-export PATH=/path/to/your/custom/compiled-and-installed/perl/bin:PATH+export PATH=/path/to/your/custom/compiled-and-installed/perl/bin:$PATH
 </code> </code>
  
 Since you wouldn't have installed perl in a system location, uninstalling can be as simple as just removing the installed folder. Since you wouldn't have installed perl in a system location, uninstalling can be as simple as just removing the installed folder.
en/developer/install_svn.1499763000.txt.gz · Last modified: 2017/07/11 08:50 by anupama