perforce.spec 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. ##
  2. ## perforce.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.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 information
  26. Name: perforce
  27. Summary: The Perforce SCM System
  28. URL: http://www.perforce.com/
  29. Vendor: Perforce Software
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [EVAL]
  32. Group: SCM
  33. License: Commercial
  34. Version: 2003.1
  35. Release: 20030604
  36. # list of sources
  37. Source0: perforce-%{version}.tar.bz2
  38. Source1: ftp://ftp.perforce.com/perforce/utils/c4/c4.tar.gz
  39. Source2: http://www.perforce.com/perforce/doc.021/man/p4.1
  40. Source3: http://www.perforce.com/perforce/doc.021/man/p4d.1
  41. Source4: http://www.perforce.com/perforce/doc.021/manuals/p4guide/p4guide.pdf
  42. Source5: http://www.perforce.com/perforce/doc.021/manuals/p4sag/p4sag.pdf
  43. Source6: http://www.perforce.com/perforce/doc.021/manuals/cmdref/cmdref.pdf
  44. Source7: http://www.perforce.com/perforce/doc.021/manuals/p4ftp/p4ftp.pdf
  45. Source8: rc.perforce
  46. %NoSource 0
  47. # build information
  48. Prefix: %{l_prefix}
  49. BuildRoot: %{l_buildroot}
  50. BuildPreReq: OpenPKG, openpkg >= 20030108
  51. PreReq: OpenPKG, openpkg >= 20030108
  52. AutoReq: no
  53. AutoReqProv: no
  54. %description
  55. Perforce (P4) is a commercial (but freely available and useable
  56. for Open Source projects) Software Configuration Management (SCM)
  57. system. It is superior to Concurrent Versions System (CVS) and
  58. even (with the help of an existing CVS to P4 repository conversion
  59. tool) can operate on the RCS files of CVS. This is the unlicensed
  60. demo version. It has full time-unlimited functionality, but is
  61. restricted to 2 users. For a real license one has to contact
  62. <opensource@perforce.com>.
  63. %prep
  64. %integrity
  65. %setup0 -q -c
  66. %setup1 -q -T -D -a 1
  67. %build
  68. ( cd c4-1.6
  69. %{l_make} %{l_mflags} \
  70. CC="%{l_cc}" CFLAGS="%{l_cflags -O}"
  71. )
  72. %install
  73. rm -rf $RPM_BUILD_ROOT
  74. %{l_shtool} mkdir -f -p -m 755 \
  75. $RPM_BUILD_ROOT%{l_prefix}/bin \
  76. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  77. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  78. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  79. $RPM_BUILD_ROOT%{l_prefix}/libexec/perforce \
  80. $RPM_BUILD_ROOT%{l_prefix}/share/perforce \
  81. $RPM_BUILD_ROOT%{l_prefix}/var/perforce/p4d.depot
  82. subdir="perforce-%{version}/bin"
  83. case "%{l_target}" in
  84. *-freebsd* ) subdir="$subdir.freebsd4" ;;
  85. *-linux* ) subdir="$subdir.linux22x86" ;;
  86. *-solaris* ) subdir="$subdir.solaris26sparc" ;;
  87. * ) echo "platform %{l_target} not supported" 1>&2; exit 1 ;;
  88. esac
  89. ( cd $subdir
  90. %{l_shtool} install -c -m 755 \
  91. p4 $RPM_BUILD_ROOT%{l_prefix}/bin/
  92. %{l_shtool} install -c -m 755 \
  93. p4d p4web p4ftpd p4p $RPM_BUILD_ROOT%{l_prefix}/sbin/
  94. %{l_shtool} install -c -m 644 \
  95. %{SOURCE p4.1} %{SOURCE p4d.1} $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  96. %{l_shtool} install -c -m 644 \
  97. %{SOURCE p4guide.pdf} %{SOURCE p4sag.pdf} \
  98. %{SOURCE cmdref.pdf} %{SOURCE p4ftp.pdf} \
  99. $RPM_BUILD_ROOT%{l_prefix}/share/perforce/
  100. )
  101. ( cd c4-1.6
  102. %{l_shtool} install -c -m 755 \
  103. c4 $RPM_BUILD_ROOT%{l_prefix}/bin/
  104. %{l_shtool} install -c -m 644 \
  105. c4.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  106. )
  107. %{l_shtool} install -c -m 755 \
  108. -e 's;@l_prefix@;%{l_prefix};g' \
  109. -e 's;@l_rusr@;%{l_rusr};g' \
  110. -e 's;@l_rgrp@;%{l_rgrp};g' \
  111. %{SOURCE rc.perforce} \
  112. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  113. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  114. %{l_files_std} \
  115. '%dir %attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/perforce' \
  116. '%dir %attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/perforce/p4d.depot'
  117. %files -f files
  118. %clean
  119. rm -rf $RPM_BUILD_ROOT
  120. %post
  121. if [ ".$1" = .1 ]; then
  122. $RPM_INSTALL_PREFIX/etc/rc perforce start
  123. sleep 1
  124. P4PORT=`$RPM_INSTALL_PREFIX/etc/rc -q perforce_port`
  125. export P4PORT
  126. ( echo "Protections:"
  127. echo " read user * * //..."
  128. echo " write user * * //..."
  129. echo " super user %{l_rusr} * //..."
  130. ) | su %{l_rusr} -c "$RPM_INSTALL_PREFIX/bin/p4 protect -i" >/dev/null 2>&1
  131. $RPM_INSTALL_PREFIX/etc/rc perforce stop
  132. fi