monotone.spec 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. ##
  2. ## monotone.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: monotone
  26. Summary: Distributed Version Control System
  27. URL: http://venge.net/monotone/
  28. Vendor: Graydon Hoare et al.
  29. Packager: OpenPKG Foundation e.V.
  30. Distribution: OpenPKG Community
  31. Class: EVAL
  32. Group: SCM
  33. License: GPL
  34. Version: 0.32
  35. Release: 20070204
  36. # list of sources
  37. Source0: http://venge.net/monotone/downloads/monotone-%{version}.tar.gz
  38. Source1: rc.monotone
  39. Source3: monotone-setup.sh
  40. Patch0: monotone.patch
  41. # build information
  42. Prefix: %{l_prefix}
  43. BuildRoot: %{l_buildroot}
  44. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, gcc::with_cxx = yes
  45. PreReq: OpenPKG, openpkg >= 20040130, apg, diffutils
  46. BuildPreReq: boost, zlib
  47. PreReq: boost, zlib
  48. AutoReq: no
  49. AutoReqProv: no
  50. %description
  51. Monotone is a distributed version control system. It provides
  52. a simple, single-file RDBMS based transactional version store,
  53. with fully disconnected operation and an efficient peer-to-peer
  54. synchronization protocol. It understands history-sensitive merging,
  55. lightweight branches, integrated code review and third-party
  56. testing. It uses cryptographic version naming and client-side RSA
  57. certificates.
  58. %track
  59. prog monotone = {
  60. version = %{version}
  61. url = http://venge.net/monotone/
  62. regex = monotone-(__VER__)\.tar\.gz
  63. }
  64. %prep
  65. %setup -q
  66. %patch -p0
  67. %build
  68. # configure program
  69. CC="%{l_cc}" \
  70. CXX="%{l_cxx}" \
  71. CFLAGS="%{l_cflags -O}" \
  72. CXXFLAGS="%{l_cxxflags -O}" \
  73. CPPFLAGS="%{l_cppflags}" \
  74. LDFLAGS="%{l_ldflags}" \
  75. ./configure \
  76. --prefix=%{l_prefix} \
  77. --infodir=%{l_prefix}/info \
  78. --mandir=%{l_prefix}/man \
  79. --enable-static-boost=%{l_prefix} \
  80. --disable-nls
  81. # build program
  82. %{l_make} %{l_mflags -O}
  83. %install
  84. # install program
  85. rm -rf $RPM_BUILD_ROOT
  86. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  87. # strip down installation
  88. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  89. mv $RPM_BUILD_ROOT%{l_prefix}/share/doc/monotone \
  90. $RPM_BUILD_ROOT%{l_prefix}/share/monotone
  91. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  92. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale
  93. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
  94. # install setup script
  95. %{l_shtool} mkdir -f -p -m 755 \
  96. $RPM_BUILD_ROOT%{l_prefix}/sbin
  97. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  98. -e 's;@l_shtool@;%{l_shtool};g' \
  99. %{SOURCE monotone-setup.sh} \
  100. $RPM_BUILD_ROOT%{l_prefix}/sbin/monotone-setup
  101. # install run-command script
  102. %{l_shtool} mkdir -f -p -m 755 \
  103. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  104. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  105. %{SOURCE rc.monotone} \
  106. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  107. # create additional directories for server operation
  108. %{l_shtool} mkdir -f -p -m 755 \
  109. $RPM_BUILD_ROOT%{l_prefix}/etc/monotone \
  110. $RPM_BUILD_ROOT%{l_prefix}/var/monotone
  111. # determine installation files
  112. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  113. %{l_files_std} \
  114. '%config %{l_prefix}/etc/monotone/*' \
  115. '%doc %{l_prefix}/share/monotone/*' \
  116. '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/monotone'
  117. %files -f files
  118. %clean
  119. rm -rf $RPM_BUILD_ROOT
  120. %post
  121. if [ $1 -eq 1 ]; then
  122. # display initial hint
  123. ( echo "If you want to use the Monotone daemon for serving"
  124. echo "a central permanently available database, run:"
  125. echo " $RPM_INSTALL_PREFIX/sbin/monotone-setup install \\ "
  126. echo " [<server-mail-address> [<server-password>]]"
  127. echo "and put into your $RPM_INSTALL_PREFIX/etc/rc.conf at least:"
  128. echo " monotone_daemon=\"yes\""
  129. echo " monotone_daemon_host=\"<server-ip-address>\""
  130. ) | %{l_rpmtool} msg -b -t notice
  131. elif [ $1 -eq 2 ]; then
  132. # after upgrade, restart service
  133. eval `%{l_rc} monotone status 2>/dev/null`
  134. [ ".$monotone_active" = .yes ] && %{l_rc} monotone restart
  135. fi
  136. exit 0
  137. %preun
  138. if [ $1 -eq 0 ]; then
  139. # before erase, stop service and remove log files
  140. %{l_rc} monotone stop 2>/dev/null
  141. $RPM_INSTALL_PREFIX/sbin/monotone-setup uninstall >/dev/null 2>&1 || true
  142. rm -f $RPM_INSTALL_PREFIX/var/monotone/monotone.log* >/dev/null 2>&1 || true
  143. fi
  144. exit 0