1、
subversion源代码下载subversion-1.8.9.tar.gz
http://subversion.apache.org/download/
2、
安装文档
http://svn.apache.org/repos/asf/subversion/trunk/INSTALL
2.1
需要以下构建工具来编译Subversion:
autoconf 2.59 or later (Unix only)
libtool 1.4 or later (Unix only)
a reasonable C compiler (gcc, Visual Studio, etc.)
2.2
Subversion还取决于以下第三方库
如果你只是安装一个客户端只需要(Apache Portable Runtime, Sqlite, and Zlib)
get-deps.sh 运行这个脚本会自动下载apr', 'apr-util', 'serf', 'zlib', and 'sqlite-amalgamation'到运行get-deps.sh的同级目录。除了sqlite-amalgamation,其它的第三方软件还需要显式的make make install。并且指定安装目录如果不是安装在默认目录的话
注意:有可选的依赖项(如openssl,swig,httpd)get-deps.sh 不会下载。
2.2.1
Apache Portable Runtime 0.9.7或1. x.X(必需),安装svn需要APR和APR-util
安装好apr后通过./configure 配置来指定安装路径,应该能够找到apr-config脚本在标准目录下(例如 prefix/ bin)。例如,如果使用Apache httpd服务器编译安装的apr
$ ./configure --with-apr=/usr/local/apache2 --with-apr-util=/usr/local/apache2 //前面安装apache的时候使用srclib安装的apr。所以apache 里面有apr的包 ,如果是单独装的可以直接指定为单独的路径 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
2.2.2
Zlib(必需)Subversion的二进制差异算法取决于Zlib压缩。大多数Unix系统预装libz 但是如果你需要它,你可以从http://www.zlib.net获得预装的没有装zlib-devel(这个查了很久才发现是这个问题)
configure: error: subversion requires zlib
[centos@mycompany ~]$ cd /home/centos/下载
[centos@mycompany 下载]$ ll
[centos@mycompany 下载]$ tar zxvf zlib-1.2.8.tar.gz
[centos@mycompany 下载]$ su - root
密码:
[root@mycompany ~]# mkdir -p /decompress/zlib
[root@mycompany ~]# chown -R centos:centos /decompress/zlib/
[root@mycompany ~]# mv /home/centos/下载/zlib-1.2.8 /decompress/zlib/
[root@mycompany ~]# cd /decompress/zlib/zlib-1.2.8/
[root@mycompany zlib-1.2.8]# ./configure --help
usage:
configure [--const] [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX]
[--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]
[--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"]
[root@mycompany zlib-1.2.8]# ./configure --prefix=/usr/local/zlib
[root@mycompany zlib-1.2.8]# make
[root@mycompany zlib-1.2.8]# make install
下面安装serf的时候报找不到zlib.h 。所以网上找了加载so到内存中。没有用。跟这个没关系
[root@mycompany ld.so.conf.d]# cd /etc/ld.so.conf.d
[root@mycompany ld.so.conf.d]# vi zlib.conf --/usr/local/zlib/lib
[root@mycompany ld.so.conf.d]# ldconfig -p
[root@mycompany ld.so.conf.d]# ldconfig -p |grep libz
libz.so.1 (libc6,x86-64) => /usr/local/zlib/lib/libz.so.1
libz.so.1 (libc6,x86-64) => /lib64/libz.so.1
libz.so (libc6,x86-64) => /usr/local/zlib/lib/libz.so
2.2.3
Serf library 1.2.1 or newer (可选的)
如果你希望你的客户端能够访问Apache服务器(通过http://或https://的URL),您必须依赖这个lib。虽然可选的,我们强烈推荐这个。
为了使用ra_serf,您必须安装Serf,并运行Subversion的./configure --with-serf 如果Serf是安装在一个非标准(默认安装位置)的地方,您应该使用 --with-serf=/path/to/serf/install
An appropriate version of serf could not be found, so libsvn_ra_serf
will not be built. If you want to build libsvn_ra_serf, please
install serf 1.2.1 or newer.
window通过chrome下载serf
D:\JavaDecompress\putty>pscp -C d:\serf-1.3.6.tar.bz2 centos@192.168.1.170:/home/centos
centos@192.168.1.170's password:
serf-1.3.6.tar.bz2 | 137 kB | 137.4 kB/s | ETA: 00:00:00 | 100%
linux
[centos@mycompany ~]$ cd /home/centos
[centos@mycompany ~]$ ll
mv serf-1.3.6.tar.bz2 /home/centos/下载
[centos@mycompany ~]$ cd /home/centos/下载/
[centos@mycompany 下载]$ ll
[centos@mycompany 下载]$ tar jxvf serf-1.3.6.tar.bz2
[centos@mycompany 下载]$ su - root
密码:
[root@mycompany ~]# mkdir -p /decompress/serf
[root@mycompany ~]# chown -R centos:centos /decompress/serf
[root@mycompany ~]# mv /home/centos/下载/serf-1.3.6 /decompress/serf/
[root@mycompany ~]# cd /decompress/serf/serf-1.3.6/
[root@mycompany serf-1.3.6]# ll
发现1.3.6使用新的scons build软件替代了make 工具。。。。只好重新下载1.2.1的
D:\JavaDecompress\putty>pscp -C d:\serf-1.2.1.tar.bz2 centos@192.168.1.170:/home
/centos
<pre name="code" class="java">linux
[centos@mycompany ~]$ cd /home/centos
[centos@mycompany ~]$ ll
mv serf-1.3.6.tar.bz2 /home/centos/下载
[centos@mycompany ~]$ cd /home/centos/下载/
[centos@mycompany 下载]$ ll
[root@mycompany 下载]# tar jxvf serf-1.2.1.tar.bz2
[centos@mycompany 下载]$ su - root
密码:
//[root@mycompany ~]# mkdir -p /decompress/serf
//[root@mycompany ~]# chown -R centos:centos /decompress/serf
[root@mycompany serf]# mv /home/centos/下载/serf-1.2.1 /decompress/serf/
[root@mycompany ~]# cd /decompress/serf/serf-1.2.1/
[root@mycompany serf-1.2.1]# ll
[root@mycompany serf-1.2.1]# ./configure --prefix=/usr/local/serf
checking for APR-util... no
configure: error: APR-util not found. Please read the documentation.
[root@mycompany serf-1.2.1]# ./configure --prefix=/usr/local/serf --with-apr=/usr/local/apache2 --with-apr-util=/usr/local/apache2
configure: error: We require OpenSSL; try --with-openssl
[root@mycompany serf-1.2.1]# ./configure --prefix=/usr/local/serf --with-apr=/usr/local/apache2 --with-apr-util=/usr/local/apache2 \
--with-openssl=/usr/local/ssl
[root@mycompany serf-1.2.1]# make
报错buckets/deflate_buckets.c:18:18: error: zlib.h: No such file or directory 最后找到了原因需要安装zlib.devel开发包
只能换成scons build试试
[centos@mycompany ~]$ cd /home/centos/下载/
[centos@mycompany 下载]$ tar zxvf scons-2.3.2.tar.gz
[centos@mycompany 下载]$ su - root
密码:
[root@mycompany ~]# mkdir -p /decompress/scons
[root@mycompany ~]# chown -R centos:centos /decompress/scons/
[root@mycompany ~]# mv /home/centos/下载/scons-2.3.2 /decompress/scons/
[root@mycompany ~]# cd /decompress/scons/scons-2.3.2/
[root@mycompany scons-2.3.2]# ll
[root@mycompany scons-2.3.2]# python setup.py install --record installlog
Installed SCons library modules into /usr/lib/scons-2.3.2
Installed SCons scripts into /usr/bin
Installed SCons man pages into /usr/man/man1
[root@mycompany ~]# cd /decompress/serf/serf-1.3.6/
[root@mycompany serf-1.3.6]# scons PREFIX=/usr/local/serf ZLIB=/usr/local/zlib APR=/usr/local/apache2 APU=/usr/local/apache2 OPENSSL=/usr/local/ssl
报错ValueError: zero length field name in format:
File "/decompress/serf/serf-1.3.6/SConstruct", line 22:
EnsureSConsVersion(2,3,0)
然后再次安装了2.3.0的
# python setup.py install --record log //在unix-like平台下卸载:cat files.txt | xargs rm –rf
writing list of installed files to 'log'
Installed SCons library modules into /usr/lib/scons-2.3.0
Installed SCons scripts into /usr/bin
Installed SCons man pages into /usr/man/man1
[root@mycompany serf-1.3.6]# scons PREFIX=/usr/local/serf LIBDIR=/usr/lib64 \
APR=/usr/local/apache2 APU=/usr/local/apache2 OPENSSL=/usr/local/ssl ZLIB=/usr/local/zlib
仍然报zlib.h找不到
yum 安装 zlib-devel 源代码的没找到只好
yum install zlib-devel
[root@mycompany serf-1.3.6]# scons PREFIX=/usr/local/serf APR=/usr/local/apr APU=/usr/local/aprutil OPENSSL=/usr/local/ssl -fPIC
同时可能有类似问题缺少lib xxx,也是要安装devel包
/usr/bin/ld: cannot find -lexpat
yum -y install expat-devel
./configure --prefix=/usr/local/serf --with-apr=/usr/local/apr --with-apr-util=/usr/local/aprutil --with-openssl=/usr/local/ssl
make
make install
2.2.4
OpenSSL (可选的)
Serf 依赖通过OpenSSL 支持 OpenSSL加密
2.2.4.1
在客户机上通过Serf使用OpenSSL
在Unix系统中,使用OpenSSL来build Serf,你需要在您的系统上安装OpenSSL,您必须"./configure"添加 --with-ssl 参数。如果您的OpenSSL安装Serf很难找到,您可能需要使用--with-libs=/path/to/lib 特别是,在Red Hat(但不是Fedora Core)有必要指定--with-libs = / usr / kerberos 以便OpenSSL找到。您还可以使用”--with-libs”指定一个zlib路径。
2.2.4.2
在Apache服务器使用OpenSSL
你也可以添加OpenSSL支持特性在Apache httpd服务器上,使用Subversion相同的支持库,Subversion构建系统将不会提供,然而你将它们通过指定参数添加到Apache服务器的./configure脚本(前面安装apache httpd的时候,已添加ssl)。服务器上获取SSL,添加”--enable-ssl”或“--with-ssl=/path/to/lib”选择Apache的./configure脚本 。Apache 默认启用zlib支持,但您可以指定一个非标准库的位置--with-z=/path/to/dir.请查阅Apache文档了解更多细节,您可能希望对其他模块安装增强Subversion服务器.
2.2.5
SQLite (必须)Subversion 1.8 需要 SQLite 3.7.12 或以上版本.有一下路径可以选择
*使用SQLite amalgamation file 源代码
*指定一个SQLite installation 安装好的路径
*让Subversion找到一个安装的SQLite 自动寻找
在subversion中运行./configure 测试可以看到需要sqlite
We recommmend
3.7.15.1, but require at least 3.7.12.
Please either install a newer sqlite on this system
or
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:
/decompress/subversion/subversion-1.8.9/sqlite-amalgamation
为了使用SQLite-provided amalgamation,只需要把sqlite3.c 放入Subversion的 sqlite-amalgamation目录(在svn源代码目录新建一个目录sqlite-amalgamation放sqlite3.c)
或者 利用--with-sqlite 指定安装好的路径
http://www.sqlite.org/download.html
$ cd /home/centos/下载
$ tar zxvf sqlite-autoconf-3080500.tar.gz
su - root
[root@mycompany ~]# mkdir -p /decompress/sqlite
[root@mycompany ~]# chown -R centos:centos /decompress/sqlite/
[root@mycompany ~]# mv /home/centos/下载/sqlite-autoconf-3080500 /decompress/sqlite/
[root@mycompany ~]# cd /decompress/sqlite/sqlite-autoconf-3080500/
[root@mycompany sqlite-autoconf-3080500]# ./configure --prefix=/usr/local/sqlite
[root@mycompany sqlite-autoconf-3080500]# echo $?
0
[root@mycompany sqlite-autoconf-3080500]# make
[root@mycompany sqlite-autoconf-3080500]# make install
3、
编译安装
[root@mycompany 下载]# mkdir -p /decompress/subversion
[root@mycompany 下载]# chown -R centos:centos /decompress/subversion/
[root@mycompany 下载]# mv /home/centos/下载/subversion-1.8.9 /decompress/subversion/
[root@mycompany 下载]# cd /decompress/subversion/subversion-1.8.9/
[root@mycompany ~]# cd /decompress/subversion/subversion-1.8.9/
[root@mycompany subversion-1.8.9]# ./configure --help
[root@mycompany subversion-1.8.9]# ./configure --prefix=/usr/local/subversion --with-zlib=/usr/local/zlib \
--with-sqlite=/usr/local/sqlite --with-apxs=/usr/local/apache2/bin/apxs \
--with-apr=/usr/local/apache2 --with-apr-util=/usr/local/apache2 --with-serf=/usr/local/serf
因为上面安装serf的时候老是报找不到zlib.h.后面的测试用的是源代码安装apr apr-util 其实跟这个没啥关系
[root@mycompany subversion-1.8.9]# ./configure --prefix=/usr/local/subversion --with-zlib=/usr/local/zlib \
--with-sqlite=/usr/local/sqlite --with-apxs=/usr/local/apache2/bin/apxs \
--with-apr=/usr/local/apr --with-apr-util=/usr/local/aprutil --with-serf=/usr/local/serf
仍然还是上面的devel的问题yum
checking perl version... 5010001
Can't locate ExtUtils/Embed.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5
/usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .).
BEGIN failed--compilation aborted.
<pre name="code" class="java">[root@mycompany subversion-1.8.9]# yum install perl-ExtUtils-Embed -y
<pre name="code" class="java">[root@mycompany subversion-1.8.9]# ./configure --prefix=/usr/local/subversion --with-zlib=/usr/local/zlib \
--with-sqlite=/usr/local/sqlite --with-apxs=/usr/local/apache2/bin/apxs \
--with-apr=/usr/local/apr --with-apr-util=/usr/local/aprutil --with-serf=/usr/local/serf