Subversion 1.6.11 をインストールしてみました。
バイナリからのインストールでは環境依存の問題が多く柔軟性に欠けるため、ソースから作ってみます。
技術文書/Solaris/Subversion1.4.3をインストール のページを参考にしてインストールしたバイナリパッケージがあれば、 あらかじめ削除しておきます。
#pre{{ bash-3.00# pkgrm SMCdb SMCexpat SMCgdbm ... }}
#pre{{ bash-3.00# pkginfo | grep SMC system SUNWjmgts Japanese Trusted Extensions, SMC system SUNWmgts Trusted Extensions, SMC application SUNWtsmc Trusted Extensions SMC Server bash-3.00# }}
Sun Studio 12 については別途インストール記事を書きました。
環境変数を設定しておきます。
#pre{{ bash-3.00# export PATH=/usr/local/bin:/opt/sunstudio12.1/bin:/usr/ccs/bin:/usr/sbin:/usr/bin }}
後で依存関係に悩まないよう、 OS インストール時に入った GNU モノ (/usr/sfw/bin/) を使わないようにしています。
ここで新しく作るものは /usr/local/ 以下に入れるものとします。
バイナリは 32bit のものを作ります。
展開します。
#pre{{ bash-3.00# /usr/sfw/bin/gtar xvpfj m4-1.4.14.tar.bz2 }}
configure して make します。
#pre{{ bash-3.00# cd m4-1.4.14 bash-3.00# ./configure --prefix=/usr/local ... bash-3.00# make ... bash-3.00# make install }}
確認します。
#pre{{ bash-3.00# which m4 /usr/local/bin/m4 bash-3.00# m4 --version m4 (GNU M4) 1.4.14 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Written by Rene' Seindal. bash-3.00# }}
m4 と同じような繰り返しになります。
#pre{{ bash-3.00# /usr/sfw/bin/gtar xvpfj autoconf-2.65.tar.bz2 bash-3.00# cd autoconf-2.65 bash-3.00# ./configure --prefix=/usr/local ... bash-3.00# make ... bash-3.00# make install ... bash-3.00# which autoconf /usr/local/bin/autoconf bash-3.00# autoconf --version autoconf (GNU Autoconf) 2.65 Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+/Autoconf: GNU GPL version 3 or later
http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Written by David J. MacKenzie and Akim Demaille. bash-3.00# }}
これも同様です。
#pre{{ bash-3.00# /usr/sfw/bin/gtar xvpfz libtool-2.2.10.tar.gz bash-3.00# cd libtool-2.2.10 bash-3.00# ./configure --prefix=/usr/local ... bash-3.00# make ... bash-3.00# make install ... bash-3.00# which libtool /usr/local/bin/libtool bash-3.00# libtool --version libtool (GNU libtool) 2.2.10 Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. bash-3.00# }}
少々作り方が異なります。大物なので時間も掛かります。
#pre{{ bash-3.00# /usr/sfw/bin/gtar xvpfz openssl-1.0.0a.tar.gz ... bash-3.00# cd openssl-1.0.0a bash-3.00# ./config --prefix=/usr/local shared ... bash-3.00# make ... bash-3.00# make test ... bash-3.00# echo $? 0 }}
make test が成功していることを確認して、 make install します。 もし失敗していれば、$? が 0 以外の値を返すはずです。
#pre{{ bash-3.00# make install ... bash-3.00# which openssl /usr/local/bin/openssl bash-3.00# openssl version OpenSSL 1.0.0a 1 Jun 2010 }}
make のときに各 .c のコンパイルで
#pre{{ cc: 警告: -xarch=v8plus は非推奨です。代わりに -m32 -xarch=sparc を使用してくだ さい }}
というメッセージが出ますが、 make test が通っていれば特に気にしなくても大丈夫です。
32bit で統一して作っているので、 Solaris x86 ではこのようにしたほうがいいようです。
#pre{{ bash-3.00# ./Configure solaris-x86-gcc --prefix=/usr/local shared }}
#pre{{ bash-3.00# /usr/sfw/bin/gtar xvpfj apr-1.4.2.tar.bz2 bash-3.00# cd apr-1.4.2 bash-3.00# ./configure --prefix=/usr/local ... bash-3.00# make ... bash-3.00# make install ... bash-3.00# which apr-1-config /usr/local/bin/apr-1-config bash-3.00# apr-1-config --version 1.4.2 }}
apr-util ではいま作った APR を指定して configure します。
#pre{{ bash-3.00# /usr/sfw/bin/gtar xvpfj apr-util-1.3.9.tar.bz2 bash-3.00# cd apr-util-1.3.9 bash-3.00# ./configure --prefix=/usr/local --with-apr=/usr/local ... bash-3.00# make ... bash-3.00# make install ... bash-3.00# which /usr/local/bin/apu-1-config /usr/local/bin/apu-1-config bash-3.00# /usr/local/bin/apu-1-config --version 1.3.9 }}
configure は昔からなのですがちょっと工夫を要します。 /usr/local/apache2 に入れました。
#pre{{ bash-3.00# /usr/sfw/bin/gtar xvpfj httpd-2.2.15.tar.bz2 ... bash-3.00# cd httpd-2.2.15 bash-3.00# ./configure --prefix=/usr/local/apache2 \
--enable-modules=most --enable-mods-shared=most \
--with-apr=/usr/local/bin/apr-1-config \
--with-apr-util=/usr/local/bin/apu-1-config \
--with-ssl=/usr/local --enable-ssl ... bash-3.00# make ... bash-3.00# make install ... bash-3.00# /usr/local/apache2/bin/httpd -v Server version: Apache/2.2.15 (Unix) Server built: Jun 17 2010 16:35:13 }}
#pre{{ bash-3.00# /usr/sfw/bin/gtar xvpfz neon-0.29.3.tar.gz bash-3.00# cd neon-0.29.3 bash-3.00# ./configure --prefix=/usr/local --with-libs=/usr/local \
--with-ssl=openssl ... configure: Configured to build neon 0.29.3:
Install prefix: /usr/local Compiler: cc XML Parser: libxml 2.6.23 SSL library: SSL support enabled, using OpenSSL (0.9.7 or later) zlib support: zlib support enabled, using -lz Build libraries: Shared=no, Static=yes
bash-3.00# make ... bash-3.00# make install ... bash-3.00# /usr/local/bin/neon-config --version neon 0.29.3 }}
最新版の 0.6.1 では make が通らなかったため、 0.3.1 を利用しました。 あとは OpenSSL を指定するのがポイントです。
neon があれば、serf はなくても大丈夫です。
#pre{{ bash-3.00# /usr/sfw/bin/gtar xvpfj serf-0.3.1.tar.bz2 ... bash-3.00# cd serf-0.3.1 bash-3.00# ./configure --prefix=/usr/local --with-openssl=/usr/local ... bash-3.00# make ... bash-3.00# make install ... }}
#pre{{ bash-3.00# /usr/sfw/bin/gtar xvpfz sqlite-amalgamation-3.6.23.1.tar.gz ... bash-3.00# cd sqlite-3.6.23.1 bash-3.00# ./configure --prefix=/usr/local ... bash-3.00# make ... bash-3.00# make install ... bash-3.00# which sqlite3 /usr/local/bin/sqlite3 bash-3.00# sqlite3 --version 3.6.23.1 }}
#pre{{ bash-3.00# /usr/sfw/bin/gtar xvpfj subversion-1.6.11.tar.bz2 ... }}
依存するライブラリやコマンドを指定して configure します。 subversion-deps-1.6.11.tar.bz2 のファイルを展開すれば必要なものは一緒に作ってくれるとのことですが、 うまくいかなかったので個別に作ったのを指定するようにしています。
#pre{{ bash-3.00# cd subversion-1.6.11 bash-3.00# ./configure --prefix=/usr/local \
--with-apr=/usr/local/bin/apr-1-config \
--with-apr-util=/usr/local/bin/apu-1-config \
--with-neon=/usr/local \
--with-serf=/usr/local \
--with-sqlite=/usr/local \
--without-berkeley-db }}
BerkeleyDB が見つからないという警告が出ますが、 使わないので無視します。 いまの Subversion は標準では FSFS という形式でリポジトリのデータを保持します。
#pre{{ bash-3.00# make ... bash-3.00# make install ... bash-3.00# which svn /usr/local/bin/svn bash-3.00# svn --version svn, version 1.6.11 (r934486)
compiled Jun 17 2010, 17:22:02
Copyright (C) 2000-2009 CollabNet. Subversion is open source software, see http://subversion.tigris.org/ This product includes software developed by CollabNet (http://www.Collab.Net/).
The following repository access (RA) modules are available:
- handles 'http' scheme - handles 'https' scheme
- handles 'svn' scheme
- handles 'file' scheme
- handles 'http' scheme - handles 'https' scheme
bash-3.00# }}
/usr/local/apache2/conf/httpd.conf を編集して、 User と Group を webservd にします。
#pre{{
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
#User daemon
#Group daemon User webservd Group webservd }}
最後に Include も書いておきます。
#pre{{
# Subversion Include conf/httpd-subversion.conf }}
この別出しした設定ファイルも書きます。 DAV 周りはすでに入っていたので、最初の2行はコメントアウトで問題ありません。
#pre{{
#LoadModule dav_svn_module modules/mod_dav_svn.so
#LoadModule authz_svn_module modules/mod_authz_svn.so
Location /svnrepo>
DAV svn SVNParentPath /u01/svnrepo/
AuthType Basic AuthName "Authorization Realm" AuthUserFile /usr/local/apache2/conf/svn-htpasswd Require valid-user
/Location> }}
なお、アクセス制限を書き込みのみに制限することもできます。LimitExcept で除外します。
#pre{{
#LoadModule dav_svn_module modules/mod_dav_svn.so
#LoadModule authz_svn_module modules/mod_authz_svn.so
Location /svnrepo>
DAV svn SVNParentPath /u01/svnrepo/
# Limit write permission to list of valid users. <LimitExcept GET PROPFIND OPTIONS REPORT> AuthType Basic AuthName "Authorization Realm" AuthUserFile /usr/local/apache2/conf/svn-htpasswd Require valid-user </LimitExcept>
/Location> }}
この設定が正しいことを確認します。 今回は上の読み書き両方に制限を掛けるほうを使いました。
#pre{{ bash-3.00# /usr/local/apache2/bin/apachectl configtest Syntax OK }}
起動スクリプトを確認します。 /lib/svc/method/http-apache2 の下記の点を直しました。
#pre{{
#APACHE_HOME=/usr/apache2
#CONF_FILE=/etc/apache2/httpd.conf APACHE_HOME=/usr/local/apache2 CONF_FILE=/usr/local/apache2/conf/httpd.conf }}
起動してみます。
#pre{{ bash-3.00# svcadm disable http bash-3.00# svcadm enable http bash-3.00# svcs -p http STATE STIME FMRI online 17:50:46 svc:/network/http:apache2
17:50:46 27758 httpd 17:50:46 27759 httpd 17:50:46 27760 httpd 17:50:46 27761 httpd 17:50:46 27762 httpd 17:50:46 27763 httpd 17:51:26 27768 httpd
bash-3.00# svcs -xv bash-3.00# }}
問題なく上がってきています。
ユーザを設定します。 /usr/local/apache2/conf/svn-htpasswd が上で設定したパスワードファイルです。
#pre{{ bash-3.00# /usr/local/apache2/bin/htpasswd -c /usr/local/apache2/conf/svn-htpasswd sugimura New password: Re-type new password: Adding password for user sugimura bash-3.00# }}
この後ユーザを追加していくときは -c は不要です。
これは以前作ったリポジトリだったため、checkout からしてみます。
#pre{{
ATTENTION! Your password for authentication realm:
<http://localhost:80> Authorization Realm
can only be stored to disk unencrypted! You are advised to configure your system so that Subversion can store passwords encrypted, if possible. See the documentation for details.
You can avoid future appearances of this warning by setting the value of the 'store-plaintext-passwords' option to either 'yes' or 'no' in '/home/sugimura/.subversion/servers'.
Store password unencrypted (yes/no)? no A myrepo/subversion_sample.txt Checked out revision 1.
ファイルもちゃんと管理されていることがわかります。
#pre{{
r1 | sugimura | 2010-04-06 17:36:35 +0900 (火, 06 4月 2010) | 1 line
first commit
Python と Subversion の連携モジュールも作りました。
上の Subversion 1.6.11 をコンパイルした環境で make します。 消してしまったときは configure からやり直してください。
#pre{{ bash-3.00# cd subversion-1.6.11 bash-3.00# make swig-py ... bash-3.00# make install-swig-py ... }}
/usr/local/lib/svn-python/ 以下に入るので、 python に教えてあげます。
#pre{{ bash-3.00# echo "/usr/local/lib/svn-python" > /usr/lib/python2.4/site-packages/svn-python.pth }}
ちゃんとインストールされているかどうかは python から確認できます。
#pre{{ bash-3.00# python Python 2.4.4 (#1, Jan 10 2007, 01:25:01) [C] on sunos5 Type "help", "copyright", "credits" or "license" for more information.
from svn import fs, repos, core, delta
^D bash-3.00# }}
from ... の文でエラーが出なければ OK です。
技術文書/Solaris/Trac0.11.7.ja1をインストール では リポジトリへのアクセスに失敗していましたが、 このモジュールが入れば大丈夫です。