git.spec 11 KB

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