移植SVN
介绍
简要介绍
Apache Subversion(简称SVN),一个开放源代码的版本控制系统,相较于RCS、CVS,它采用了分支管理系统,它的设计目标就是取代CVS。
语言:C
一句话描述:一个开放源代码的版本控制系统
开源协议:apache
建议的版本
根据实际需要选择版本,本文档以“subversion-1.13.0”为例进行说明。
配置编译环境
安装依赖工具。
yum install wget apr-devel apr-util-devel zlib zlib-devel -y
获取源码
获取“subversion-1.13.0”源码包。
cd /usr/local/src
wget http://mirror-hk.koddos.net/apache/subversion/subversion-1.13.0.tar.gz
编译和安装
- 卸载旧的svn。
查找本地已经安装的subversion的版本,如果有,则删除。
rpm -qa | grep subversion
subversion-1.7.14-14.el7.aarch64 subversion-libs-1.7.14-14.el7.aarch64
rpm -e --nodeps subversion-1.7.14-14.el7.aarch64
rpm -e --nodeps subversion-libs-1.7.14-14.el7.aarch64
- 解压软件包。
tar -zxvf subversion-1.13.0.tar.gz
- 进入subversion的安装目录。
cd subversion-1.13.0
- 下载依赖SQLite
Subversion要求SQLite,建议3.8.11.1,但至少要求3.8.2。本文在subversion-1.13.0目录下做如下操作:
wget https://www.sqlite.org/2015/sqlite-amalgamation-3081101.zip
unzip sqlite-amalgamation-3081101.zip
mv sqlite-amalgamation-3081101 sqlite-amalgamation
- 生成Makefile文件
./configure --prefix=/usr/local/subversion --with-zlib --enable-maintainer-mode --with-lz4=internal --with-utf8proc=internal
- 编译安装。
“-j”参数可利用多核CPU加快编译速度,在本示例中,使用的是2核CPU,所以此处为“-j2”。
可通过下述命令查询CPU核数:
cat /proc/cpuinfo| grep "processor"| wc -l
make -j2
make install
- subversion添加到path。
vim /etc/profile
在配置文件末尾添加如下内容。
export SVN_HOME=/usr/local/subversion export PATH=$PATH:$SVN_HOME/bin
保存退出,并且输入如下命令生效。
source /etc/profile
运行和验证
执行如下命令,查看svn版本。
svn --version
[root@ecs bin]# svn --version svn, version 1.13.0 (r1867053) compiled Dec 30 2019, 15:08:21 on aarch64-unknown-linux-gnu Copyright (C) 2019 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/ The following repository access (RA) modules are available: * ra_svn : Module for accessing a repository using the svn network protocol. - with Cyrus SASL authentication - handles 'svn' scheme * ra_local : Module for accessing a repository on local disk. - handles 'file' scheme The following authentication credential caches are available: * GPG-Agent
