Linux 源码编译SVN

一、下载安装包

SVN源码包下载(我这里下载的是1.14.2版本)

https://subversion.apache.org/download.cgi

apr源码包(我这里下载的是1.7.2版本)

https://dist.apache.org/repos/dist/release/apr/

apr-util源码包(我这里下载的是1.6.3版本)

https://dist.apache.org/repos/dist/release/apr/

expat源码包(我这里下载的是2.5.0版本)

https://github.com/libexpat/libexpat/releases

SCons源码包(我这里下载的是2.4.1版本,高版本的需要用Python3编译,编译成功了还会有其他问题,所以没用最新的版本)

https://sourceforge.net/projects/scons/files/scons/2.4.1/scons-2.4.1.tar.gz/download

Python的setuptools源码包版本(使用Python安装SCons时需要的模块,如果安装过了就不需要再安装)

扫描二维码关注公众号,回复: 14636524 查看本文章

http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz

serf源码包(我这里下载的是1.3.9版本)

http://archive.apache.org/dist/serf/

sqlite-amalgamation源码包(我这里下载的是3.40.1版本)

http://www.sqlite.org


二、安装必要依赖

yum -y install zlib zlib-devel openssl openssl-devel


三、编译安装源码

1.安装apr

[root@SVNSAPP1]# tar -xvf apr-1.7.2.tar.gz
[root@SVNSAPP1 apr-1.7.2]#cd apr-1.7.2 
[root@SVNSAPP1 apr-1.7.2]#./configure --prefix=/data/apr
[root@SVNSAPP1 apr-1.7.2]#make && make instlal

如果报错:rm: cannot remove `libtoolT’: No such file or directory

处理:将configure文件中的R M " RM "RM"cfgfile"这行代码注释掉就可以了

2.安装apr-util

[root@SVNSAPP1]# tar -xvf apr-util-1.6.3.tar.gz 
[root@SVNSAPP1]# cd apr-util-1.6.3
[root@SVNSAPP1 apr-util-1.6.3]#./configure --prefix=/data/apr-util --with-apr=/data/apr
[root@SVNSAPP1 apr-util-1.6.3]# make && make install

如果报错:错误:xml/apr_xml.c:35:19: 错误:expat.h:没有那个文件或目录

没有expat头文件,需要编译安装expat,解压上面下载的expat:

[root@SVNSAPP1 expat-2.5.0]# ./configure
[root@SVNSAPP1 expat-2.5.0]# make && make install

3.安装SCons

[root@SVNSAPP1]# tar -xzf scons-2.4.1.tar.gz 
[root@SVNSAPP1]# cd scons-2.4.1
[root@SVNSAPP1 scons-2.4.1]# python setup.py install
[root@SVNSAPP1 scons-2.4.1]# scons

安装完成后在当前目录下运行scons时,如果显示scons:*** No SConstruct file found. 说明安装成功。

从Subversion-1.8开始需要使用serf软件包支持访问http协议的版本库,如果不安装serf的话,在使用SVN时路径中有http的话,就会报错svn: E170000: Unrecognized URL scheme for ${url}。

安装serf必须要通过SCons来安装,所以这里要安装SCons。在执行Python setup.py install命令时,如果报错:ImportError: No module named setuptools,需要安装Python的setuptools模块,安装命令如下:

[root@SVNSAPP1]# tar zxvf setuptools-0.6c11.tar.gz
[root@SVNSAPP1]# cd setuptools-0.6c11
// 编译setuptools
[root@SVNSAPP1 setuptools-0.6c11]# python setup.py build
// 开始执行setuptools安装
[root@SVNSAPP1 setuptools-0.6c11]# python setup.py install

4.安装serf

解压下载的serf安装包,然后执行下面的命令:

[root@SVNSAPP1]# tar -jxvf serf-1.3.9.tar.bz2
[root@SVNSAPP1]# cd serf-1.3.9
[root@SVNSAPP1 serf-1.3.9]# scons PREFIX=/usr/local/serf APR=/data/apr APU=/data/apr-util
[root@SVNSAPP1 serf-1.3.9]# scons PREFIX=/usr/local/serf LIBDIR=/usr/local/serf/lib
[root@SVNSAPP1 serf-1.3.9]# scons install
[root@SVNSAPP1 serf-1.3.9]# cp /usr/local/serf/lib/libserf-1.so* /usr/lib/

5.安装svn

首先需要把上面下载的sqlite-amalgamation源码包解压,里面有四个头文件,然后在要安装SVN的目录下创建sqlite-amalgamation文件夹,把刚才解压后得到的四个头文件移到创建的目录下,这里我SVN的安装目录是/usr/local/SVN

[root@SVNSAPP1]# tar -xvf sqlite-amalgamation-3400100.tar.gz
[root@SVNSAPP1]# mkdir -p /usr/local/SVN/sqlite-amalgamation
[root@SVNSAPP1]# mv sqlite-amalgamation-3400100/* /usr/local/SVN/sqlite-amalgamation
[root@SVNSAPP1]# tar -xvf subversion-1.14.2.tar.gz
[root@SVNSAPP1]# cd subversion-1.14.2
[root@SVNSAPP1 subversion-1.14.2]# ./configure --prefix=/usr/local/SVN --with-apr=/data/apr --with-apr-util=/data/apr-util --with-serf=/usr/local/serf --with-lz4=internal --with-utf8proc=internal
[root@SVNSAPP1 subversion-1.14.2]# make
[root@SVNSAPP1 subversion-1.14.2]# make install

如果报错:configure:error:subversion requires zlib

需要安装zlib,zlib源码包(我这里下载的是1.2.13版本)

http://www.zlib.net/

如果报错:configure: error: Subversion requires LZ4 >= r129, or use --with-lz4=internal

解决:./configure命令添加 --with-lz4=internal

如果报错:configure: error: Subversion requires UTF8PROC

解决:./configure命令添加 --with-utf8proc=internal


四、添加环境变量

[root@SVNSAPP1]# echo "export PATH=/data/svn/bin:$PATH" >> /etc/profile
[root@SVNSAPP1]# source /etc/profile


五、查看安装信息

[root@SVNSAPP1]# svnserve --version
svnserve,版本 1.14.2 (r1899510)
   编译于 Feb  28 2023,14:44:58 在 aarch64-unknown-linux-gnu

Copyright (C) 2022 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/

下列版本库后端(FS) 模块可用: 

* fs_fs : 模块与文本文件(FSFS)版本库一起工作。
* fs_x : Module for working with an experimental (FSX) repository.
[root@SVNSAPP1]# svn --version
svn,版本 1.14.2 (r1899510)
   编译于 Feb 28 2023,14:44:58 在 aarch64-unknown-linux-gnu

Copyright (C) 2022 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/

可使用以下的版本库访问模块: 

* ra_svn : 使用 svn 网络协议访问版本库的模块。
  - 处理“svn”方案
* ra_local : 访问本地磁盘的版本库模块。
  - 处理“file”方案
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - using serf 1.3.9 (compiled with 1.3.9)
  - 处理“http”方案
  - 处理“https”方案

The following authentication credential caches are available:

* GPG-Agent

猜你喜欢

转载自blog.csdn.net/Sakuya__/article/details/128874315
今日推荐