git.spec 11 KB

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