安装步骤
1、下载subversion1.10.2 apr apr-util sqlite serf scons(安装这个才能安装serf) 选择1.5.2版本的。1.6以上版本安装总会报错
wget https://mirrors.tuna.tsinghua.edu.cn/apache/subversion/subversion-1.10.2.tar.gz
wget http://archive.apache.org/dist/apr/apr-1.5.2.tar.gz
wget http://archive.apache.org/dist/apr/apr-util-1.5.2.tar.bz2
wget https://www.sqlite.org/2018/sqlite-amalgamation-3240000.zip
wget https://www.apache.org/dist/serf/serf-1.3.9.tar.bz2
wget https://nchc.dl.sourceforge.net/project/scons/scons/3.0.0/scons-3.0.0.zip
2、分别安装以上
先将subversion-1.10.2.tar.gz解压到/usr/local/xxx/(安装目录)中
注意安装的东西一定要安装到usr/local下否则会有警告(如果不安装到此目录好像会有问题)
(1)先安装apr apr-util
解压后
configure --prefix=/usr/local/apr && make && make install
configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr && make && make install
(2)安装scons
unzip -q scons-3.0.0.zip
cd scons-3.0.0
python setup.py install
(3)安装serf(svn1.8以上需要安装serf 1.8以下安装neon 使svn可以访问https协议)
解压后
scons PREFIX=/usr/local/serf APR=/usr/local/apr/bin/apr-1-config APU=/usr/local/apr-util/bin/apu-1-config
到这一步可能全暴以下错误
scons: Reading SConscript files ...
File "**/serf-1.3.9/SConstruct", line 186
print ‘Warning: Used unknown variables:‘, ‘, ‘.join(unknown.keys())
^
SyntaxError: invalid syntax
打开此路径
直接将这个提示注释就可以了,警告不会有太大影响
unknown = opts.UnknownVariables()
#if unknown:
# print ‘Warning: Used unknown variables:‘, ‘, ‘.join(unknown.keys())
...
然后再
scons PREFIX=/usr/local/serf APR=/usr/local/apr/bin/apr-1-config APU=/usr/local/apr-util/bin/apu-1-config
scons install
cp /usr/local/serf/lib/libserf-1.so* /usr/local/lib/
(4)将sqlite里的文件解压到/usr/local/xxx/subversion-1.10.2/sqlite-amalgamation/目录中,如果没有sqlite-amalgamation文件夹则mkdir创建一下;
命令如下
unzip sqlite-amalgamation-3240000.zip
mv sqlite-amalgamation-3240000 /usr/local/xxx/subversion-1.10.2/sqlite-amalgamation
(5)愉快的编译subversion吧
./configure --prefix=/usr/local/subversion --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-serf=/usr/local/serf --with-lz4=internal --with-utf8proc=internal
make && make install
*特别说明为什么加最后2个编译关联
错误1:configure: error: Subversion requires LZ4 >= r129, or use --with-lz4=internal
解决:./configure命令添加 --with-lz4=internal选项
错误2:configure: error: Subversion requires UTF8PROC
解决:./configure命令添加 --with-utf8proc=internal
(6)建立svn命令连接 ln -s /usr/local/subversion/bin/svn /usr/local/bin
然后svn --version吧
lllibexpat1-dev apt inst lllibexpat1-dev(debian10下到操作,其他 yum install expat-devel)