git.spec 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. ##
  2. ## git.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2010 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.7.1
  25. %define V_cogito 0.18.2
  26. %define V_stgit 0.14.3
  27. %define V_guilt 0.33
  28. %define V_tig 0.16
  29. %define V_gcutils 0.2.3
  30. # package information
  31. Name: git
  32. Summary: Distributed Version Control System
  33. URL: http://git-scm.com/
  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: 20100613
  42. # package options
  43. %option with_doc no
  44. %option with_cogito no
  45. %option with_stgit no
  46. %option with_guilt no
  47. %option with_tig no
  48. %option with_gcutils 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. BuildPreReq: OpenPKG, openpkg >= 20100101
  60. PreReq: OpenPKG, openpkg >= 20100101
  61. BuildPreReq: gcc, make, perl-openpkg
  62. %if "%{with_doc}" == "yes"
  63. BuildPreReq: asciidoc, xmlto
  64. %endif
  65. BuildPreReq: bash, perl, diffutils
  66. PreReq: bash, perl, diffutils
  67. BuildPreReq: zlib, openssl, curl, expat, libiconv
  68. PreReq: zlib, openssl, curl, expat, libiconv
  69. BuildPreReq: python
  70. PreReq: python
  71. %if "%{with_tig}" == "yes"
  72. BuildPreReq: ncurses
  73. PreReq: ncurses
  74. %endif
  75. %if "%{with_gcutils}" == "yes"
  76. BuildPreReq: gzip
  77. %endif
  78. %description
  79. GIT is a "directory content manager" designed to handle absolutely
  80. massive projects with speed and efficiency. GIT falls in the
  81. category of distributed source code management tools. Every GIT
  82. working directory is a full-fledged repository with full revision
  83. tracking capabilities, not dependent on network access to a central
  84. server.
  85. This package contains both the low-level GIT core components and
  86. optionally the high-level GIT frontends Cogito, StGIT and Guilt.
  87. %track
  88. prog git:git = {
  89. version = %{V_git}
  90. url = http://www.kernel.org/pub/software/scm/git/
  91. regex = git-(\d+(\.\d+)+)\.tar\.gz
  92. }
  93. prog git:cogito = {
  94. version = %{V_cogito}
  95. url = http://www.kernel.org/pub/software/scm/cogito/
  96. regex = cogito-(__VER__)\.tar\.gz
  97. }
  98. prog git:stgit = {
  99. version = %{V_stgit}
  100. url = http://homepage.ntlworld.com/cmarinas/stgit/
  101. regex = stgit-(__VER__)\.tar\.gz
  102. }
  103. prog git:guilt = {
  104. version = %{V_guilt}
  105. url = http://www.kernel.org/pub/linux/kernel/people/jsipek/guilt/
  106. regex = guilt-(__VER__)\.tar\.gz
  107. }
  108. prog git:tig = {
  109. version = %{V_tig}
  110. url = http://jonas.nitro.dk/tig/releases/
  111. regex = tig-(__VER__)\.tar\.gz
  112. }
  113. prog git:gcutils = {
  114. version = %{V_gcutils}
  115. url = http://sourceforge.net/projects/gcutils/files/
  116. regex = gcutils-v(__VER__)\.tar\.gz
  117. }
  118. %prep
  119. %setup -q -c
  120. %setup -q -T -D -a 1
  121. %setup -q -T -D -a 2
  122. %setup -q -T -D -a 3
  123. %setup -q -T -D -a 4
  124. %setup -q -T -D -a 5
  125. %patch -p0
  126. %build
  127. # build GIT core
  128. ( cd git-%{V_git}
  129. find . -name "*.[ch]" -print |\
  130. xargs %{l_shtool} subst \
  131. -e 's;struct option;struct git_option;g'
  132. ( echo "GITWEB_CONFIG = %{l_prefix}/etc/git/gitweb.config.pl"
  133. echo "GITWEB_BASE_URL = /openpkg-cgi/gitweb.d"
  134. echo "GITWEB_CSS = /openpkg-cgi/gitweb.d/gitweb.css"
  135. echo "GITWEB_LOGO = /openpkg-cgi/gitweb.d/git-logo.png"
  136. echo "GITWEB_FAVICON = /openpkg-cgi/gitweb.d/git-favicon.png"
  137. echo "GITWEB_PROJECTROOT = %{l_prefix}/var/git"
  138. echo "PYTHON_PATH = %{l_prefix}/bin/python"
  139. echo "NEEDS_CRYPTO_WITH_SSL = YesPlease"
  140. ) >config.mak
  141. CC="%{l_cc}" \
  142. CFLAGS="%{l_cflags -O}" \
  143. CPPFLAGS="%{l_cppflags}" \
  144. LDFLAGS="%{l_ldflags}" \
  145. ./configure \
  146. --prefix=%{l_prefix} \
  147. --mandir=%{l_prefix}/man \
  148. --with-openssl=%{l_prefix} \
  149. --with-curl=%{l_prefix} \
  150. --with-expat=%{l_prefix} \
  151. --with-iconv=%{l_prefix} \
  152. --with-zlib=%{l_prefix} \
  153. --with-bash=%{l_prefix}/bin/bash \
  154. --with-perl=%{l_prefix}/bin/perl \
  155. --without-tcltk \
  156. --disable-pthreads
  157. %{l_make} %{l_mflags}
  158. %if "%{with_doc}" == "yes"
  159. ( cd Documentation
  160. %{l_make} %{l_mflags} man
  161. ) || exit $?
  162. %endif
  163. ) || exit $?
  164. # build Cogito frontend
  165. %if "%{with_cogito}" == "yes"
  166. ( cd cogito-%{V_cogito}
  167. %{l_make} %{l_mflags} \
  168. prefix=%{l_prefix}
  169. ) || exit $?
  170. %endif
  171. # build Guilt add-on
  172. %if "%{with_guilt}" == "yes"
  173. ( cd guilt-%{V_guilt}
  174. %{l_shtool} subst \
  175. -e 's;/bin/sh;%{l_prefix}/bin/bash;g' \
  176. guilt*
  177. ) || exit $?
  178. %endif
  179. # build Tig add-on
  180. %if "%{with_tig}" == "yes"
  181. ( cd tig-%{V_tig}
  182. CC="%{l_cc}" \
  183. CFLAGS="%{l_cflags -O}" \
  184. CPPFLAGS="%{l_cppflags ncurses .}" \
  185. LDFLAGS="%{l_ldflags}" \
  186. ./configure \
  187. --prefix=%{l_prefix} \
  188. --mandir=%{l_prefix}/man \
  189. --with-libiconv=%{l_prefix}
  190. %{l_make} %{l_mflags}
  191. ) || exit $?
  192. %endif
  193. # build GC-Utils add-on
  194. %if "%{with_gcutils}" == "yes"
  195. ( cd gc-utils
  196. %{l_make} %{l_mflags} \
  197. prefix=%{l_prefix} \
  198. mandir=%{l_prefix}/man
  199. ) || exit $?
  200. %endif
  201. %install
  202. # install GIT core
  203. ( cd git-%{V_git}
  204. %{l_make} %{l_mflags} install \
  205. DESTDIR=$RPM_BUILD_ROOT
  206. %if "%{with_doc}" == "yes"
  207. ( cd Documentation
  208. %{l_shtool} mkdir -f -p -m 755 \
  209. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  210. $RPM_BUILD_ROOT%{l_prefix}/man/man5 \
  211. $RPM_BUILD_ROOT%{l_prefix}/man/man7
  212. %{l_shtool} install -c -m 644 \
  213. *.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  214. %{l_shtool} install -c -m 644 \
  215. *.5 $RPM_BUILD_ROOT%{l_prefix}/man/man5/
  216. %{l_shtool} install -c -m 644 \
  217. *.7 $RPM_BUILD_ROOT%{l_prefix}/man/man7/
  218. ) || exit $?
  219. %endif
  220. ) || exit $?
  221. # install GIT web interface
  222. %{l_shtool} mkdir -f -p -m 755 \
  223. $RPM_BUILD_ROOT%{l_prefix}/cgi/gitweb.d \
  224. $RPM_BUILD_ROOT%{l_prefix}/etc/git
  225. %{l_shtool} install -c -m 755 \
  226. git-%{V_git}/gitweb/gitweb.cgi $RPM_BUILD_ROOT%{l_prefix}/cgi/
  227. %{l_shtool} install -c -m 755 \
  228. git-%{V_git}/gitweb/gitweb.css \
  229. git-%{V_git}/gitweb/git-favicon.png \
  230. git-%{V_git}/gitweb/git-logo.png \
  231. $RPM_BUILD_ROOT%{l_prefix}/cgi/gitweb.d/
  232. ( echo "##"
  233. echo "## gitweb.config.pl -- gitweb Perl configuration "
  234. echo "##"
  235. echo ""
  236. echo "1;"
  237. ) >gitweb.config.pl
  238. %{l_shtool} install -c -m 755 \
  239. gitweb.config.pl $RPM_BUILD_ROOT%{l_prefix}/etc/git/
  240. # install GIT bash programmable completion
  241. %{l_shtool} install -c -m 644 \
  242. git-%{V_git}/contrib/completion/git-completion.bash \
  243. $RPM_BUILD_ROOT%{l_prefix}/etc/git/git.bashrc
  244. # install Cogito frontend
  245. %if "%{with_cogito}" == "yes"
  246. ( cd cogito-%{V_cogito}
  247. %{l_make} %{l_mflags} install \
  248. INSTALL="%{l_shtool} install" \
  249. DESTDIR=$RPM_BUILD_ROOT \
  250. prefix=%{l_prefix}
  251. ) || exit $?
  252. %endif
  253. # install StGIT add-on
  254. %if "%{with_stgit}" == "yes"
  255. ( cd stgit-%{V_stgit}
  256. PATH="`pwd`/../git-%{V_git}:$PATH"
  257. %{l_prefix}/bin/python setup.py install \
  258. --root=$RPM_BUILD_ROOT \
  259. --prefix=%{l_prefix} \
  260. --install-lib=%{l_prefix}/lib/git
  261. ) || exit $?
  262. %endif
  263. # install Guilt add-on
  264. %if "%{with_guilt}" == "yes"
  265. ( cd guilt-%{V_guilt}
  266. %{l_make} %{l_mflags} install \
  267. PREFIX=$RPM_BUILD_ROOT%{l_prefix}
  268. ) || exit $?
  269. %endif
  270. # install Tig add-on
  271. %if "%{with_tig}" == "yes"
  272. ( cd tig-%{V_tig}
  273. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  274. ) || exit $?
  275. %endif
  276. # install GC-Utils add-on
  277. %if "%{with_gcutils}" == "yes"
  278. ( cd gc-utils
  279. %{l_make} %{l_mflags} \
  280. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  281. mandir=$RPM_BUILD_ROOT%{l_prefix}/man \
  282. install
  283. ) || exit $?
  284. %endif
  285. # install run-command script
  286. %{l_shtool} mkdir -f -p -m 755 \
  287. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  288. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  289. %{SOURCE rc.git} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  290. # strip down installation
  291. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  292. strip $RPM_BUILD_ROOT%{l_prefix}/libexec/git-core/* >/dev/null 2>&1 || true
  293. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
  294. # create additional directories
  295. %{l_shtool} mkdir -f -p -m 755 \
  296. $RPM_BUILD_ROOT%{l_prefix}/var/git/run \
  297. $RPM_BUILD_ROOT%{l_prefix}/var/git/db
  298. # determine installation files
  299. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  300. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  301. %{l_files_std} `cat perl-openpkg-files` \
  302. '%config %{l_prefix}/etc/git/*' \
  303. '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/git/*'
  304. %files -f files
  305. %clean