perforce.spec 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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 [PRIV]
  32. Group: SCM
  33. License: Commercial
  34. Version: 2002.2
  35. Release: 20021101
  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. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20020206
  50. PreReq: OpenPKG, openpkg >= 20020206
  51. AutoReq: no
  52. AutoReqProv: no
  53. %description
  54. Perforce (P4) is a commercial (but freely available and useable
  55. for Open Source projects) Software Configuration Management (SCM)
  56. system. It is superior to Concurrent Versions System (CVS) and
  57. even (with the help of an existing CVS to P4 repository conversion
  58. tool) can operate on the RCS files of CVS. This is the unlicensed
  59. demo version. It has full time-unlimited functionality, but is
  60. restricted to 2 users. For a real license one has to contact
  61. <opensource@perforce.com>.
  62. %prep
  63. %setup0 -q -c
  64. %setup1 -q -T -D -a 1
  65. %build
  66. ( cd c4-1.6
  67. %{l_make} %{l_mflags} \
  68. CC="%{l_cc}" CFLAGS="%{l_cflags -O}"
  69. )
  70. %install
  71. rm -rf $RPM_BUILD_ROOT
  72. %{l_shtool} mkdir -f -p -m 755 \
  73. $RPM_BUILD_ROOT%{l_prefix}/bin \
  74. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  75. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  76. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  77. $RPM_BUILD_ROOT%{l_prefix}/libexec/perforce \
  78. $RPM_BUILD_ROOT%{l_prefix}/share/perforce \
  79. $RPM_BUILD_ROOT%{l_prefix}/var/perforce/p4d.depot
  80. subdir="perforce-%{version}/bin"
  81. case "%{l_target}" in
  82. *-freebsd* ) subdir="$subdir.freebsd4" ;;
  83. *-linux* ) subdir="$subdir.linux22x86" ;;
  84. *-solaris* ) subdir="$subdir.solaris26" ;;
  85. * ) echo "platform %{l_target} not supported" 1>&2; exit 1 ;;
  86. esac
  87. ( cd $subdir
  88. %{l_shtool} install -c -m 755 \
  89. p4 $RPM_BUILD_ROOT%{l_prefix}/bin/
  90. %{l_shtool} install -c -m 755 \
  91. p4d p4web p4ftpd p4p $RPM_BUILD_ROOT%{l_prefix}/sbin/
  92. %{l_shtool} install -c -m 644 \
  93. %{SOURCE p4.1} %{SOURCE p4d.1} $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  94. %{l_shtool} install -c -m 644 \
  95. %{SOURCE p4guide.pdf} %{SOURCE p4sag.pdf} \
  96. %{SOURCE cmdref.pdf} %{SOURCE p4ftp.pdf} \
  97. $RPM_BUILD_ROOT%{l_prefix}/share/perforce/
  98. )
  99. ( cd c4-1.6
  100. %{l_shtool} install -c -m 755 \
  101. c4 $RPM_BUILD_ROOT%{l_prefix}/bin/
  102. %{l_shtool} install -c -m 644 \
  103. c4.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  104. )
  105. %{l_shtool} install -c -m 755 \
  106. -e 's;@l_prefix@;%{l_prefix};g' \
  107. -e 's;@l_rusr@;%{l_rusr};g' \
  108. -e 's;@l_rgrp@;%{l_rgrp};g' \
  109. %{SOURCE rc.perforce} \
  110. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  111. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  112. %{l_files_std} \
  113. '%dir %attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/perforce' \
  114. '%dir %attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/perforce/p4d.depot'
  115. %files -f files
  116. %clean
  117. rm -rf $RPM_BUILD_ROOT
  118. %post
  119. if [ ".$1" = .1 ]; then
  120. $RPM_INSTALL_PREFIX/etc/rc perforce start
  121. sleep 1
  122. P4PORT=`$RPM_INSTALL_PREFIX/etc/rc -q perforce_port`
  123. export P4PORT
  124. ( echo "Protections:"
  125. echo " read user * * //..."
  126. echo " write user * * //..."
  127. echo " super user %{l_rusr} * //..."
  128. ) | su %{l_rusr} -c "$RPM_INSTALL_PREFIX/bin/p4 protect -i" >/dev/null 2>&1
  129. $RPM_INSTALL_PREFIX/etc/rc perforce stop
  130. fi