git.spec 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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.6.1.2
  25. %define V_cogito 0.18.2
  26. %define V_stgit 0.14.3
  27. %define V_guilt 0.32
  28. %define V_tig 0.13
  29. %define V_gcutils 0.2.3
  30. # package information
  31. Name: git
  32. Summary: Distributed Version Control System
  33. URL: http://git.or.cz/
  34. Vendor: Linus Torvalds, Junio C Hamano
  35. Packager: OpenPKG Foundation e.V.
  36. Distribution: OpenPKG Community
  37. Class: EVAL
  38. Group: SCM
  39. License: GPL
  40. Version: %{V_git}
  41. Release: 20090130
  42. # package options
  43. %option with_cogito no
  44. %option with_stgit no
  45. %option with_guilt no
  46. %option with_tig no
  47. %option with_gcutils no
  48. %option with_doc no
  49. # list of sources
  50. Source0: http://www.kernel.org/pub/software/scm/git/git-%{V_git}.tar.gz
  51. Source1: http://www.kernel.org/pub/software/scm/cogito/cogito-%{V_cogito}.tar.gz
  52. Source2: http://homepage.ntlworld.com/cmarinas/stgit/stgit-%{V_stgit}.tar.gz
  53. Source3: http://www.kernel.org/pub/linux/kernel/people/jsipek/guilt/guilt-%{V_guilt}.tar.gz
  54. Source4: http://jonas.nitro.dk/tig/releases/tig-%{V_tig}.tar.gz
  55. Source5: http://switch.dl.sourceforge.net/gcutils/gcutils-v%{V_gcutils}.tar.gz
  56. Source6: rc.git
  57. Patch0: git.patch
  58. # build information
  59. Prefix: %{l_prefix}
  60. BuildRoot: %{l_buildroot}
  61. BuildPreReq: OpenPKG, openpkg >= 20040130, bash, python, perl, gcc, make, perl-openpkg
  62. PreReq: OpenPKG, openpkg >= 20040130, bash, python, perl, diffutils, rcs
  63. BuildPreReq: zlib, openssl, curl, expat, libiconv
  64. PreReq: zlib, openssl, curl, expat, libiconv
  65. %if "%{with_tig}" == "yes"
  66. BuildPreReq: ncurses
  67. PreReq: ncurses
  68. %endif
  69. %if "%{with_gcutils}" == "yes"
  70. BuildPreReq: gzip
  71. %endif
  72. %if "%{with_doc}" == "yes"
  73. BuildPreReq: asciidoc, docbook2x
  74. %endif
  75. AutoReq: no
  76. AutoReqProv: no
  77. %description
  78. GIT is a "directory content manager" designed to handle absolutely
  79. massive projects with speed and efficiency. GIT falls in the
  80. category of distributed source code management tools. Every GIT
  81. working directory is a full-fledged repository with full revision
  82. tracking capabilities, not dependent on network access to a central
  83. server.
  84. This package contains both the low-level GIT core components and
  85. optionally the high-level GIT frontends Cogito, StGIT and Guilt.
  86. %track
  87. prog git:git = {
  88. version = %{V_git}
  89. url = http://www.kernel.org/pub/software/scm/git/
  90. regex = git-(\d+(\.\d+)+)\.tar\.gz
  91. }
  92. prog git:cogito = {
  93. version = %{V_cogito}
  94. url = http://www.kernel.org/pub/software/scm/cogito/
  95. regex = cogito-(__VER__)\.tar\.gz
  96. }
  97. prog git:stgit = {
  98. version = %{V_stgit}
  99. url = http://homepage.ntlworld.com/cmarinas/stgit/
  100. regex = stgit-(__VER__)\.tar\.gz
  101. }
  102. prog git:guilt = {
  103. version = %{V_guilt}
  104. url = http://www.kernel.org/pub/linux/kernel/people/jsipek/guilt/
  105. regex = guilt-(__VER__)\.tar\.gz
  106. }
  107. prog git:tig = {
  108. version = %{V_tig}
  109. url = http://jonas.nitro.dk/tig/releases/
  110. regex = tig-(__VER__)\.tar\.gz
  111. }
  112. prog git:gcutils = {
  113. version = %{V_gcutils}
  114. url = http://prdownloads.sourceforge.net/gcutils/
  115. regex = gcutils-v(__VER__)\.tar\.gz
  116. }
  117. %prep
  118. %setup -q -c
  119. %setup -q -T -D -a 1
  120. %setup -q -T -D -a 2
  121. %setup -q -T -D -a 3
  122. %setup -q -T -D -a 4
  123. %setup -q -T -D -a 5
  124. %patch -p0
  125. %build
  126. # build GIT core
  127. ( cd git-%{V_git}
  128. libs="-liconv"
  129. case "%{l_platform -t}" in
  130. *-linux* ) libs="$libs -ldl" ;;
  131. esac
  132. ( echo "CC := %{l_cc}"
  133. echo "ALL_CFLAGS := %{l_cflags -O} %{l_cppflags} \$(ALL_CFLAGS)"
  134. echo "ALL_LDFLAGS := %{l_ldflags} \$(ALL_LDFLAGS) $libs"
  135. echo "INSTALL = %{l_shtool} install -c"
  136. echo "TAR = %{l_tar}"
  137. echo "CURLDIR = %{l_prefix}"
  138. echo "OPENSSLDIR = %{l_prefix}"
  139. echo "SHELL_PATH = %{l_prefix}/bin/bash"
  140. echo "PERL_PATH = %{l_prefix}/bin/perl"
  141. echo "PYTHON_PATH = %{l_prefix}/bin/python"
  142. echo "GITWEB_CONFIG = %{l_prefix}/etc/git/gitweb.config.pl"
  143. echo "GITWEB_BASE_URL = /openpkg-cgi/gitweb.d"
  144. echo "GITWEB_CSS = /openpkg-cgi/gitweb.d/gitweb.css"
  145. echo "GITWEB_LOGO = /openpkg-cgi/gitweb.d/git-logo.png"
  146. echo "GITWEB_FAVICON = /openpkg-cgi/gitweb.d/git-favicon.png"
  147. echo "GITWEB_PROJECTROOT = %{l_prefix}/var/git"
  148. echo "prefix = %{l_prefix}"
  149. ) >config.mak
  150. %{l_make} %{l_mflags}
  151. %if "%{with_doc}" == "yes"
  152. %{l_make} %{l_mflags} doc
  153. %endif
  154. ) || exit $?
  155. # build Cogito frontend
  156. %if "%{with_cogito}" == "yes"
  157. ( cd cogito-%{V_cogito}
  158. %{l_make} %{l_mflags} \
  159. prefix=%{l_prefix}
  160. ) || exit $?
  161. %endif
  162. # build Guilt add-on
  163. %if "%{with_guilt}" == "yes"
  164. ( cd guilt-%{V_guilt}
  165. %{l_shtool} subst \
  166. -e 's;/bin/sh;%{l_prefix}/bin/bash;g' \
  167. guilt*
  168. ) || exit $?
  169. %endif
  170. # build Tig add-on
  171. %if "%{with_tig}" == "yes"
  172. ( cd tig-%{V_tig}
  173. CC="%{l_cc}" \
  174. CFLAGS="%{l_cflags -O}" \
  175. CPPFLAGS="%{l_cppflags ncurses .}" \
  176. LDFLAGS="%{l_ldflags}" \
  177. ./configure \
  178. --prefix=%{l_prefix} \
  179. --mandir=%{l_prefix}/man \
  180. --with-libiconv=%{l_prefix}
  181. %{l_make} %{l_mflags}
  182. ) || exit $?
  183. %endif
  184. # build GC-Utils add-on
  185. %if "%{with_gcutils}" == "yes"
  186. ( cd gc-utils
  187. %{l_make} %{l_mflags} \
  188. prefix=%{l_prefix} \
  189. mandir=%{l_prefix}/man
  190. ) || exit $?
  191. %endif
  192. %install
  193. rm -rf $RPM_BUILD_ROOT
  194. # install GIT core
  195. ( cd git-%{V_git}
  196. %{l_make} %{l_mflags} install \
  197. DESTDIR=$RPM_BUILD_ROOT
  198. ) || exit $?
  199. # install GIT web interface
  200. %{l_shtool} mkdir -f -p -m 755 \
  201. $RPM_BUILD_ROOT%{l_prefix}/cgi/gitweb.d \
  202. $RPM_BUILD_ROOT%{l_prefix}/etc/git
  203. %{l_shtool} install -c -m 755 \
  204. git-%{V_git}/gitweb/gitweb.cgi $RPM_BUILD_ROOT%{l_prefix}/cgi/
  205. %{l_shtool} install -c -m 755 \
  206. git-%{V_git}/gitweb/gitweb.css \
  207. git-%{V_git}/gitweb/git-favicon.png \
  208. git-%{V_git}/gitweb/git-logo.png \
  209. $RPM_BUILD_ROOT%{l_prefix}/cgi/gitweb.d/
  210. ( echo "##"
  211. echo "## gitweb.config.pl -- gitweb Perl configuration "
  212. echo "##"
  213. echo ""
  214. echo "1;"
  215. ) >gitweb.config.pl
  216. %{l_shtool} install -c -m 755 \
  217. gitweb.config.pl $RPM_BUILD_ROOT%{l_prefix}/etc/git/
  218. # install GIT bash programmable completion
  219. %{l_shtool} install -c -m 644 \
  220. git-%{V_git}/contrib/completion/git-completion.bash \
  221. $RPM_BUILD_ROOT%{l_prefix}/etc/git/git.bashrc
  222. # install Cogito frontend
  223. %if "%{with_cogito}" == "yes"
  224. ( cd cogito-%{V_cogito}
  225. %{l_make} %{l_mflags} install \
  226. INSTALL="%{l_shtool} install" \
  227. DESTDIR=$RPM_BUILD_ROOT \
  228. prefix=%{l_prefix}
  229. ) || exit $?
  230. %endif
  231. # install StGIT add-on
  232. %if "%{with_stgit}" == "yes"
  233. ( cd stgit-%{V_stgit}
  234. PATH="`pwd`/../git-%{V_git}:$PATH"
  235. %{l_prefix}/bin/python setup.py install \
  236. --root=$RPM_BUILD_ROOT \
  237. --prefix=%{l_prefix} \
  238. --install-lib=%{l_prefix}/lib/git
  239. ) || exit $?
  240. %endif
  241. # install Guilt add-on
  242. %if "%{with_guilt}" == "yes"
  243. ( cd guilt-%{V_guilt}
  244. %{l_make} %{l_mflags} install \
  245. PREFIX=$RPM_BUILD_ROOT%{l_prefix}
  246. ) || exit $?
  247. %endif
  248. # install Tig add-on
  249. %if "%{with_tig}" == "yes"
  250. ( cd tig-%{V_tig}
  251. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  252. ) || exit $?
  253. %endif
  254. # install GC-Utils add-on
  255. %if "%{with_gcutils}" == "yes"
  256. ( cd gc-utils
  257. %{l_make} %{l_mflags} \
  258. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  259. mandir=$RPM_BUILD_ROOT%{l_prefix}/man \
  260. install
  261. ) || exit $?
  262. %endif
  263. # install run-command script
  264. %{l_shtool} mkdir -f -p -m 755 \
  265. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  266. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  267. %{SOURCE rc.git} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  268. # strip down installation
  269. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  270. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
  271. # create additional directories
  272. %{l_shtool} mkdir -f -p -m 755 \
  273. $RPM_BUILD_ROOT%{l_prefix}/var/git/run \
  274. $RPM_BUILD_ROOT%{l_prefix}/var/git/db
  275. # determine installation files
  276. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  277. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  278. %{l_files_std} `cat perl-openpkg-files` \
  279. '%config %{l_prefix}/etc/git/*' \
  280. '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/git/*'
  281. %files -f files
  282. %clean
  283. rm -rf $RPM_BUILD_ROOT