cvs.spec 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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.9
  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: 20040715
  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: https://ccvs.cvshome.org/files/documents/19/201/cvs-%{V_cvs}.tar.gz
  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. disabled
  82. comment = "uses https:// URL now which is not supported by vcheck"
  83. version = %{version}
  84. url = http://ccvs.cvshome.org/servlets/ProjectDownloadList
  85. regex = cvs-(__VER__)\.tar\.bz2
  86. }
  87. prog cvs:cvslock = {
  88. version = %{V_cvslock}
  89. url = ftp://riemann.iam.uni-bonn.de/pub/users/roessler/cvslock/
  90. regex = cvslock-(__VER__)\.tar\.gz
  91. }
  92. %prep
  93. %setup -q
  94. %setup -q -T -D -a 1
  95. # apply patches
  96. %if "%{with_rse}" == "yes"
  97. cat %{PATCH cvs.patch.rse} |\
  98. sed -e 's;\(#define RSE_PATCH_CVSUSER_CALLER "\)cvs\("\);\1%{with_rse_cvsuser}\2;' |\
  99. %{l_patch} -p0
  100. %endif
  101. %patch -p0
  102. %build
  103. # configure CVS package
  104. CC="%{l_cc}" \
  105. %if "%{with_rse}" == "yes"
  106. CFLAGS="%{l_cflags -O} -DRSE_PATCHES" \
  107. %else
  108. CFLAGS="%{l_cflags -O}" \
  109. %endif
  110. LDFLAGS="%{l_fsl_ldflags}" \
  111. LIBS="%{l_fsl_libs}" \
  112. ./configure \
  113. --prefix=%{l_prefix} \
  114. --with-patch=%{l_prefix}/bin/patch \
  115. --with-tmpdir=%{l_prefix}/var/cvs/tmp \
  116. --without-krb4 \
  117. --without-gssapi \
  118. --enable-encryption \
  119. --enable-server
  120. %{l_make} %{l_mflags}
  121. # configure CVSlock utility
  122. ( cd cvslock-%{V_cvslock}
  123. CC="%{l_cc}" \
  124. CFLAGS="%{l_cflags -O}" \
  125. ./configure \
  126. --prefix=%{l_prefix}
  127. %{l_make} %{l_mflags}
  128. ) || exit $?
  129. %install
  130. rm -rf $RPM_BUILD_ROOT
  131. # install CVS package
  132. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  133. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/rcs2log
  134. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  135. mv $RPM_BUILD_ROOT%{l_prefix}/share/cvs/contrib/* \
  136. $RPM_BUILD_ROOT%{l_prefix}/share/cvs/
  137. rmdir $RPM_BUILD_ROOT%{l_prefix}/share/cvs/contrib
  138. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/cvsbug
  139. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/cvsbug.8
  140. # install CVSlock package
  141. ( cd cvslock-%{V_cvslock}
  142. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  143. ) || exit $?
  144. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  145. %{l_shtool} mkdir -f -p -m 755 \
  146. $RPM_BUILD_ROOT%{l_prefix}/var/cvs/tmp
  147. # install run-command script
  148. %{l_shtool} mkdir -f -p -m 755 \
  149. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  150. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  151. %{SOURCE rc.cvs} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  152. # install OSSP fsl configuration
  153. %{l_shtool} mkdir -f -p -m 755 \
  154. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  155. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  156. %{SOURCE fsl.cvs} \
  157. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  158. # determine installation files
  159. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  160. %{l_files_std} \
  161. '%not %dir %{l_prefix}/etc/fsl' \
  162. '%config %{l_prefix}/etc/fsl/fsl.cvs' \
  163. '%attr(1777,%{l_musr},%{l_mgrp}) %{l_prefix}/var/cvs/tmp'
  164. %files -f files
  165. %clean
  166. rm -rf $RPM_BUILD_ROOT
  167. %post
  168. # after upgrade, restart service
  169. [ $1 -eq 2 ] || exit 0
  170. eval `%{l_rc} cvs status 2>/dev/null`
  171. [ ".$cvs_active" = .yes ] && %{l_rc} cvs restart
  172. exit 0
  173. %preun
  174. # before erase, stop service and remove log files
  175. [ $1 -eq 0 ] || exit 0
  176. %{l_rc} cvs stop 2>/dev/null
  177. rm -f $RPM_INSTALL_PREFIX/var/cvs/cvs.log* >/dev/null 2>&1 || true
  178. exit 0