subversion.spec 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. ##
  2. ## subversion.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 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.0
  27. %define V_opkg 1.1.0
  28. %define V_tools 20040829
  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: 20040930
  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: http://svnbook.red-bean.com/book.pdf
  48. Source3: rc.subversion
  49. # build information
  50. Prefix: %{l_prefix}
  51. BuildRoot: %{l_buildroot}
  52. BuildPreReq: OpenPKG, openpkg >= 20040130, diffutils, make
  53. PreReq: OpenPKG, openpkg >= 20040130, diffutils
  54. BuildPreReq: libxml, db, openssl, zlib
  55. PreReq: libxml, db, openssl, zlib
  56. %if "%{with_cvs2svn}" == "yes"
  57. PreReq: cvs, python
  58. %endif
  59. %if "%{with_svn2cvs}" == "yes"
  60. BuildPreReq: perl
  61. PreReq: perl, perl-xml, cvs, rcs
  62. %endif
  63. AutoReq: no
  64. AutoReqProv: no
  65. %description
  66. Subversion is a new version control system that is a compelling
  67. replacement for CVS. Currently this package provides the Subversion
  68. client and svnserve server. The Apache+WebDAV/DeltaV based
  69. mod_dav_svn server is not included.
  70. %track
  71. prog subversion = {
  72. version = %{V_dist}
  73. url = http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=260
  74. regex = subversion-(\d+\.\d+\.\d+)\.tar\.gz
  75. }
  76. prog subversion:tools = {
  77. version = %{V_tools}
  78. url = ftp://ftp.openpkg.org/sources/CPY/subversion/
  79. regex = subversion-tools-(__VER__)\.tar\.gz
  80. }
  81. %prep
  82. %setup -q
  83. %setup -q -T -D -a 1
  84. %build
  85. # configure package
  86. %{l_shtool} subst \
  87. -e 's;\($ac_abs_srcdir/configure\) $ac_configure_args;\1 --disable-shared;' \
  88. configure
  89. CC="%{l_cc}" \
  90. CFLAGS="%{l_cflags -O}" \
  91. CPPFLAGS="%{l_cppflags libxml2 .}" \
  92. LDFLAGS="%{l_ldflags}" \
  93. ./configure \
  94. --prefix=%{l_prefix} \
  95. --with-berkeley-db=%{l_prefix} \
  96. --with-ssl \
  97. --with-zlib \
  98. --enable-static \
  99. --disable-shared
  100. # build package
  101. %{l_make} %{l_mflags}
  102. %install
  103. # install package
  104. rm -rf $RPM_BUILD_ROOT
  105. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  106. # strip down installation
  107. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
  108. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
  109. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
  110. rm -rf $RPM_BUILD_ROOT%{l_prefix}/build
  111. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/neon*
  112. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
  113. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/*-config
  114. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  115. # install Subversion book
  116. %{l_shtool} mkdir -f -p -m 755 \
  117. $RPM_BUILD_ROOT%{l_prefix}/share/subversion
  118. %{l_shtool} install -c -m 644 \
  119. %{SOURCE book.pdf} $RPM_BUILD_ROOT%{l_prefix}/share/subversion/
  120. # install Subversion Bash command completion
  121. %{l_shtool} mkdir -f -p -m 755 \
  122. $RPM_BUILD_ROOT%{l_prefix}/etc/subversion
  123. %{l_shtool} install -c -m 644 \
  124. tools/client-side/bash_completion \
  125. $RPM_BUILD_ROOT%{l_prefix}/etc/subversion/subversion.bashrc
  126. %if "%{with_cvs2svn}" == "yes"
  127. # install cvs2svn(1) tool
  128. ( cd subversion-tools
  129. %{l_shtool} mkdir -f -p -m 755 \
  130. $RPM_BUILD_ROOT%{l_prefix}/libexec/subversion/cvs2svn/cvs2svn_rcsparse
  131. ( echo "#!/bin/sh"
  132. echo "PYTHONPATH=\"%{l_prefix}/libexec/subversion/cvs2svn\""
  133. echo "export PYTHONPATH"
  134. echo "%{l_prefix}/bin/python %{l_prefix}/libexec/subversion/cvs2svn/cvs2svn.py \${1+\"\$@\"}"
  135. ) >cvs2svn.sh
  136. %{l_shtool} install -c -m 755 \
  137. cvs2svn.sh $RPM_BUILD_ROOT%{l_prefix}/bin/cvs2svn
  138. %{l_shtool} install -c -m 644 \
  139. cvs2svn.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  140. %{l_bzip2} -d -c cvs2svn.tar.bz2 | %{l_tar} xf -
  141. %{l_shtool} install -c -m 644 \
  142. cvs2svn/cvs2svn.py \
  143. $RPM_BUILD_ROOT%{l_prefix}/libexec/subversion/cvs2svn/
  144. %{l_shtool} install -c -m 644 \
  145. cvs2svn/cvs2svn_rcsparse/*.py \
  146. $RPM_BUILD_ROOT%{l_prefix}/libexec/subversion/cvs2svn/cvs2svn_rcsparse/
  147. ) || exit $?
  148. %endif
  149. %if "%{with_svn2cvs}" == "yes"
  150. # install svn2cvs(1) tool
  151. ( cd subversion-tools
  152. %{l_shtool} install -c -m 755 \
  153. -e 's;#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \
  154. svn2cvs.pl $RPM_BUILD_ROOT%{l_prefix}/bin/svn2cvs
  155. %{l_prefix}/bin/pod2man svn2cvs.pl >svn2cvs.1
  156. %{l_shtool} install -c -m 644 \
  157. svn2cvs.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/svn2cvs.1
  158. ) || exit $?
  159. %endif
  160. # install run-command script
  161. %{l_shtool} mkdir -f -p -m 755 \
  162. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  163. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  164. %{SOURCE rc.subversion} \
  165. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  166. # create directory for default repository and svnserve pidfile
  167. %{l_shtool} mkdir -f -p -m 755 \
  168. $RPM_BUILD_ROOT%{l_prefix}/var/subversion
  169. # determine installation files
  170. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  171. %{l_files_std} \
  172. '%doc %{l_prefix}/share/subversion/book.pdf'
  173. %files -f files
  174. %clean
  175. rm -rf $RPM_BUILD_ROOT
  176. %post
  177. if [ ! -d $RPM_INSTALL_PREFIX/var/subversion/default ]; then
  178. # create default repository
  179. $RPM_INSTALL_PREFIX/bin/svnadmin create \
  180. $RPM_INSTALL_PREFIX/var/subversion/default
  181. fi