Fri, 10 Aug 2012 14:40:03 +0200
Import package vendor original specs for necessary manipulations.
1 ##
2 ## git.spec -- OpenPKG RPM Package Specification
3 ## Copyright (c) 2000-2012 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 ##
24 # package version
25 %define V_git 1.7.11.4
26 %define V_cogito 0.18.2
27 %define V_stgit 0.14.3
28 %define V_guilt 0.35
29 %define V_tig 1.0
30 %define V_gcutils 0.2.3
32 # package information
33 Name: git
34 Summary: Distributed Version Control System
35 URL: http://git-scm.com/
36 Vendor: Linus Torvalds, Junio C Hamano
37 Packager: OpenPKG Foundation e.V.
38 Distribution: OpenPKG Community
39 Class: EVAL
40 Group: SCM
41 License: GPL
42 Version: %{V_git}
43 Release: 20120731
45 # package options
46 %option with_doc no
47 %option with_cogito no
48 %option with_stgit no
49 %option with_guilt no
50 %option with_tig no
51 %option with_gcutils no
52 %option with_svn no
54 # list of sources
55 Source0: http://git-core.googlecode.com/files/git-%{V_git}.tar.gz
56 Source1: http://www.kernel.org/pub/software/scm/cogito/cogito-%{V_cogito}.tar.gz
57 Source2: http://homepage.ntlworld.com/cmarinas/stgit/stgit-%{V_stgit}.tar.gz
58 Source3: http://www.kernel.org/pub/linux/kernel/people/jsipek/guilt/guilt-%{V_guilt}.tar.gz
59 Source4: http://jonas.nitro.dk/tig/releases/tig-%{V_tig}.tar.gz
60 Source5: http://switch.dl.sourceforge.net/gcutils/gcutils-v%{V_gcutils}.tar.gz
61 Source6: rc.git
62 Source7: git-notify
63 Patch0: git.patch
65 # build information
66 BuildPreReq: OpenPKG, openpkg >= 20100101
67 PreReq: OpenPKG, openpkg >= 20100101
68 BuildPreReq: gcc, make, perl-openpkg
69 %if "%{with_doc}" == "yes"
70 BuildPreReq: asciidoc, xmlto
71 %endif
72 BuildPreReq: bash, perl, diffutils
73 PreReq: bash, perl, diffutils
74 BuildPreReq: zlib, openssl, curl, expat, libiconv, pcre
75 PreReq: zlib, openssl, curl, expat, libiconv, pcre
76 BuildPreReq: python
77 PreReq: python
78 %if "%{with_tig}" == "yes"
79 BuildPreReq: ncurses
80 PreReq: ncurses
81 %endif
82 %if "%{with_gcutils}" == "yes"
83 BuildPreReq: gzip
84 %endif
85 %if "%{with_svn}" == "yes"
86 PreReq: subversion-perl
87 %endif
89 %description
90 GIT is a "directory content manager" designed to handle absolutely
91 massive projects with speed and efficiency. GIT falls in the
92 category of distributed source code management tools. Every GIT
93 working directory is a full-fledged repository with full revision
94 tracking capabilities, not dependent on network access to a central
95 server.
97 This package contains both the low-level GIT core components and
98 optionally the high-level GIT frontends Cogito, StGIT and Guilt.
100 %track
101 prog git:git = {
102 version = %{V_git}
103 url = http://code.google.com/p/git-core/downloads/list
104 regex = git-(\d+(\.\d+)+)\.tar\.gz
105 }
106 prog git:cogito = {
107 version = %{V_cogito}
108 url = http://www.kernel.org/pub/software/scm/cogito/
109 regex = cogito-(__VER__)\.tar\.gz
110 }
111 prog git:stgit = {
112 version = %{V_stgit}
113 url = http://homepage.ntlworld.com/cmarinas/stgit/
114 regex = stgit-(__VER__)\.tar\.gz
115 }
116 prog git:guilt = {
117 version = %{V_guilt}
118 url = http://www.kernel.org/pub/linux/kernel/people/jsipek/guilt/
119 regex = guilt-(__VER__)\.tar\.gz
120 }
121 prog git:tig = {
122 version = %{V_tig}
123 url = http://jonas.nitro.dk/tig/releases/
124 regex = tig-(__VER__)\.tar\.gz
125 }
126 prog git:gcutils = {
127 version = %{V_gcutils}
128 url = http://sourceforge.net/projects/gcutils/files/
129 regex = gcutils-v(__VER__)\.tar\.gz
130 }
132 %prep
133 %setup -q -c
134 %setup -q -T -D -a 1
135 %setup -q -T -D -a 2
136 %setup -q -T -D -a 3
137 %setup -q -T -D -a 4
138 %setup -q -T -D -a 5
139 %patch -p0
141 %build
142 # build GIT core
143 ( cd git-%{V_git}
144 find . -name "*.[ch]" -print |\
145 xargs %{l_shtool} subst \
146 -e 's;struct option;struct git_option;g'
147 ( echo "GITWEB_CONFIG = %{l_prefix}/etc/git/gitweb.config.pl"
148 echo "GITWEB_BASE_URL = /openpkg-cgi/gitweb.d"
149 echo "GITWEB_CSS = /openpkg-cgi/gitweb.d/static/gitweb.css"
150 echo "GITWEB_JS = /openpkg-cgi/gitweb.d/static/gitweb.js"
151 echo "GITWEB_LOGO = /openpkg-cgi/gitweb.d/static/git-logo.png"
152 echo "GITWEB_FAVICON = /openpkg-cgi/gitweb.d/static/git-favicon.png"
153 echo "GITWEB_PROJECTROOT = %{l_prefix}/var/git"
154 echo "PYTHON_PATH = %{l_prefix}/bin/python"
155 echo "NEEDS_CRYPTO_WITH_SSL = YesPlease"
156 ) >config.mak
157 ( echo "ac_cv_header_libintl_h=no"
158 ) >config.cache
159 CC="%{l_cc}" \
160 CFLAGS="%{l_cflags -O}" \
161 CPPFLAGS="%{l_cppflags}" \
162 LDFLAGS="%{l_ldflags}" \
163 LIBS="-lssl -lcrypto -lz" \
164 ./configure \
165 --cache-file=./config.cache \
166 --prefix=%{l_prefix} \
167 --mandir=%{l_prefix}/man \
168 --with-gitconfig=%{l_prefix}/etc/git/gitconfig \
169 --with-gitattributes=%{l_prefix}/etc/git/gitattributes \
170 --with-openssl=%{l_prefix} \
171 --with-libpcre=%{l_prefix} \
172 --with-curl=%{l_prefix} \
173 --with-expat=%{l_prefix} \
174 --with-iconv=%{l_prefix} \
175 --with-zlib=%{l_prefix} \
176 --with-shell=%{l_prefix}/bin/bash \
177 --with-perl=%{l_prefix}/bin/perl \
178 --without-python \
179 --without-tcltk \
180 --disable-pthreads
181 %{l_make} %{l_mflags}
182 %if "%{with_doc}" == "yes"
183 ( cd Documentation
184 %{l_make} %{l_mflags} man
185 ) || exit $?
186 %endif
187 ) || exit $?
189 # build Cogito frontend
190 %if "%{with_cogito}" == "yes"
191 ( cd cogito-%{V_cogito}
192 %{l_make} %{l_mflags} \
193 prefix=%{l_prefix}
194 ) || exit $?
195 %endif
197 # build Guilt add-on
198 %if "%{with_guilt}" == "yes"
199 ( cd guilt-%{V_guilt}
200 %{l_shtool} subst \
201 -e 's;/bin/sh;%{l_prefix}/bin/bash;g' \
202 guilt*
203 ) || exit $?
204 %endif
206 # build Tig add-on
207 %if "%{with_tig}" == "yes"
208 ( cd tig-%{V_tig}
209 CC="%{l_cc}" \
210 CFLAGS="%{l_cflags -O}" \
211 CPPFLAGS="%{l_cppflags ncurses .}" \
212 LDFLAGS="%{l_ldflags}" \
213 ./configure \
214 --prefix=%{l_prefix} \
215 --mandir=%{l_prefix}/man \
216 --with-libiconv=%{l_prefix}
217 %{l_make} %{l_mflags}
218 ) || exit $?
219 %endif
221 # build GC-Utils add-on
222 %if "%{with_gcutils}" == "yes"
223 ( cd gc-utils
224 %{l_make} %{l_mflags} \
225 prefix=%{l_prefix} \
226 mandir=%{l_prefix}/man
227 ) || exit $?
228 %endif
230 %install
231 # install GIT core
232 ( cd git-%{V_git}
233 %{l_make} %{l_mflags} install \
234 DESTDIR=$RPM_BUILD_ROOT
235 %if "%{with_doc}" == "yes"
236 ( cd Documentation
237 %{l_shtool} mkdir -f -p -m 755 \
238 $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
239 $RPM_BUILD_ROOT%{l_prefix}/man/man5 \
240 $RPM_BUILD_ROOT%{l_prefix}/man/man7
241 %{l_shtool} install -c -m 644 \
242 *.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
243 %{l_shtool} install -c -m 644 \
244 *.5 $RPM_BUILD_ROOT%{l_prefix}/man/man5/
245 %{l_shtool} install -c -m 644 \
246 *.7 $RPM_BUILD_ROOT%{l_prefix}/man/man7/
247 ) || exit $?
248 %endif
249 %if "%{with_svn}" != "yes"
250 rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/git/git-svn
251 %endif
252 ) || exit $?
254 # install git-notify(1) addon utility
255 %{l_shtool} install -c -m 755 \
256 -e 's;/usr/bin/perl;%{l_prefix}/bin/perl;' \
257 %{SOURCE git-notify} \
258 $RPM_BUILD_ROOT%{l_prefix}/bin/
260 # install GIT web interface
261 %{l_shtool} mkdir -f -p -m 755 \
262 $RPM_BUILD_ROOT%{l_prefix}/cgi/gitweb.d/static \
263 $RPM_BUILD_ROOT%{l_prefix}/etc/git
264 %{l_shtool} install -c -m 755 \
265 git-%{V_git}/gitweb/gitweb.cgi $RPM_BUILD_ROOT%{l_prefix}/cgi/
266 %{l_shtool} install -c -m 644 \
267 git-%{V_git}/gitweb/static/* \
268 $RPM_BUILD_ROOT%{l_prefix}/cgi/gitweb.d/static/
269 ( echo "##"
270 echo "## gitweb.config.pl -- gitweb Perl configuration "
271 echo "##"
272 echo ""
273 echo "1;"
274 ) >gitweb.config.pl
275 %{l_shtool} install -c -m 755 \
276 gitweb.config.pl $RPM_BUILD_ROOT%{l_prefix}/etc/git/
278 # provide HTTP backend CGI under canonical path for Apache
279 ln $RPM_BUILD_ROOT%{l_prefix}/libexec/git/git-http-backend \
280 $RPM_BUILD_ROOT%{l_prefix}/cgi/git-http-backend
282 # install GIT bash programmable completion
283 %{l_shtool} install -c -m 644 \
284 git-%{V_git}/contrib/completion/git-completion.bash \
285 $RPM_BUILD_ROOT%{l_prefix}/etc/git/git.bashrc
287 # install Cogito frontend
288 %if "%{with_cogito}" == "yes"
289 ( cd cogito-%{V_cogito}
290 %{l_make} %{l_mflags} install \
291 INSTALL="%{l_shtool} install" \
292 DESTDIR=$RPM_BUILD_ROOT \
293 prefix=%{l_prefix}
294 ) || exit $?
295 %endif
297 # install StGIT add-on
298 %if "%{with_stgit}" == "yes"
299 ( cd stgit-%{V_stgit}
300 PATH="`pwd`/../git-%{V_git}:$PATH"
301 %{l_prefix}/bin/python setup.py install \
302 --root=$RPM_BUILD_ROOT \
303 --prefix=%{l_prefix} \
304 --install-lib=%{l_prefix}/lib/git
305 ) || exit $?
306 %endif
308 # install Guilt add-on
309 %if "%{with_guilt}" == "yes"
310 ( cd guilt-%{V_guilt}
311 %{l_make} %{l_mflags} install \
312 PREFIX=$RPM_BUILD_ROOT%{l_prefix}
313 ) || exit $?
314 %endif
316 # install Tig add-on
317 %if "%{with_tig}" == "yes"
318 ( cd tig-%{V_tig}
319 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
320 ) || exit $?
321 %endif
323 # install GC-Utils add-on
324 %if "%{with_gcutils}" == "yes"
325 ( cd gc-utils
326 %{l_make} %{l_mflags} \
327 prefix=$RPM_BUILD_ROOT%{l_prefix} \
328 mandir=$RPM_BUILD_ROOT%{l_prefix}/man \
329 install
330 ) || exit $?
331 %endif
333 # install run-command script
334 %{l_shtool} mkdir -f -p -m 755 \
335 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
336 %{l_shtool} install -c -m 755 %{l_value -s -a} \
337 %{SOURCE rc.git} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
339 # strip down installation
340 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
341 strip $RPM_BUILD_ROOT%{l_prefix}/libexec/git-core/* >/dev/null 2>&1 || true
342 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
344 # create additional directories
345 %{l_shtool} mkdir -f -p -m 755 \
346 $RPM_BUILD_ROOT%{l_prefix}/var/git/run \
347 $RPM_BUILD_ROOT%{l_prefix}/var/git/db
349 # determine installation files
350 %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
351 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
352 %{l_files_std} `cat perl-openpkg-files` \
353 '%config %{l_prefix}/etc/git/*' \
354 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/git/*'
356 %files -f files
358 %clean