本文只記錄個人筆記python
首先, 我是個懶人, 寫好了shell, 直接上傳把c++
安裝包:SvnPackages-chengleesql
第一, 無非就是搞掂依賴這一塊shell
#************************************************************************* # > File Name: SuperRoot.sh # > Author: chenglee # > Main : chengkenlee@sina.com # > Blog : http://www.cnblogs.com/chenglee/ # > Created Time : 2019年07月04日 星期四 20時43分25秒 #************************************************************************* #!/bin/bash yum -y install zlib zlib-devel openssl openssl-devel expat-devel gcc gcc-c++ cmake lrzsz bzip2
第二, 編譯安裝bash
#************************************************************************* # > File Name: SvnInstall.sh # > Author: chenglee # > Main : chengkenlee@sina.com # > Blog : http://www.cnblogs.com/chenglee/ # > Created Time : 2019年07月04日 星期四 20時46分03秒 #************************************************************************* #!/bin/bash ShowPath=$1 InstallPath="$ShowPath/svn" ShellFoler=$(cd "$(dirname "$0")";pwd) function cheng(){ mkdir -p $InstallPath/lib tar -zxvf SvnPackages.tar.gz && cd SvnPackages && ll } function apr(){ cd $ShellFoler/SvnPackages tar -zxvf apr-1.6.5.tar.gz && cd apr-1.6.5 && mkdir $InstallPath/lib/apr ./configure --prefix=${InstallPath}/lib/apr && make && make install } function apr-util(){ cd $ShellFoler/SvnPackages tar -zxvf apr-util-1.6.1.tar.gz && cd apr-util-1.6.1 && mkdir $InstallPath/lib/apr-util ./configure --prefix=$InstallPath/lib/apr-util --with-apr=$InstallPath/lib/apr && make && make install } function scons(){ cd $ShellFoler/SvnPackages tar -zxvf scons-2.3.2.tar.gz && cd scons-2.3.2 && mkdir $InstallPath/lib/scons python setup.py install --prefix=$InstallPath/lib/scons } function serf(){ cd $ShellFoler/SvnPackages tar xf serf-1.3.9.tar.bz2 && cd serf-1.3.9 && mkdir $InstallPath/lib/serf $InstallPath/lib/scons/bin/scons PREFIX=$InstallPath/lib/serf APR=$InstallPath/lib/apr APU=$InstallPath/lib/apr-util && $InstallPath/lib/scons/bin/scons install && cp $InstallPath/lib/serf/lib/libserf-1.so* /lib64/ } function svn(){ cd $ShellFoler/SvnPackages tar -zxvf subversion-1.12.0.tar.gz && unzip sqlite-amalgamation-3280000.zip -d subversion-1.12.0 && cd subversion-1.12.0 && mv sqlite-amalgamation-3280000 sqlite-amalgamation ./configure --prefix=$InstallPath --with-apr=${InstallPath}/lib/apr --with-apr-util=$InstallPath/lib/apr-util --with-serf=$InstallPath/lib/serf --with-lz4=internal --with-utf8proc=internal --enable-mod-activation && make && make install } #********************************************# #svnadmin create /home/svn/blog #svnserve -d -r /home/svn #********************************************# function main(){ cheng apr apr-util scons serf svn echo "Install Sucess!!" ( cat <<EOF #svn export SVN_HOME=$InstallPath export PATH=\$SVN_HOME/bin:\$PATH EOF ) >> /etc/profile echo "Please Input 'source /etc/profile'" } main
使用方法是, 腳本+安裝路徑, 好比我要把svn安裝到/usr/local下, 那麼, 就是./install.sh /usr/localsvn
如此簡單rest
第三, 庫問題sqlite
#************************************************************************* # > File Name: CreateRepo.sh # > Author: chenglee # > Main : chengkenlee@sina.com # > Blog : http://www.cnblogs.com/chenglee/ # > Created Time : 2019年07月05日 星期五 09時29分10秒 #************************************************************************* #!/bin/bash RepoName=$1 RepoPath="/home/svn" function create(){ svnadmin create $RepoPath/$RepoName sleep 1; echo "create repo is success!" } function authz(){ ( cat <<EOF [$RepoName:/] $RepoName = rw EOF ) >> $RepoPath/$RepoName/conf/authz } function passwd(){ echo "$RepoName = 123456" >> $RepoPath/$RepoName/conf/passwd } function svnserve(){ configfile="$RepoPath/$RepoName/conf/svnserve.conf" sed -i "s|# anon-access = read|anon-access = read|g" $configfile sed -i "s|# auth-access = write|auth-access = write|g" $configfile sed -i "s|# password-db = passwd|password-db = passwd|g" $configfile sed -i "s|# authz-db = authz|authz-db = authz|g" $configfile } function update(){ authz passwd svnserve echo "update config is success!" } function restart(){ ps aux | grep svnserve | grep -v grep | awk -F ' ' '{print$2}' | xargs kill -9 sleep 1; #svnserve -d -r $RepoPath --log-file $RepoPath/SvnServer.log ./start.sh echo; echo; echo "Your RepoUrl is : [svn://IP/$RepoName]" echo "Your username and password is : [$RepoName:123456]" echo; echo; } function main(){ create update restart } main
這是一鍵建立庫, 默認鏈接帳號是你的庫名, 默認鏈接密碼是123456, 再簡單不過了, 執行的方式是, 腳本 + 庫名blog
別忘了, 後面要加庫名ip
第四, 啓動
#************************************************************************* # > File Name: start.sh # > Author: chenglee # > Main : chengkenlee@sina.com # > Blog : http://www.cnblogs.com/chenglee/ # > Created Time : 2019年07月05日 星期五 10時16分38秒 #************************************************************************* #!/bin/bash RepoPath="/home/svn" svnserve -d -r $RepoPath --log-file $RepoPath/SvnServer.log
到這裏已經差很少搞掂了, 就是上面編譯那一步耗費一點時間而已, 搭建這玩意5分鐘以內搞掂, 精準
而後就是小烏龜鏈接的那一步了,
算了...
就這樣把,,,
太簡單, 過於講解怕會扭曲意思。