git.spec 7.6 KB

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