天天看点

linux 下安装 subversion(svn) 客户端

linux 下安装 subversion(svn) 客户端 (center os 5实际安装)

svn server 为只支持http://协议的windows;

test web server 为as4,现需安装svn客户端方便同步代码

网上找了下都是讲如何安装svn server的,我只需要一个支持http协议的客户端哈,不想装apache。

安装所需软件

apr, apr-util, sqlite, neon, subversion

1.下载软件

  1. wget http://mirror.bjtu.edu.cn/apache//apr/apr-1.4.2.tar.bz2
  2. wget http://mirror.bjtu.edu.cn/apache//apr/apr-util-1.3.10.tar.bz2
  3.  wget http://www.sqlite.org/sqlite-amalgamation-3.6.16.tar.gz
  4. wget http://www.webdav.org/neon/neon-0.28.4.tar.gz
  5. wget http://www.webdav.org/neon/neon-0.25.5.tar.gz(自己找的,忘记上边的地址是否能下了。)
  6. wget http://subversion.tigris.org/downloads/subversion-1.6.15.tar.bz2

2.安装apr

  1. tar zxvf apr-1.3.7.tar.gz
  2. cd apr-1.3.7
  3. ./configure -prefix=/usr/local/apr
  4. make
  5. make install
  6. cat /etc/ld.so.conf
  7. echo /usr/local/apr/lib >> /etc/ld.so.conf

3.安装apr-util

  1. tar zxvf apr-util-1.3.8.tar.gz
  2. cd apr-util-.1.3.8
  3. ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
  4. make
  5. make install
  6. echo /usr/local/apr-util/lib >> /etc/ld.so.conf
  7. ldconfig -v

4.安装sqlite

  1. tar zxvf sqlite-amalgamation-3.6.16.tar.gz
  2. cd sqlite-3.6.16/
  3. configure --prefix=/usr/local/sqlite
  4. make
  5. make install

5.安装neon

不需要支持http协议可以略掉安装

  1. tar zxvf neon-0.28.4.tar.gz
  2. cd neon-0.28.4
  3. ./configure --prefix=/usr/local/neon --enable-shared
  4. make
  5. make install

方式二:解压后重命名为neon,移动至subversion编译目录

但subversion编译时好像找不到neon

报错如下

  1. configure: checking neon library
  2. An appropriate version of neon could not be found, so libsvn_ra_neon
  3. will not be built.  If you want to build libsvn_ra_neon, please either
  4. install neon 0.28.4 on this system
  5. or
  6. get neon 0.28.4 from:
  7.     http://www.webdav.org/neon/neon-0.28.4.tar.gz
  8. unpack the archive using tar/gunzip and rename the resulting
  9. directory from ./neon-0.28.4/ to ./neon/
  10. no suitable neon found

6.安装subversion

  1. tar -jxvf subversion-1.6.3.tar.bz2
  2. cd subversion-1.6.3
  3. ./configure --prefix=/usr/local/svn --with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util --with-sqlite=/usr/local/sqlite--with-neon=/usr/local/neon
  4. make
  5. make install

7.检查测试

安装后应该有三个模块

  1. /usr/local/svn/bin/svn --version
  2. svn,版本 1.6.3 (r38063)
  3. 编译于 Jul 30 2009,14:31:41
  4. 版权所有 (C) 2000-2009 CollabNet。
  5. Subversion 是开放源代码软件,请参阅 http://subversion.tigris.org/ 站点。
  6. 此产品包含由 CollabNet(http://www.Collab.Net/) 开发的软件。
  7. 可使用以下的版本库访问模块:
  8. * ra_neon : 通过 WebDAV 协议使用 neon 访问版本库的模块。
  9.   - 处理“http”方案
  10. * ra_svn : 使用 svn 网络协议访问版本库的模块。  - 使用 Cyrus SASL 认证
  11.   - 处理“svn”方案
  12. * ra_local : 访问本地磁盘的版本库模块。
  13.   - 处理“file”方案

导出项目

  1. cd /opt/srv/
  2. /usr/local/svn/bin/svn export --username c1g --password 123456 http://192.168.1.9/pub37

参考:

http://www.9say.com/2009/04/subversion-compile-with-ra-dav/

习惯性的把svn放在bin下

ln -s /usr/local/svn/bin/svn /usr/bin/svn

导出时候直接用的  svn co svn://192.168.0.10/test/2010-05-12

sub官方:

http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=260&expandFolder=74

继续阅读