fossil.spec 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. ##
  2. ## fossil.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package version
  24. %define V_opkg 20090828
  25. %define V_dist 20090828225927
  26. # package information
  27. Name: fossil
  28. Summary: Distributed Version Control System
  29. URL: http://www.fossil-scm.org/
  30. Vendor: D. Richard Hipp
  31. Packager: OpenPKG Foundation e.V.
  32. Distribution: OpenPKG Community
  33. Class: EVAL
  34. Group: SCM
  35. License: GPL
  36. Version: %{V_opkg}
  37. Release: 20090830
  38. # list of sources
  39. Source0: http://www.fossil-scm.org/download/fossil-src-%{V_dist}.tar.gz
  40. Source1: fossil.cgi
  41. Patch0: fossil.patch
  42. # build information
  43. Prefix: %{l_prefix}
  44. BuildRoot: %{l_buildroot}
  45. BuildPreReq: OpenPKG, openpkg >= 20060823
  46. PreReq: OpenPKG, openpkg >= 20060823
  47. AutoReq: no
  48. AutoReqProv: no
  49. %description
  50. Fossil is a distributed software revision control system that
  51. includes an integrated Wiki and an integrated Bug-Tracking system,
  52. all in a single, easy-to-use, stand-alone executable. It stores its
  53. repositories in a single SQLite database.
  54. %track
  55. prog fossil = {
  56. version = %{V_dist}
  57. url = http://www.fossil-scm.org/download.html
  58. regex = fossil-src-(\d+)\.tar\.gz
  59. }
  60. %prep
  61. %setup -q -n fossil-src-%{V_dist}
  62. %patch -p0
  63. %build
  64. libs="-lz"
  65. case "%{l_platform -t}" in
  66. *-sunos* ) libs="$libs -lrt -lsocket -lnsl" ;;
  67. esac
  68. %{l_make} %{l_mflags} \
  69. CC="%{l_cc}" \
  70. CFLAGS="%{l_cflags -O} %{l_cppflags}" \
  71. LDFLAGS="%{l_ldflags}" \
  72. LIBS="$libs"
  73. %install
  74. rm -rf $RPM_BUILD_ROOT
  75. %{l_shtool} mkdir -f -p -m 755 \
  76. $RPM_BUILD_ROOT%{l_prefix}/bin \
  77. $RPM_BUILD_ROOT%{l_prefix}/cgi \
  78. $RPM_BUILD_ROOT%{l_prefix}/var/fossil
  79. %{l_shtool} install -c -s -m 755 \
  80. fossil $RPM_BUILD_ROOT%{l_prefix}/bin/
  81. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  82. %{SOURCE fossil.cgi} $RPM_BUILD_ROOT%{l_prefix}/cgi/fossil
  83. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  84. %{l_files_std} \
  85. '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/fossil'
  86. %files -f files
  87. %clean
  88. rm -rf $RPM_BUILD_ROOT
  89. %post
  90. if [ ".$1" = .1 ]; then
  91. su - %{l_nusr} -c \
  92. "LC_CTYPE=C; export LC_CTYPE; umask 077; \
  93. rm -f $RPM_INSTALL_PREFIX/var/fossil/fossil.db; \
  94. $RPM_INSTALL_PREFIX/bin/fossil new \
  95. $RPM_INSTALL_PREFIX/var/fossil/fossil.db" 2>&1
  96. ( echo "The Fossil repository can be reached under the URL"
  97. echo " http://localhost/openpkg-cgi/fossil"
  98. echo "In order to operate with it you have to create users in it."
  99. echo "For this either use the Web interface under Setup->User or"
  100. echo "configure the repository from the command-line:"
  101. echo " $RPM_INSTALL_PREFIX/bin/fossil user new setup"
  102. echo " $RPM_INSTALL_PREFIX/bin/fossil user capabilities setup 's'"
  103. echo " $RPM_INSTALL_PREFIX/bin/fossil user default setup"
  104. ) | %{l_rpmtool} msg -b -t notice
  105. fi
  106. exit 0
  107. %preun
  108. if [ $1 -eq 0 ]; then
  109. rm -f $RPM_INSTALL_PREFIX/var/fossil/* >/dev/null 2>&1 || true
  110. fi
  111. exit 0