cvs.spec 6.4 KB

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