cvs.spec 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. ##
  2. ## cvs.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. # the involved versions
  26. %define V_cvs 1.12.5
  27. %define V_cvslock 0.2
  28. # package information
  29. Name: cvs
  30. Summary: Concurrent Versions Systems (CVS)
  31. URL: http://www.cvshome.org/
  32. Vendor: B. Berliner, D.D. Zuhn, J. Polk
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG
  35. Class: CORE
  36. Group: SCM
  37. License: GPL
  38. Version: %{V_cvs}
  39. Release: 20040205
  40. # package options
  41. %option with_fsl yes
  42. %option with_rse yes
  43. %option with_rse_cvsuser cvs
  44. # list of sources
  45. Source0: http://www.cvshome.org/files/19/10/cvs-%{V_cvs}.tar.bz2
  46. Source1: ftp://riemann.iam.uni-bonn.de/pub/users/roessler/cvslock/cvslock-%{V_cvslock}.tar.gz
  47. Source2: rc.cvs
  48. Source3: fsl.cvs
  49. Patch0: cvs.patch
  50. Patch1: cvs.patch.rse
  51. # build information
  52. Prefix: %{l_prefix}
  53. BuildRoot: %{l_buildroot}
  54. BuildPreReq: OpenPKG, openpkg >= 20040130, perl, patch
  55. PreReq: OpenPKG, openpkg >= 20040130, perl, patch
  56. %if "%{with_fsl}" == "yes"
  57. BuildPreReq: fsl >= 1.2.0
  58. PreReq: fsl >= 1.2.0
  59. %endif
  60. AutoReq: no
  61. AutoReqProv: no
  62. %description
  63. CVS is a version control system, which allows you to keep old
  64. versions of files (usually source code), keep a log of who,
  65. when, and why changes occurred, etc., like RCS or SCCS. Unlike
  66. the simpler systems, CVS does not just operate on one file at a
  67. time or one directory at a time, but operates on hierarchical
  68. collections of directories consisting of version controlled files.
  69. CVS helps to manage releases and to control the concurrent editing
  70. of source files among multiple authors. CVS allows triggers to
  71. enable/log/control various operations and works well over a wide
  72. area network. CVS keeps a single copy of the master sources. This
  73. copy is called the source repository.
  74. %if "%{with_rse}" == "yes"
  75. This version of CVS has the large set of patches applied from
  76. Ralf S. Engelschall <rse@engelschall.com> (-DRSE_PATCHES). This
  77. means that (still undocumented) extra functionality is available.
  78. %endif
  79. %track
  80. prog cvs = {
  81. version = 1.12.5
  82. url = http://ccvs.cvshome.org/servlets/ProjectDownloadList
  83. regex = cvs-(__VER__)\.tar\.bz2
  84. }
  85. prog cvs:cvslock = {
  86. version = 0.2
  87. url = ftp://riemann.iam.uni-bonn.de/pub/users/roessler/cvslock/
  88. regex = cvslock-(__VER__)\.tar\.gz
  89. }
  90. %prep
  91. %setup -q -c
  92. %setup -q -T -D -a 1
  93. # apply patches
  94. ( cd cvs-%{V_cvs}
  95. %if "%{with_rse}" == "yes"
  96. cat %{PATCH cvs.patch.rse} |\
  97. sed -e 's;\(#define RSE_PATCH_CVSUSER_CALLER "\)cvs\("\);\1%{with_rse_cvsuser}\2;' |\
  98. %{l_patch} -p0
  99. %endif
  100. %patch -p0
  101. ) || exit $?
  102. %build
  103. # configure CVS package
  104. ( cd cvs-%{V_cvs}
  105. CC="%{l_cc}" \
  106. %if "%{with_rse}" == "yes"
  107. CFLAGS="%{l_cflags -O} -DRSE_PATCHES" \
  108. %else
  109. CFLAGS="%{l_cflags -O}" \
  110. %endif
  111. LDFLAGS="%{l_fsl_ldflags}" \
  112. LIBS="%{l_fsl_libs}" \
  113. ./configure \
  114. --prefix=%{l_prefix} \
  115. --with-patch=%{l_prefix}/bin/patch \
  116. --with-tmpdir=%{l_prefix}/var/cvs/tmp \
  117. --without-krb4 \
  118. --without-gssapi \
  119. --enable-encryption \
  120. --enable-server
  121. %{l_make} %{l_mflags -O}
  122. ) || exit $?
  123. # configure CVSlock package
  124. ( cd cvslock-%{V_cvslock}
  125. CC="%{l_cc}" \
  126. CFLAGS="%{l_cflags -O}" \
  127. ./configure \
  128. --prefix=%{l_prefix}
  129. %{l_make} %{l_mflags -O}
  130. ) || exit $?
  131. %install
  132. rm -rf $RPM_BUILD_ROOT
  133. # install CVS package
  134. ( cd cvs-%{V_cvs}
  135. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  136. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/rcs2log
  137. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  138. mv $RPM_BUILD_ROOT%{l_prefix}/share/cvs/contrib/* \
  139. $RPM_BUILD_ROOT%{l_prefix}/share/cvs/
  140. rmdir $RPM_BUILD_ROOT%{l_prefix}/share/cvs/contrib
  141. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/cvsbug
  142. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/cvsbug.8
  143. ) || exit $?
  144. # install CVSlock package
  145. ( cd cvslock-%{V_cvslock}
  146. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  147. ) || exit $?
  148. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  149. %{l_shtool} mkdir -f -p -m 755 \
  150. $RPM_BUILD_ROOT%{l_prefix}/var/cvs/tmp
  151. # install run-command script
  152. %{l_shtool} mkdir -f -p -m 755 \
  153. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  154. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  155. %{SOURCE rc.cvs} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  156. # install OSSP fsl configuration
  157. %{l_shtool} mkdir -f -p -m 755 \
  158. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  159. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  160. %{SOURCE fsl.cvs} \
  161. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  162. # determine installation files
  163. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  164. %{l_files_std} \
  165. '%not %dir %{l_prefix}/etc/fsl' \
  166. '%config %{l_prefix}/etc/fsl/fsl.cvs' \
  167. '%attr(1777,%{l_musr},%{l_mgrp}) %{l_prefix}/var/cvs/tmp'
  168. %files -f files
  169. %clean
  170. rm -rf $RPM_BUILD_ROOT
  171. %post
  172. # after upgrade, restart service
  173. [ $1 -eq 2 ] || exit 0
  174. eval `%{l_rc} cvs status 2>/dev/null`
  175. [ ".$cvs_active" = .yes ] && %{l_rc} cvs restart
  176. exit 0
  177. %preun
  178. # before erase, stop service and remove log files
  179. [ $1 -eq 0 ] || exit 0
  180. %{l_rc} cvs stop 2>/dev/null
  181. rm -f $RPM_INSTALL_PREFIX/var/cvs/cvs.log* >/dev/null 2>&1 || true
  182. exit 0