KanonConductor

changeset 18:c3099c3aa885 centos5-support

Subversion 1.6をインストールするオプションを追加。 システムの一部を汚すのでアンインストールシェルも追加。
author tanacasino <tanaka.tomohumi@gmail.com>
date Mon, 21 Mar 2011 14:24:26 +0900
parents 01209a6aabbd
children 25f4428e12c2
files kanon-setup pkglist.rhel5 subversion-16-uninstall.sh subversion-16-upgrade.sh
diffstat 4 files changed, 354 insertions(+), 13 deletions(-) [+]
line diff
     1.1 --- a/kanon-setup	Fri Mar 11 08:28:46 2011 +0900
     1.2 +++ b/kanon-setup	Mon Mar 21 14:24:26 2011 +0900
     1.3 @@ -65,8 +65,43 @@
     1.4          yum -y install `cat pkglist.rhel6`
     1.5          ;;
     1.6      rhel5)
     1.7 -        # TODO 環境によっては失敗する模様(proxy環境?)wget してからローカルファイルをインストールに変更する.
     1.8 -        rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
     1.9 +        # Upgrade Subversion.
    1.10 +        # FIXME もっといい文言を頼む.
    1.11 +        echo ""
    1.12 +        echo ""
    1.13 +        echo "KanonでのSubversionの利用について"
    1.14 +        echo "CentOS 5.x でSubversion連携を動作させるには、"
    1.15 +        echo "Python 2.6用の Subversionバインディングのインストールが必要となります。"
    1.16 +        echo "CentOS 5.x ではパッケージが提供されていないため、"
    1.17 +        echo "そのままではSubversion連携を動かすことができません。"
    1.18 +        echo "Kanonでは、最新のSubversion 1.6をインストールするオプションを提供します。"
    1.19 +        echo "インストールした場合システムに対し下記の影響があります。"
    1.20 +        echo " * CentOS 5.x 標準の subversion, mod_dav_svnパッケージの削除"
    1.21 +        echo " * /opt/kanon を prefixとしてSubversion 1.6のファイルを配置"
    1.22 +        echo " * /etc/yum.conf に exclude=subversion, mod_dav_svn の設定を追記"
    1.23 +        echo " * Apache モジュールのインストール"
    1.24 +        echo "   /usr/lib64/httpd/modules/mod_authz_svn.so"
    1.25 +        echo "   /usr/lib64/httpd/modules/mod_dav_svn.so"
    1.26 +        echo "   or"
    1.27 +        echo "   /usr/lib/httpd/modules/mod_authz_svn.so"
    1.28 +        echo "   /usr/lib/httpd/modules/mod_dav_svn.so"
    1.29 +        echo " * Apacheの設定ファイルにモジュールのロードを行う設定の追記"
    1.30 +        echo "   LoadModule dav_svn_module     /usr/lib64/httpd/modules/mod_dav_svn.so"
    1.31 +        echo "   LoadModule authz_svn_module   /usr/lib64/httpd/modules/mod_authz_svn.so"
    1.32 +        echo "   or"
    1.33 +        echo "   LoadModule dav_svn_module     /usr/lib/httpd/modules/mod_dav_svn.so"
    1.34 +        echo "   LoadModule authz_svn_module   /usr/lib/httpd/modules/mod_authz_svn.so"
    1.35 +        echo "アップグレードしたSubversionをアンインストールする場合は、"
    1.36 +        echo "subversion-16-uninstall.sh を使用してください。"
    1.37 +        echo ""
    1.38 +        echo -n "Subversionをアップグレードする?(y/n) "
    1.39 +        read UPGRADE_SVN
    1.40 +
    1.41 +        # Add EPEL Repositories. For python26, python26-devel, python26-mod_wsgi.
    1.42 +        EPEL_RPM_URL="http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm"
    1.43 +        wget $EPEL_RPM_URL
    1.44 +        rpm -Uvh epel-release-5-4.noarch.rpm
    1.45 +        rm -f epel-release-5-4.noarch.rpm
    1.46          yum -y install `cat pkglist.rhel5`
    1.47          ;;
    1.48      *)
    1.49 @@ -75,7 +110,7 @@
    1.50  
    1.51  ### install files
    1.52  cp -fr opt/* /opt
    1.53 -if [ "$OS" == "rhel5" ]
    1.54 +if [ "$OS" = "rhel5" ]
    1.55  then
    1.56      # FIXME CentOS 5.x では n オプションがないため 強制上書きになってしまう.
    1.57      cp -fr etc/* /etc
    1.58 @@ -99,9 +134,15 @@
    1.59  fi
    1.60  
    1.61  
    1.62 -### install python components
    1.63 -if [ "$OS" == "rhel5" ]
    1.64 +if [ "$OS" = "rhel5" ]
    1.65  then
    1.66 +    # Install Subversion.
    1.67 +    if [ "$UPGRADE_SVN" = "y" ]
    1.68 +    then
    1.69 +        ./subversion-16-upgrade.sh
    1.70 +    else
    1.71 +        yum -y install subversion mod_dav_svn
    1.72 +    fi
    1.73      # Install Extra Package for CentOS 5.X
    1.74      easy_install "mercurial==1.7.3"
    1.75      easy_install bzr
    1.76 @@ -175,12 +216,8 @@
    1.77          ;;
    1.78      rhel5)
    1.79          mkdir -p /var/opt/kanon/trac/.egg-cache
    1.80 -        chown apache:apache -R /var/opt/kanon/trac/.egg-cache/
    1.81 +        chown $APACHE_USER:$APACHE_USER -R /var/opt/kanon/trac/.egg-cache/
    1.82          mkdir -p /usr/lib/python2.6/site-packages/bzrlib/plugin
    1.83 -        # FIXME only works i386.
    1.84 -        ln -s /usr/lib/python2.4/site-packages/libsvn /opt/kanon/lib/python2.6/site-packages/
    1.85 -        ln -s /usr/lib/python2.4/site-packages/svn /opt/kanon/lib/python2.6/site-packages/
    1.86 -
    1.87          cp resource/trac_hook.py /usr/lib/python2.6/site-packages/bzrlib/plugin
    1.88          if [ ! -f /etc/httpd/conf.d/kanon.conf ]
    1.89          then
     2.1 --- a/pkglist.rhel5	Fri Mar 11 08:28:46 2011 +0900
     2.2 +++ b/pkglist.rhel5	Mon Mar 21 14:24:26 2011 +0900
     2.3 @@ -3,7 +3,4 @@
     2.4  python26-mod_wsgi
     2.5  httpd
     2.6  sqlite
     2.7 -mod_dav_svn
     2.8 -subversion
     2.9  gcc
    2.10 -git
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/subversion-16-uninstall.sh	Mon Mar 21 14:24:26 2011 +0900
     3.3 @@ -0,0 +1,198 @@
     3.4 +#!/bin/bash
     3.5 +# -*- coding:utf-8 -*-
     3.6 +
     3.7 +# subversion-16-upgrade.sh でインストールしたSubversionをアンインストールする.
     3.8 +
     3.9 +
    3.10 +export KANON_HOME=/opt/kanon
    3.11 +
    3.12 +function not_supported {
    3.13 +    echo "サポートされていないOSです。"
    3.14 +    echo "現在サポートされいているOSは、"
    3.15 +    echo ""
    3.16 +    echo "  * CentOS 5.x (Experimental)"
    3.17 +    echo ""
    3.18 +    echo "です。"
    3.19 +    exit 1
    3.20 +}
    3.21 +
    3.22 +function check_os {
    3.23 +    if [ ! -f /etc/redhat-release ]
    3.24 +    then
    3.25 +        not_supported
    3.26 +    else
    3.27 +        CHK=`egrep "CentOS release 5|Red Hat Enterprise Linux .* 5" /etc/redhat-release`
    3.28 +        if [ "$CHK" == '' ]
    3.29 +        then
    3.30 +            not_supported
    3.31 +        fi
    3.32 +    fi
    3.33 +}
    3.34 +
    3.35 +check_os
    3.36 +
    3.37 +
    3.38 +# Apache Modules.
    3.39 +rm -f /usr/lib/httpd/modules/mod_authz_svn.so
    3.40 +rm -f /usr/lib/httpd/modules/mod_dav_svn.so
    3.41 +rm -f /usr/lib64/httpd/modules/mod_authz_svn.so
    3.42 +rm -f /usr/lib64/httpd/modules/mod_dav_svn.so
    3.43 +
    3.44 +# Subversion Commands.
    3.45 +rm -f /opt/kanon/bin/neon-config
    3.46 +rm -f /opt/kanon/bin/svn
    3.47 +rm -f /opt/kanon/bin/svnadmin
    3.48 +rm -f /opt/kanon/bin/svndumpfilter
    3.49 +rm -f /opt/kanon/bin/svnlook
    3.50 +rm -f /opt/kanon/bin/svnserve
    3.51 +rm -f /opt/kanon/bin/svnsync
    3.52 +rm -f /opt/kanon/bin/svnversion
    3.53 +
    3.54 +# include headers.
    3.55 +rm -rf /opt/kanon/include/neon
    3.56 +rm -rf /opt/kanon/include/serf-0
    3.57 +rm -rf /opt/kanon/include/subversion-1
    3.58 +
    3.59 +# python bindings for subversion.
    3.60 +rm -rf /opt/kanon/lib/svn-python
    3.61 +rm -f /opt/kanon/lib/python2.6/site-packages/libsvn
    3.62 +rm -f /opt/kanon/lib/python2.6/site-packages/svn
    3.63 +
    3.64 +# libs.
    3.65 +rm -rf /opt/kanon/lib/libneon*
    3.66 +rm -rf /opt/kanon/lib/libserf-0.*
    3.67 +rm -rf /opt/kanon/lib/libsvn_*
    3.68 +
    3.69 +# package config.
    3.70 +rm -f /opt/kanon/lib/pkgconfig/neon.pc
    3.71 +
    3.72 +# man
    3.73 +rm -f /opt/kanon/man/man1/svn.1
    3.74 +rm -f /opt/kanon/man/man1/svnadmin.1
    3.75 +rm -f /opt/kanon/man/man1/svndumpfilter.1
    3.76 +rm -f /opt/kanon/man/man1/svnlook.1
    3.77 +rm -f /opt/kanon/man/man1/svnsync.1
    3.78 +rm -f /opt/kanon/man/man1/svnversion.1
    3.79 +rm -f /opt/kanon/man/man5/svnserve.conf.5
    3.80 +rm -f /opt/kanon/man/man8/svnserve.8
    3.81 +
    3.82 +# share doc.
    3.83 +rm -rf /opt/kanon/share/doc/neon-0.28.6
    3.84 +
    3.85 +# share locale.
    3.86 +rm -f /opt/kanon/share/locale/cs/LC_MESSAGES/neon.mo
    3.87 +rm -f /opt/kanon/share/locale/de/LC_MESSAGES/neon.mo
    3.88 +rm -f /opt/kanon/share/locale/de/LC_MESSAGES/subversion.mo
    3.89 +rm -f /opt/kanon/share/locale/es/LC_MESSAGES/subversion.mo
    3.90 +rm -f /opt/kanon/share/locale/fr/LC_MESSAGES/neon.mo
    3.91 +rm -f /opt/kanon/share/locale/fr/LC_MESSAGES/subversion.mo
    3.92 +rm -f /opt/kanon/share/locale/it/LC_MESSAGES/subversion.mo
    3.93 +rm -f /opt/kanon/share/locale/ja/LC_MESSAGES/neon.mo
    3.94 +rm -f /opt/kanon/share/locale/ja/LC_MESSAGES/subversion.mo
    3.95 +rm -f /opt/kanon/share/locale/ko/LC_MESSAGES/subversion.mo
    3.96 +rm -f /opt/kanon/share/locale/nb/LC_MESSAGES/subversion.mo
    3.97 +rm -f /opt/kanon/share/locale/nn/LC_MESSAGES/neon.mo
    3.98 +rm -f /opt/kanon/share/locale/pl/LC_MESSAGES/neon.mo
    3.99 +rm -f /opt/kanon/share/locale/pl/LC_MESSAGES/subversion.mo
   3.100 +rm -f /opt/kanon/share/locale/pt_BR/LC_MESSAGES/subversion.mo
   3.101 +rm -f /opt/kanon/share/locale/ru/LC_MESSAGES/neon.mo
   3.102 +rm -f /opt/kanon/share/locale/sv/LC_MESSAGES/subversion.mo
   3.103 +rm -f /opt/kanon/share/locale/tr/LC_MESSAGES/neon.mo
   3.104 +rm -f /opt/kanon/share/locale/zh_CN/LC_MESSAGES/neon.mo
   3.105 +rm -f /opt/kanon/share/locale/zh_CN/LC_MESSAGES/subversion.mo
   3.106 +rm -f /opt/kanon/share/locale/zh_TW/LC_MESSAGES/subversion.mo
   3.107 +
   3.108 +# share man.
   3.109 +rm -f /opt/kanon/share/man/man1/neon-config.1
   3.110 +rm -f /opt/kanon/share/man/man3/ne_add_request_header.3
   3.111 +rm -f /opt/kanon/share/man/man3/ne_addr_destroy.3
   3.112 +rm -f /opt/kanon/share/man/man3/ne_addr_error.3
   3.113 +rm -f /opt/kanon/share/man/man3/ne_addr_first.3
   3.114 +rm -f /opt/kanon/share/man/man3/ne_addr_next.3
   3.115 +rm -f /opt/kanon/share/man/man3/ne_addr_resolve.3
   3.116 +rm -f /opt/kanon/share/man/man3/ne_addr_result.3
   3.117 +rm -f /opt/kanon/share/man/man3/ne_buffer.3
   3.118 +rm -f /opt/kanon/share/man/man3/ne_buffer_altered.3
   3.119 +rm -f /opt/kanon/share/man/man3/ne_buffer_append.3
   3.120 +rm -f /opt/kanon/share/man/man3/ne_buffer_clear.3
   3.121 +rm -f /opt/kanon/share/man/man3/ne_buffer_concat.3
   3.122 +rm -f /opt/kanon/share/man/man3/ne_buffer_create.3
   3.123 +rm -f /opt/kanon/share/man/man3/ne_buffer_destroy.3
   3.124 +rm -f /opt/kanon/share/man/man3/ne_buffer_finish.3
   3.125 +rm -f /opt/kanon/share/man/man3/ne_buffer_grow.3
   3.126 +rm -f /opt/kanon/share/man/man3/ne_buffer_ncreate.3
   3.127 +rm -f /opt/kanon/share/man/man3/ne_buffer_zappend.3
   3.128 +rm -f /opt/kanon/share/man/man3/ne_calloc.3
   3.129 +rm -f /opt/kanon/share/man/man3/ne_close_connection.3
   3.130 +rm -f /opt/kanon/share/man/man3/ne_forget_auth.3
   3.131 +rm -f /opt/kanon/share/man/man3/ne_get_error.3
   3.132 +rm -f /opt/kanon/share/man/man3/ne_get_request_flag.3
   3.133 +rm -f /opt/kanon/share/man/man3/ne_get_response_header.3
   3.134 +rm -f /opt/kanon/share/man/man3/ne_get_scheme.3
   3.135 +rm -f /opt/kanon/share/man/man3/ne_get_server_hostport.3
   3.136 +rm -f /opt/kanon/share/man/man3/ne_get_session_flag.3
   3.137 +rm -f /opt/kanon/share/man/man3/ne_get_status.3
   3.138 +rm -f /opt/kanon/share/man/man3/ne_has_support.3
   3.139 +rm -f /opt/kanon/share/man/man3/ne_i18n_init.3
   3.140 +rm -f /opt/kanon/share/man/man3/ne_iaddr_cmp.3
   3.141 +rm -f /opt/kanon/share/man/man3/ne_iaddr_free.3
   3.142 +rm -f /opt/kanon/share/man/man3/ne_iaddr_make.3
   3.143 +rm -f /opt/kanon/share/man/man3/ne_iaddr_print.3
   3.144 +rm -f /opt/kanon/share/man/man3/ne_iaddr_typeof.3
   3.145 +rm -f /opt/kanon/share/man/man3/ne_malloc.3
   3.146 +rm -f /opt/kanon/share/man/man3/ne_oom_callback.3
   3.147 +rm -f /opt/kanon/share/man/man3/ne_print_request_header.3
   3.148 +rm -f /opt/kanon/share/man/man3/ne_qtoken.3
   3.149 +rm -f /opt/kanon/share/man/man3/ne_realloc.3
   3.150 +rm -f /opt/kanon/share/man/man3/ne_request_create.3
   3.151 +rm -f /opt/kanon/share/man/man3/ne_request_destroy.3
   3.152 +rm -f /opt/kanon/share/man/man3/ne_request_dispatch.3
   3.153 +rm -f /opt/kanon/share/man/man3/ne_response_header_iterate.3
   3.154 +rm -f /opt/kanon/share/man/man3/ne_session_create.3
   3.155 +rm -f /opt/kanon/share/man/man3/ne_session_destroy.3
   3.156 +rm -f /opt/kanon/share/man/man3/ne_session_proxy.3
   3.157 +rm -f /opt/kanon/share/man/man3/ne_set_connect_timeout.3
   3.158 +rm -f /opt/kanon/share/man/man3/ne_set_error.3
   3.159 +rm -f /opt/kanon/share/man/man3/ne_set_proxy_auth.3
   3.160 +rm -f /opt/kanon/share/man/man3/ne_set_read_timeout.3
   3.161 +rm -f /opt/kanon/share/man/man3/ne_set_request_body_buffer.3
   3.162 +rm -f /opt/kanon/share/man/man3/ne_set_request_body_fd.3
   3.163 +rm -f /opt/kanon/share/man/man3/ne_set_request_body_fd64.3
   3.164 +rm -f /opt/kanon/share/man/man3/ne_set_request_flag.3
   3.165 +rm -f /opt/kanon/share/man/man3/ne_set_server_auth.3
   3.166 +rm -f /opt/kanon/share/man/man3/ne_set_session_flag.3
   3.167 +rm -f /opt/kanon/share/man/man3/ne_set_useragent.3
   3.168 +rm -f /opt/kanon/share/man/man3/ne_shave.3
   3.169 +rm -f /opt/kanon/share/man/man3/ne_sock_exit.3
   3.170 +rm -f /opt/kanon/share/man/man3/ne_sock_init.3
   3.171 +rm -f /opt/kanon/share/man/man3/ne_ssl_cert_cmp.3
   3.172 +rm -f /opt/kanon/share/man/man3/ne_ssl_cert_export.3
   3.173 +rm -f /opt/kanon/share/man/man3/ne_ssl_cert_free.3
   3.174 +rm -f /opt/kanon/share/man/man3/ne_ssl_cert_identity.3
   3.175 +rm -f /opt/kanon/share/man/man3/ne_ssl_cert_import.3
   3.176 +rm -f /opt/kanon/share/man/man3/ne_ssl_cert_issuer.3
   3.177 +rm -f /opt/kanon/share/man/man3/ne_ssl_cert_read.3
   3.178 +rm -f /opt/kanon/share/man/man3/ne_ssl_cert_signedby.3
   3.179 +rm -f /opt/kanon/share/man/man3/ne_ssl_cert_subject.3
   3.180 +rm -f /opt/kanon/share/man/man3/ne_ssl_cert_write.3
   3.181 +rm -f /opt/kanon/share/man/man3/ne_ssl_clicert_decrypt.3
   3.182 +rm -f /opt/kanon/share/man/man3/ne_ssl_clicert_encrypted.3
   3.183 +rm -f /opt/kanon/share/man/man3/ne_ssl_clicert_free.3
   3.184 +rm -f /opt/kanon/share/man/man3/ne_ssl_clicert_name.3
   3.185 +rm -f /opt/kanon/share/man/man3/ne_ssl_clicert_owner.3
   3.186 +rm -f /opt/kanon/share/man/man3/ne_ssl_clicert_read.3
   3.187 +rm -f /opt/kanon/share/man/man3/ne_ssl_dname_cmp.3
   3.188 +rm -f /opt/kanon/share/man/man3/ne_ssl_readable_dname.3
   3.189 +rm -f /opt/kanon/share/man/man3/ne_ssl_set_verify.3
   3.190 +rm -f /opt/kanon/share/man/man3/ne_ssl_trust_cert.3
   3.191 +rm -f /opt/kanon/share/man/man3/ne_ssl_trust_default_ca.3
   3.192 +rm -f /opt/kanon/share/man/man3/ne_status.3
   3.193 +rm -f /opt/kanon/share/man/man3/ne_strdup.3
   3.194 +rm -f /opt/kanon/share/man/man3/ne_strndup.3
   3.195 +rm -f /opt/kanon/share/man/man3/ne_token.3
   3.196 +rm -f /opt/kanon/share/man/man3/ne_version_match.3
   3.197 +rm -f /opt/kanon/share/man/man3/ne_version_string.3
   3.198 +rm -f /opt/kanon/share/man/man3/ne_xml_create.3
   3.199 +rm -f /opt/kanon/share/man/man3/ne_xml_destroy.3
   3.200 +rm -f /opt/kanon/share/man/man3/neon.3
   3.201 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/subversion-16-upgrade.sh	Mon Mar 21 14:24:26 2011 +0900
     4.3 @@ -0,0 +1,109 @@
     4.4 +#!/bin/bash
     4.5 +# -*- coding:utf-8 -*-
     4.6 +
     4.7 +# Upgrade Subversion 1.4 to 1.6 for CentOS 5.x
     4.8 +# This scirpt is experimental.
     4.9 +
    4.10 +export KANON_HOME=/opt/kanon
    4.11 +
    4.12 +function not_supported {
    4.13 +    echo "サポートされていないOSです。"
    4.14 +    echo "現在サポートされいているOSは、"
    4.15 +    echo ""
    4.16 +    echo "  * CentOS 5.x (Experimental)"
    4.17 +    echo ""
    4.18 +    echo "です。"
    4.19 +    exit 1
    4.20 +}
    4.21 +
    4.22 +function check_os {
    4.23 +    if [ ! -f /etc/redhat-release ]
    4.24 +    then
    4.25 +        not_supported
    4.26 +    else
    4.27 +        CHK=`egrep "CentOS release 5|Red Hat Enterprise Linux .* 5" /etc/redhat-release`
    4.28 +        if [ "$CHK" == '' ]
    4.29 +        then
    4.30 +            not_supported
    4.31 +        fi
    4.32 +    fi
    4.33 +}
    4.34 +
    4.35 +check_os
    4.36 +
    4.37 +# remove old subversion packages.
    4.38 +yum -y remove subversion mod_dav_svn
    4.39 +
    4.40 +# Install required packages to build subversion1.6.
    4.41 +yum -y install autoconf libtool apr-devel apr-util-devel openssl-devel httpd-devel
    4.42 +
    4.43 +# download source code and deps.
    4.44 +wget http://subversion.tigris.org/downloads/subversion-1.6.16.tar.bz2
    4.45 +wget http://subversion.tigris.org/downloads/subversion-deps-1.6.16.tar.bz2
    4.46 +tar -jxf subversion-1.6.16.tar.bz2
    4.47 +tar -jxf subversion-deps-1.6.16.tar.bz2
    4.48 +
    4.49 +cd subversion-1.6.16
    4.50 +
    4.51 +# set env.
    4.52 +source ${KANON_HOME}/bin/activate
    4.53 +
    4.54 +sh ./autogen.sh
    4.55 +
    4.56 +./configure \
    4.57 +--prefix=/opt/kanon \
    4.58 +--with-apr=/usr/bin/apr-1-config \
    4.59 +--with-apr-util=/usr/bin/apu-1-config \
    4.60 +--with-apxs=/usr/sbin/apxs
    4.61 +
    4.62 +# Make subversion commands and libs.
    4.63 +make
    4.64 +make install
    4.65 +
    4.66 +# Make python bindings for subversion.
    4.67 +make swig-py
    4.68 +make install-swig-py
    4.69 +
    4.70 +# Remove old python bindings for subversion from kanon's python libs.
    4.71 +KANON_PYTHON_LIB=$KANON_HOME/lib/python2.6/site-packages
    4.72 +rm -rf $KANON_PYTHON_LIB/libsvn*
    4.73 +rm -rf $KANON_PYTHON_LIB/svn*
    4.74 +
    4.75 +# Install new python bindings for subversion.
    4.76 +ln -sf $KANON_HOME/lib/svn-python/libsvn $KANON_PYTHON_LIB/libsvn
    4.77 +ln -sf $KANON_HOME/lib/svn-python/svn $KANON_PYTHON_LIB/svn
    4.78 +
    4.79 +# settings to exclude subverion and mod_dav_svn from yum.conf.
    4.80 +YUM_CONF=/etc/yum.conf
    4.81 +
    4.82 +SVN_PACKAGE="subversion"
    4.83 +MOD_DAV_SVN_PACKAGE="mod_dav_svn"
    4.84 +PACKAGES="${SVN_PACKAGE}, ${MOD_DAV_SVN_PACKAGE}"
    4.85 +
    4.86 +EXCLUDE=`grep "^exclude=" ${YUM_CONF}`
    4.87 +if [ "${EXCLUDE}" = '' ]
    4.88 +then
    4.89 +    NEW_EXCLUDE="exclude=${PACKAGES}"
    4.90 +    echo ${NEW_EXCLUDE} >> ${YUM_CONF}
    4.91 +else
    4.92 +    EXCLUDE_SVN=`echo $EXCLUDE | grep "${SVN_PACKAGE}"`
    4.93 +    EXCLUDE_MOD_DAV_SVN=`echo $EXCLUDE | grep "${MOD_DAV_SVN_PACKAGE}"`
    4.94 +    if [ "${EXCLUDE_SVN}" = '' -a "${EXCLUDE_MOD_DAV_SVN}" = '' ]
    4.95 +    then
    4.96 +        # no exclude subversion and mod_dav_svn.
    4.97 +        NEW_EXCLUDE=${EXCLUDE}", ${PACKAGES}"
    4.98 +    elif [ "${EXCLUDE_SVN}" = '' -a "${EXCLUDE_MOD_DAV_SVN}" != '' ]
    4.99 +    then
   4.100 +        # already exclude mod_dav_svn.
   4.101 +        NEW_EXCLUDE=${EXCLUDE}", ${SVN_PACKAGE}"
   4.102 +    elif [ "${EXCLUDE_SVN}" != '' -a "${EXCLUDE_MOD_DAV_SVN}" = '' ]
   4.103 +    then
   4.104 +        # already exclude subversion.
   4.105 +        NEW_EXCLUDE=${EXCLUDE}", ${MOD_DAV_SVN_PACKAGE}"
   4.106 +    else
   4.107 +        # already exclude subversion and mod_dav_svn.
   4.108 +        exit
   4.109 +    fi
   4.110 +    sed -i -e "s/^exclude=.*/${NEW_EXCLUDE}/" ${YUM_CONF}
   4.111 +fi
   4.112 +