cvstrac.spec 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. ##
  2. ## cvstrac.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package information
  25. Name: cvstrac
  26. Summary: Bug Tracking System for CVS
  27. URL: http://www.cvstrac.org/
  28. Vendor: D. Richard Hipp
  29. Packager: OpenPKG Foundation e.V.
  30. Distribution: OpenPKG Community
  31. Class: BASE
  32. Group: SCM
  33. License: GPL
  34. Version: 2.0.1
  35. Release: 20070214
  36. # package options
  37. %option with_cvs yes
  38. %option with_svn no
  39. %option with_git no
  40. # list of sources
  41. Source0: http://www.cvstrac.org/cvstrac-%{version}.tar.gz
  42. Source1: cvstrac.cgi
  43. Patch0: cvstrac.patch
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc
  48. PreReq: OpenPKG, openpkg >= 20040130
  49. %if "%{with_cvs}" == "yes"
  50. PreReq: cvs, rcs
  51. %endif
  52. %if "%{with_svn}" == "yes"
  53. PreReq: subversion
  54. %endif
  55. %if "%{with_git}" == "yes"
  56. PreReq: git
  57. %endif
  58. BuildPreReq: sqlite >= 3.2
  59. PreReq: sqlite >= 3.2
  60. AutoReq: no
  61. AutoReqProv: no
  62. %description
  63. CVSTrac provides repository browsing, changeset tracking, issue
  64. tracking and Wiki-based community documentation functionality for
  65. use with the CVS, Subversion and Git source code management (SCM)
  66. systems. It is appropriate for use on projects with up to a few
  67. hundred developers and is designed for low-ceremony workflows.
  68. %track
  69. prog cvstrac = {
  70. version = %{version}
  71. url = http://www.cvstrac.org/cvstrac/wiki?p=DownloadCvstrac
  72. regex = cvstrac-(__VER__)\.tar\.gz
  73. }
  74. %prep
  75. %setup -q
  76. %patch -p0
  77. %build
  78. libs="-lsqlite3 -lcrypt -lm"
  79. case "%{l_platform -t}" in
  80. *-sunos* ) libs="$libs -lrt -lsocket -lnsl" ;;
  81. esac
  82. for scm in \
  83. %if "%{with_cvs}" == "yes"
  84. cvs \
  85. %endif
  86. %if "%{with_svn}" == "yes"
  87. svn \
  88. %endif
  89. %if "%{with_git}" == "yes"
  90. git \
  91. %endif
  92. ; do
  93. %{l_make} %{l_mflags} -f main.mk \
  94. SRCDIR=`pwd` \
  95. BCC="%{l_cc} %{l_cflags -O} %{l_cppflags}" \
  96. TCC="%{l_cc} %{l_cflags -O} %{l_cppflags}" \
  97. LIBSQLITE="%{l_ldflags} $libs" \
  98. APPNAME="${scm}trac" E=""
  99. done
  100. %install
  101. rm -rf $RPM_BUILD_ROOT
  102. %{l_shtool} mkdir -f -p -m 755 \
  103. $RPM_BUILD_ROOT%{l_prefix}/bin \
  104. $RPM_BUILD_ROOT%{l_prefix}/cgi \
  105. $RPM_BUILD_ROOT%{l_prefix}/var/cvstrac
  106. for scm in \
  107. %if "%{with_cvs}" == "yes"
  108. cvs \
  109. %endif
  110. %if "%{with_svn}" == "yes"
  111. svn \
  112. %endif
  113. %if "%{with_git}" == "yes"
  114. git \
  115. %endif
  116. ; do
  117. %{l_shtool} install -c -s -m 755 \
  118. ${scm}trac $RPM_BUILD_ROOT%{l_prefix}/bin/
  119. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  120. -e "s;@l_scm@;${scm};g" \
  121. %{SOURCE cvstrac.cgi} $RPM_BUILD_ROOT%{l_prefix}/cgi/${scm}trac
  122. done
  123. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  124. %{l_files_std} \
  125. '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/cvstrac'
  126. %files -f files
  127. %clean
  128. rm -rf $RPM_BUILD_ROOT
  129. %post
  130. if [ ".$1" = .1 ]; then
  131. ( echo "Hint: To use CVSTrac you have to create databases for your projects."
  132. echo "Run the following command as user %{l_nusr} for each project <name>:"
  133. echo " \$ $RPM_INSTALL_PREFIX/bin/cvstrac init $RPM_INSTALL_PREFIX/var/cvstrac <name>"
  134. echo "After this login to http://localhost/openpkg-cgi/cvstrac/<name>/"
  135. echo "with user \"setup\" and password \"setup\" and configure your"
  136. echo "CVS repository path, add users and change the \"setup\" password."
  137. ) | %{l_rpmtool} msg -b -t notice
  138. elif [ ".$1" = .2 ]; then
  139. ( echo "If you are upgrading from CVSTrac 1.x to 2.0 you have to upgrade"
  140. echo "the existing database from SQLite 2 to SQLite 3, too. For this run"
  141. echo "the following commands before using CVSTrac 2.0:"
  142. echo " \$ cd $RPM_INSTALL_PREFIX/var/cvstrac"
  143. echo " \$ mv <project>.db <project>.db.old"
  144. echo " \$ $RPM_INSTALL_PREFIX/bin/sqlite <project>.db.old .dump |\\ "
  145. echo " $RPM_INSTALL_PREFIX/bin/sqlite3 <project>.db"
  146. ) | %{l_rpmtool} msg -b -t notice
  147. fi