git.spec 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. ##
  2. ## git.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 version
  25. %define V_git 1.5.0.5
  26. %define V_cogito 0.18.2
  27. %define V_stgit 0.12.1
  28. %define V_guilt 0.22
  29. # package information
  30. Name: git
  31. Summary: Distributed Version Control System
  32. URL: http://git.or.cz/
  33. Vendor: Linus Torvalds, Junio C Hamano
  34. Packager: OpenPKG Foundation e.V.
  35. Distribution: OpenPKG Community
  36. Class: EVAL
  37. Group: SCM
  38. License: GPL
  39. Version: %{V_git}
  40. Release: 20070319
  41. # list of sources
  42. Source0: http://www.kernel.org/pub/software/scm/git/git-%{V_git}.tar.gz
  43. Source1: http://www.kernel.org/pub/software/scm/cogito/cogito-%{V_cogito}.tar.gz
  44. Source2: http://homepage.ntlworld.com/cmarinas/stgit/stgit-%{V_stgit}.tar.gz
  45. Source3: http://www.kernel.org/pub/linux/kernel/people/jsipek/guilt/guilt-%{V_guilt}.tar.gz
  46. Patch0: git.patch
  47. # build information
  48. Prefix: %{l_prefix}
  49. BuildRoot: %{l_buildroot}
  50. BuildPreReq: OpenPKG, openpkg >= 20040130, bash, python, perl, gcc, make, perl-openpkg
  51. PreReq: OpenPKG, openpkg >= 20040130, bash, python, perl, diffutils, rcs
  52. BuildPreReq: zlib, openssl, curl, expat, libiconv
  53. PreReq: zlib, openssl, curl, expat, libiconv
  54. AutoReq: no
  55. AutoReqProv: no
  56. %description
  57. GIT is a "directory content manager" designed to handle absolutely
  58. massive projects with speed and efficiency. GIT falls in the
  59. category of distributed source code management tools. Every GIT
  60. working directory is a full-fledged repository with full revision
  61. tracking capabilities, not dependent on network access to a central
  62. server.
  63. This package contains both the low-level GIT core components and the
  64. high-level GIT frontends Cogito, StGIT and Guilt.
  65. %track
  66. prog git:git = {
  67. version = %{V_git}
  68. url = http://www.kernel.org/pub/software/scm/git/
  69. regex = git-(\d+\.\d+(\.\d+)*)\.tar\.gz
  70. }
  71. prog git:cogito = {
  72. version = %{V_cogito}
  73. url = http://www.kernel.org/pub/software/scm/cogito/
  74. regex = cogito-(__VER__)\.tar\.gz
  75. }
  76. prog git:stgit = {
  77. version = %{V_stgit}
  78. url = http://homepage.ntlworld.com/cmarinas/stgit/
  79. regex = stgit-(__VER__)\.tar\.gz
  80. }
  81. prog git:guilt = {
  82. version = %{V_guilt}
  83. url = http://www.kernel.org/pub/linux/kernel/people/jsipek/guilt/
  84. regex = guilt-(__VER__)\.tar\.gz
  85. }
  86. %prep
  87. %setup -q -c
  88. %setup -q -T -D -a 1
  89. %setup -q -T -D -a 2
  90. %setup -q -T -D -a 3
  91. %patch -p0
  92. %build
  93. # build GIT core
  94. ( cd git-%{V_git}
  95. libs="-liconv"
  96. case "%{l_platform -t}" in
  97. *-linux* ) libs="$libs -ldl" ;;
  98. esac
  99. ( echo "CC := %{l_cc}"
  100. echo "ALL_CFLAGS := %{l_cflags -O} %{l_cppflags} \$(ALL_CFLAGS)"
  101. echo "ALL_LDFLAGS := %{l_ldflags} \$(ALL_LDFLAGS) $libs"
  102. echo "INSTALL = %{l_shtool} install -c"
  103. echo "TAR = %{l_tar}"
  104. echo "CURLDIR = %{l_prefix}"
  105. echo "OPENSSLDIR = %{l_prefix}"
  106. echo "SHELL_PATH = %{l_prefix}/bin/bash"
  107. echo "PERL_PATH = %{l_prefix}/bin/perl"
  108. echo "PYTHON_PATH = %{l_prefix}/bin/python"
  109. echo "GITWEB_CONFIG = %{l_prefix}/etc/git/gitweb.config.pl"
  110. echo "GITWEB_BASE_URL = /openpkg-cgi/gitweb.d"
  111. echo "GITWEB_CSS = /openpkg-cgi/gitweb.d/gitweb.css"
  112. echo "GITWEB_LOGO = /openpkg-cgi/gitweb.d/git-logo.png"
  113. echo "GITWEB_FAVICON = /openpkg-cgi/gitweb.d/git-favicon.png"
  114. echo "GITWEB_PROJECTROOT = %{l_prefix}/var/git"
  115. echo "prefix = %{l_prefix}"
  116. ) >config.mak
  117. %{l_make} %{l_mflags}
  118. ) || exit $?
  119. # build Cogito frontend
  120. ( cd cogito-%{V_cogito}
  121. %{l_make} %{l_mflags} \
  122. prefix=%{l_prefix}
  123. ) || exit $?
  124. # install Guilt add-on
  125. ( cd guilt-%{V_guilt}
  126. %{l_shtool} subst \
  127. -e 's;/bin/bash;%{l_prefix}/bin/bash;g' \
  128. guilt*
  129. ) || exit $?
  130. %install
  131. rm -rf $RPM_BUILD_ROOT
  132. # install GIT core
  133. ( cd git-%{V_git}
  134. %{l_make} %{l_mflags} install \
  135. DESTDIR=$RPM_BUILD_ROOT
  136. ) || exit $?
  137. # install GIT web interface
  138. %{l_shtool} mkdir -f -p -m 755 \
  139. $RPM_BUILD_ROOT%{l_prefix}/cgi/gitweb.d \
  140. $RPM_BUILD_ROOT%{l_prefix}/etc/git
  141. %{l_shtool} install -c -m 755 \
  142. git-%{V_git}/gitweb/gitweb.cgi $RPM_BUILD_ROOT%{l_prefix}/cgi/
  143. %{l_shtool} install -c -m 755 \
  144. git-%{V_git}/gitweb/gitweb.css \
  145. git-%{V_git}/gitweb/git-favicon.png \
  146. git-%{V_git}/gitweb/git-logo.png \
  147. $RPM_BUILD_ROOT%{l_prefix}/cgi/gitweb.d/
  148. ( echo "##"
  149. echo "## gitweb.config.pl -- gitweb Perl configuration "
  150. echo "##"
  151. echo ""
  152. echo "1;"
  153. ) >gitweb.config.pl
  154. %{l_shtool} install -c -m 755 \
  155. gitweb.config.pl $RPM_BUILD_ROOT%{l_prefix}/etc/git/
  156. # install GIT bash programmable completion
  157. %{l_shtool} install -c -m 644 \
  158. git-%{V_git}/contrib/completion/git-completion.bash \
  159. $RPM_BUILD_ROOT%{l_prefix}/etc/git/git.bashrc
  160. # install Cogito frontend
  161. ( cd cogito-%{V_cogito}
  162. %{l_make} %{l_mflags} install \
  163. INSTALL="%{l_shtool} install" \
  164. DESTDIR=$RPM_BUILD_ROOT \
  165. prefix=%{l_prefix}
  166. ) || exit $?
  167. # install StGIT add-on
  168. ( cd stgit-%{V_stgit}
  169. %{l_prefix}/bin/python setup.py install \
  170. --root=$RPM_BUILD_ROOT \
  171. --prefix=%{l_prefix} \
  172. --install-lib=%{l_prefix}/lib/git
  173. ) || exit $?
  174. # install Guilt add-on
  175. ( cd guilt-%{V_guilt}
  176. %{l_make} %{l_mflags} install \
  177. PREFIX=$RPM_BUILD_ROOT%{l_prefix}
  178. ) || exit $?
  179. # strip down installation
  180. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  181. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
  182. # determine installation files
  183. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  184. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  185. %{l_files_std} `cat perl-openpkg-files` \
  186. '%config %{l_prefix}/etc/git/*'
  187. %files -f files
  188. %clean
  189. rm -rf $RPM_BUILD_ROOT