git.spec 8.5 KB

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