天天看點

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

繼續閱讀