subversion.spec 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. ##
  2. ## subversion.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2005 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2005 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2005 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package version
  26. %define V_dist 1.1.3
  27. %define V_opkg 1.1.3
  28. %define V_tools 20050305
  29. # package information
  30. Name: subversion
  31. Summary: Source Revision Control System
  32. URL: http://subversion.tigris.org/
  33. Vendor: Tigris
  34. Packager: The OpenPKG Project
  35. Distribution: OpenPKG
  36. Class: BASE
  37. Group: SCM
  38. License: Apache/BSD
  39. Version: %{V_opkg}
  40. Release: 20050305
  41. # package options
  42. %option with_cvs2svn no
  43. %option with_svn2cvs no
  44. # list of sources
  45. Source0: http://subversion.tigris.org/tarballs/subversion-%{V_dist}.tar.gz
  46. Source1: ftp://ftp.openpkg.org/sources/CPY/subversion/subversion-tools-%{V_tools}.tar.gz
  47. Source2: subversion.config
  48. Source3: subversion.servers
  49. Source4: rc.subversion
  50. Patch0: subversion.patch
  51. # build information
  52. Prefix: %{l_prefix}
  53. BuildRoot: %{l_buildroot}
  54. BuildPreReq: OpenPKG, openpkg >= 20040130, make
  55. PreReq: OpenPKG, openpkg >= 20040130
  56. BuildPreReq: diffutils, libxml, db, openssl, zlib, neon
  57. PreReq: diffutils, libxml, db, openssl, zlib, neon
  58. %if "%{with_cvs2svn}" == "yes"
  59. PreReq: rcs, python
  60. %endif
  61. %if "%{with_svn2cvs}" == "yes"
  62. BuildPreReq: perl
  63. PreReq: perl, perl-xml, cvs, rcs
  64. %endif
  65. AutoReq: no
  66. AutoReqProv: no
  67. %description
  68. Subversion is a modern Version Control System (VCS) providing most
  69. current CVS features, versioned directories/renames/meta-data,
  70. atomic commits, cheap branching and tagging, native client/server
  71. architecture, and the choice of database or plain-file repository
  72. implementations.
  73. %track
  74. prog subversion = {
  75. version = %{V_dist}
  76. url = http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=260
  77. regex = subversion-(\d+\.\d+\.\d+)\.tar\.gz
  78. }
  79. prog subversion:tools = {
  80. version = %{V_tools}
  81. url = ftp://ftp.openpkg.org/sources/CPY/subversion/
  82. regex = subversion-tools-(__VER__)\.tar\.gz
  83. }
  84. %prep
  85. %setup -q
  86. %setup -q -T -D -a 1
  87. %patch -p0
  88. %build
  89. # configure package
  90. %{l_shtool} subst \
  91. -e 's;\($ac_abs_srcdir/configure\) $ac_configure_args;\1 --disable-shared;' \
  92. configure
  93. %{l_shtool} subst \
  94. -e 's;/etc/subversion;%{l_prefix}/etc/subversion;g' \
  95. subversion/libsvn_subr/config_impl.h \
  96. subversion/libsvn_subr/config_file.c
  97. CC="%{l_cc}" \
  98. CFLAGS="%{l_cflags -O}" \
  99. CPPFLAGS="%{l_cppflags libxml2 .}" \
  100. LDFLAGS="%{l_ldflags}" \
  101. ./configure \
  102. --prefix=%{l_prefix} \
  103. --with-berkeley-db=%{l_prefix} \
  104. --with-neon=%{l_prefix} \
  105. --with-zlib \
  106. --enable-static \
  107. --disable-nls \
  108. --disable-shared \
  109. --without-apxs
  110. # build package
  111. %{l_make} %{l_mflags}
  112. %install
  113. # install package
  114. rm -rf $RPM_BUILD_ROOT
  115. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  116. # strip down installation
  117. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
  118. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
  119. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
  120. rm -rf $RPM_BUILD_ROOT%{l_prefix}/build
  121. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/neon*
  122. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
  123. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/*-config
  124. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  125. # install svn_load_dirs(1) tool
  126. %{l_shtool} install -c -m 755 \
  127. -e 's;#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \
  128. contrib/client-side/svn_load_dirs.pl \
  129. $RPM_BUILD_ROOT%{l_prefix}/bin/svn_load_dirs
  130. # install Subversion default global configuration files
  131. %{l_shtool} mkdir -f -p -m 755 \
  132. $RPM_BUILD_ROOT%{l_prefix}/etc/subversion
  133. %{l_shtool} install -c -m 644 \
  134. %{SOURCE subversion.config} \
  135. $RPM_BUILD_ROOT%{l_prefix}/etc/subversion/config
  136. %{l_shtool} install -c -m 644 \
  137. %{SOURCE subversion.servers} \
  138. $RPM_BUILD_ROOT%{l_prefix}/etc/subversion/servers
  139. # install Subversion Bash command completion
  140. %{l_shtool} install -c -m 644 \
  141. tools/client-side/bash_completion \
  142. $RPM_BUILD_ROOT%{l_prefix}/etc/subversion/bashrc
  143. # install Subversion book
  144. %{l_shtool} mkdir -f -p -m 755 \
  145. $RPM_BUILD_ROOT%{l_prefix}/share/subversion
  146. %{l_shtool} install -c -m 644 \
  147. doc/book/book/svn-book.html \
  148. doc/book/book/svn-book.pdf \
  149. $RPM_BUILD_ROOT%{l_prefix}/share/subversion/
  150. %if "%{with_cvs2svn}" == "yes"
  151. # install cvs2svn(1) tool
  152. ( cd subversion-tools
  153. %{l_shtool} mkdir -f -p -m 755 \
  154. $RPM_BUILD_ROOT%{l_prefix}/libexec/subversion/cvs2svn/cvs2svn_rcsparse
  155. ( echo "#!/bin/sh"
  156. echo "PYTHONPATH=\"%{l_prefix}/libexec/subversion/cvs2svn\""
  157. echo "export PYTHONPATH"
  158. echo "%{l_prefix}/bin/python %{l_prefix}/libexec/subversion/cvs2svn/cvs2svn \${1+\"\$@\"}"
  159. ) >cvs2svn.sh
  160. %{l_shtool} install -c -m 755 \
  161. cvs2svn.sh $RPM_BUILD_ROOT%{l_prefix}/bin/cvs2svn
  162. %{l_shtool} install -c -m 644 \
  163. cvs2svn.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  164. %{l_bzip2} -d -c cvs2svn.tar.bz2 | %{l_tar} xf -
  165. %{l_shtool} install -c -m 644 \
  166. cvs2svn/cvs2svn \
  167. $RPM_BUILD_ROOT%{l_prefix}/libexec/subversion/cvs2svn/
  168. %{l_shtool} install -c -m 644 \
  169. cvs2svn/cvs2svn_rcsparse/*.py \
  170. $RPM_BUILD_ROOT%{l_prefix}/libexec/subversion/cvs2svn/cvs2svn_rcsparse/
  171. ) || exit $?
  172. %endif
  173. %if "%{with_svn2cvs}" == "yes"
  174. # install svn2cvs(1) tool
  175. ( cd subversion-tools
  176. %{l_shtool} install -c -m 755 \
  177. -e 's;#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \
  178. svn2cvs.pl $RPM_BUILD_ROOT%{l_prefix}/bin/svn2cvs
  179. %{l_prefix}/bin/pod2man svn2cvs.pl >svn2cvs.1
  180. %{l_shtool} install -c -m 644 \
  181. svn2cvs.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/svn2cvs.1
  182. ) || exit $?
  183. %endif
  184. # install run-command script
  185. %{l_shtool} mkdir -f -p -m 755 \
  186. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  187. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  188. %{SOURCE rc.subversion} \
  189. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  190. # create directory for default repository and svnserve pidfile
  191. %{l_shtool} mkdir -f -p -m 755 \
  192. $RPM_BUILD_ROOT%{l_prefix}/var/subversion
  193. # determine installation files
  194. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  195. %{l_files_std} \
  196. '%config %{l_prefix}/etc/subversion/*' \
  197. '%doc %{l_prefix}/share/subversion/svn-book.*'
  198. %files -f files
  199. %clean
  200. rm -rf $RPM_BUILD_ROOT
  201. %post
  202. if [ ! -d $RPM_INSTALL_PREFIX/var/subversion/default ]; then
  203. # create default repository
  204. $RPM_INSTALL_PREFIX/bin/svnadmin create \
  205. $RPM_INSTALL_PREFIX/var/subversion/default
  206. fi