Subversion設定メモ

出典: Wikimura

バージョン管理ソフトウェアのSubversionをインストールするためのメモ。 普通ならyumで一発だが、x86_64系だと古いバージョン(1.4.2)しか手に入らない。 そこで自分でビルドすることにした。

インストール

依存関係が結構多い。最小限必要なものはsubversion-depsとして配布されている。 subversion-deps-1.6.6は展開するとsubversion-1.6.6に格納される。

詳細はsubversion-1.6.6のINSTALLに書いてある。apr、apr-util、serf、neonがない場合は、自動的にビルドされる。 sqliteも自動らしい。zlibは自分でインストール必要があるのかもしれない。

まずは以下のスクリプトを実行すると、必要なものがあるかどうかが分かる。 これでOKなら次に進んでも良い。 ただ、aprとapr-utilでなにか言われるかもしれないが、これは無視しても良い。(depsで付いてくるやつは使わないので)

./autogen.sh


まず必要なものをyumから持ってくる。 研究室のサーバでは、以下が足りていなかった。zlibは必須だが、既に入っていた。

  • httpd-devel: apr, apr-util, apxs
    • 最初の2つはSubversionに必須なためdepsにも付属しているが、yumで提供されているので利用する。
    • apxsはmod_dav_svnのビルドに必須。
  • libtool: 必須
  • python-devel: tracからsvnを利用するためのswigをビルドするのに必要
  • gcc-c++: serfのビルドに必要
  • openssl: serfで必要だったはず
  • libxml2: 失念
yum install httpd-devel.x86_64
yum install libtool.x86_64
yum install gcc-c++
yum install python-devel.x86_64
yum install openssl-devel.x86_64
yum install libxml2-devel.x86_64


configureは自動的に検索してくれるが、aprとapr-utilに関しては見つからないらしいので教えてあげる必要がある。 明示的にmod_dav_svnを作るようにするには、--with-httpdオプションを指定する? クライアントがhttps://のスキーマを使用できるようにするには、neon用のオプション--with-sslを有効化する。

./configure --prefix=/usr/local --with-apr=/usr --with-apr-util=/usr --with-httpd --with-ssl
make
make check
make install


tracを利用するつもりなので、python用のswigをビルドする。やりかたは、INSTALLに書かれているように、「(subversion_source_dir)/subversion/bindings/swig/INSTALL」を参照する。perl用にするなら以下のpyをplに置き換えてやる。

make swig-py
make check-swig-py
make install-swig-py

configure

configure: Configuring Subversion 1.6.6
configure: creating config.nice
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C preprocessor... gcc -E
checking build system type... x86_64-redhat-linux-gnu
checking host system type... x86_64-redhat-linux-gnu
checking target system type... x86_64-redhat-linux-gnu
checking for egrep... grep -E
checking whether ln -s works... yes
checking for a BSD-compatible install... /usr/bin/install -c
configure: Apache Portable Runtime (APR) library configuration
checking for APR... yes
checking APR version... 1.2.7
configure: Apache Portable Runtime Utility (APRUTIL) library configuration
checking for APR-util... yes
checking APR-UTIL version... 1.2.7
checking for pkg-config... /usr/bin/pkg-config
configure: checking neon library
checking neon library version... 0.28.6
Using neon found in source directory.
configure: configuring package in neon now
configure: WARNING: unrecognized options: --with-httpd, --with-apr, --with-apr-util
checking for a BSD-compatible install... /usr/bin/install -c
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for inline... inline
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for off_t... yes
checking for uname... Linux
checking whether make sets $(MAKE)... yes
checking size of int... 4
checking size of long... 8
checking size of long long... 8
checking for gcc -Wformat -Werror sanity... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking size of size_t... 8
checking how to print size_t... lu
checking size of off_t... 8
checking how to print off_t... ld
checking size of ssize_t... 8
checking how to print ssize_t... ld
checking whether byte ordering is bigendian... no
checking whether strerror_r is declared... yes
checking for strerror_r... yes
checking whether strerror_r returns char *... yes
checking for snprintf... yes
checking for vsnprintf... yes
checking for sys/time.h... yes
checking for limits.h... yes
checking for sys/select.h... yes
checking for arpa/inet.h... yes
checking for libintl.h... yes
checking for signal.h... yes
checking for sys/socket.h... yes
checking for netinet/in.h... yes
checking for netinet/tcp.h... yes
checking for netdb.h... yes
checking for sys/poll.h... yes
checking for sys/limits.h... no
checking for fcntl.h... yes
checking for iconv.h... yes
checking for timezone global... yes
configure: LFS support unnecessary, off_t is not 32-bit
checking for strtoll... yes
checking for strcasecmp... yes
checking for signal... yes
checking for setvbuf... yes
checking for setsockopt... yes
checking for stpcpy... yes
checking for poll... yes
checking for fcntl... yes
checking for getsockopt... yes
checking whether stpcpy is declared... yes
checking for library containing socket... none needed
checking for library containing getaddrinfo... none needed
checking for gai_strerror... yes
checking for getnameinfo... yes
checking for inet_ntop... yes
configure: IPv6 support is enabled
checking for working AI_ADDRCONFIG... yes
checking for socklen_t... yes
checking for struct tm.tm_gmtoff... yes
checking for struct tm.__tm_gmtoff... no
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for inflate in -lz... yes
configure: zlib support enabled, using -lz
checking whether to enable ACL support in neon... yes
configure: SSL support is not enabled
configure: Thread-safe SSL support is not enabled
configure: Thread-safe SSL not supported
configure: SOCKSv5 support is not enabled
checking for krb5-config... /usr/kerberos/bin/krb5-config
checking gssapi/gssapi.h usability... yes
checking gssapi/gssapi.h presence... yes
checking for gssapi/gssapi.h... yes
checking for gss_init_sec_context... yes
configure: GSSAPI authentication support enabled
checking gssapi/gssapi_generic.h usability... yes
checking gssapi/gssapi_generic.h presence... yes
checking for gssapi/gssapi_generic.h... yes
checking whether GSS_C_NT_HOSTBASED_SERVICE is declared... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 98304
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking size of time_t... 8
checking how to print time_t... ld
checking for pid_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for ar... /usr/bin/ar
checking for ranlib... /usr/bin/ranlib
checking for sys/time.h... (cached) yes
checking for stdint.h... (cached) yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for pipe... yes
checking for isatty... yes
checking for usleep... yes
checking for shutdown... yes
checking for setlocale... yes
configure: WebDAV support is enabled
checking expat.h usability... yes
checking expat.h presence... yes
checking for expat.h... yes
checking for XML_SetXmlDeclHandler in -lexpat... yes
checking for XML_Size... no
configure: XML parser used: expat
checking for library containing bindtextdomain... none needed
checking for bind_textdomain_codeset... yes
configure: Internationalization support enabled
configure: debugging is enabled
checking for pkg-config... /usr/bin/pkg-config
configure: creating ./config.status
config.status: creating neon-config
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating test/Makefile
config.status: creating neon.pc
config.status: creating test/makekeys
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing libtool commands
configure: WARNING: unrecognized options: --with-httpd, --with-apr, --with-apr-util
configure: Configured to build neon 0.28.6:

  Install prefix:  /usr/local
  Compiler:        gcc
  XML Parser:      expat
  SSL library:     SSL support is not enabled
  zlib support:    zlib support enabled, using -lz
  Build libraries: Shared=no, Static=yes

neon configured properly
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
configure: configuring package in serf now
checking for chosen layout... Serf
checking for working mkdir -p... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu

Configuring Apache Portable Runtime library...

checking for APR... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting APR_LIBTOOL to "/usr/lib64/apr-1/build/libtool"
  setting CFLAGS to "  -pthread"
  setting CPPFLAGS to " -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE"
  setting LDFLAGS to " "
  setting LTFLAGS to "--silent"

Configuring Apache Portable Runtime Utility library...

checking for APR-util... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for a BSD-compatible install... /usr/bin/install -c
Configuring Serf...

checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking openssl/opensslv.h usability... yes
checking openssl/opensslv.h presence... yes
checking for openssl/opensslv.h... yes
checking for library containing fabs... -lm
  setting SERF_LIBS to " /usr/lib64/libaprutil-1.la -lldap -llber -ldb-4.3 -lexpat  /usr/lib64/libapr-1.la  -lpthread -ldl -lm "
configure: creating ./config.status
config.status: creating Makefile
config.status: executing mkdir-vpath commands
serf configured properly
configure: looking for apr_memcache as part of apr-util
checking apr_memcache.h usability... no
checking apr_memcache.h presence... no
checking for apr_memcache.h... no
checking for Apache module support via DSO through APXS... found at /usr/sbin/apxs
checking httpd version... recent enough
checking whether Apache version is compatible with APR version... yes
configure: checking sqlite library
checking sqlite amalgamation file version... amalgamation found and is okay
configuring libtool now
checking for a sed that does not truncate output... /bin/sed
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking how to recognise dependent libraries... pass_all
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for epcf90... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for gfortran... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking whether libtool needs -no-undefined... no
checking whether to avoid circular linkage at all costs... no
checking for trang... none
checking for socket in -lsocket... no
checking for availability of Berkeley DB... yes
checking whether to look for SASL... yes
configure: Looking in default locations
checking sasl/sasl.h usability... yes
checking sasl/sasl.h presence... yes
checking for sasl/sasl.h... yes
checking sasl/saslutil.h usability... yes
checking sasl/saslutil.h presence... yes
checking for sasl/saslutil.h... yes
checking for prop_get in -lsasl2... yes
checking for availability of Cyrus SASL v2... yes
checking for Mac OS KeyChain Services... no
checking whether APR has support for DSOs... yes
checking for D-Bus .pc file... no
checking whether to look for GNOME Keyring... no
checking for msgfmt... /usr/bin/msgfmt
checking for msgmerge... /usr/bin/msgmerge
checking for xgettext... /usr/bin/xgettext
checking for library containing bindtextdomain... none required
checking for bind_textdomain_codeset... yes
checking if we are using GNU gettext... yes
checking whether to look for KWallet... no
checking for ANSI C header files... (cached) yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for working memcmp... yes
checking for vprintf... yes
checking for _doprnt... no
checking for symlink... yes
checking for readlink... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for inflate in -lz... yes
checking for python... /usr/bin/python
checking for JDK... configure: WARNING: no JNI header files found.
no
checking for perl... /usr/local/bin/perl
checking for ruby... none
checking for swig... none
configure: Configuring python swig binding
checking for Python includes... -I/usr/include/python2.4
checking for compiling Python extensions... gcc -pthread -fPIC
checking for linking Python extensions... gcc -pthread -shared
checking for linking Python libraries... 
checking for apr_int64_t Python/C API format string... l
checking perl version... 5008008
checking for ctypesgen.py... none
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tools/backup/hot-backup.py
config.status: creating contrib/client-side/svn_load_dirs/svn_load_dirs.pl
config.status: creating contrib/client-side/svncopy/svncopy.pl
config.status: creating contrib/client-side/svncopy/testsvncopy.pl
config.status: creating contrib/hook-scripts/commit-email.pl
config.status: creating tools/hook-scripts/commit-access-control.pl
config.status: creating subversion/bindings/swig/perl/native/Makefile.PL
config.status: creating packages/solaris/pkginfo
config.status: creating subversion/svn_private_config.h
config.status: executing svn_private_config.h commands

既存のリポジトリの以降

同期後に操作をしたユーザが所有者のファイルができる。 これではWebDAVで操作できなくなる。 所有者とアクセス権の設定をしなおすこと。

svnadmin バックアップ先
vi バックアップ先/hooks/pre-revprop-change
-------------------------------------------------
#!/bin/sh
exit 0
-------------------------------------------------
chmod 744 バックアップ先/hooks/pre-revprop-change
svnsync init file://バックアップ先 バックアップ元
    ユーザ名・パスワード入力(バックアップ元のもの)
svnsync sync file://バックアップ先
chmod -R 770 バックアップ先
chown -R webmaster:apache バックアップ先
個人用ツール