Sat, 27 Oct 2012 18:34:49 +0200
Increase maximum length of user name to allow for proper full name printing.
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: 20120800
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 -O}
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 INSTALL="%{l_shtool} install -c" \
235 DESTDIR=$RPM_BUILD_ROOT
236 %if "%{with_doc}" == "yes"
237 ( cd Documentation
238 %{l_shtool} mkdir -f -p -m 755 \
239 $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
240 $RPM_BUILD_ROOT%{l_prefix}/man/man5 \
241 $RPM_BUILD_ROOT%{l_prefix}/man/man7
242 %{l_shtool} install -c -m 644 \
243 *.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
244 %{l_shtool} install -c -m 644 \
245 *.5 $RPM_BUILD_ROOT%{l_prefix}/man/man5/
246 %{l_shtool} install -c -m 644 \
247 *.7 $RPM_BUILD_ROOT%{l_prefix}/man/man7/
248 ) || exit $?
249 %endif
250 %if "%{with_svn}" != "yes"
251 rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/git/git-svn
252 %endif
253 ) || exit $?
255 # install git-notify(1) addon utility
256 %{l_shtool} install -c -m 755 \
257 -e 's;/usr/bin/perl;%{l_prefix}/bin/perl;' \
258 %{SOURCE git-notify} \
259 $RPM_BUILD_ROOT%{l_prefix}/bin/
261 # install GIT web interface
262 %{l_shtool} mkdir -f -p -m 755 \
263 $RPM_BUILD_ROOT%{l_prefix}/cgi/gitweb.d/static \
264 $RPM_BUILD_ROOT%{l_prefix}/etc/git
265 %{l_shtool} install -c -m 755 \
266 git-%{V_git}/gitweb/gitweb.cgi $RPM_BUILD_ROOT%{l_prefix}/cgi/
267 %{l_shtool} install -c -m 644 \
268 git-%{V_git}/gitweb/static/* \
269 $RPM_BUILD_ROOT%{l_prefix}/cgi/gitweb.d/static/
270 ( echo "##"
271 echo "## gitweb.config.pl -- gitweb Perl configuration "
272 echo "##"
273 echo ""
274 echo "1;"
275 ) >gitweb.config.pl
276 %{l_shtool} install -c -m 755 \
277 gitweb.config.pl $RPM_BUILD_ROOT%{l_prefix}/etc/git/
279 # provide HTTP backend CGI under canonical path for Apache
280 ln $RPM_BUILD_ROOT%{l_prefix}/libexec/git/git-http-backend \
281 $RPM_BUILD_ROOT%{l_prefix}/cgi/git-http-backend
283 # install GIT bash programmable completion
284 %{l_shtool} install -c -m 644 \
285 git-%{V_git}/contrib/completion/git-completion.bash \
286 $RPM_BUILD_ROOT%{l_prefix}/etc/git/git.bashrc
288 # install Cogito frontend
289 %if "%{with_cogito}" == "yes"
290 ( cd cogito-%{V_cogito}
291 %{l_make} %{l_mflags} install \
292 INSTALL="%{l_shtool} install" \
293 DESTDIR=$RPM_BUILD_ROOT \
294 prefix=%{l_prefix}
295 ) || exit $?
296 %endif
298 # install StGIT add-on
299 %if "%{with_stgit}" == "yes"
300 ( cd stgit-%{V_stgit}
301 PATH="`pwd`/../git-%{V_git}:$PATH"
302 %{l_prefix}/bin/python setup.py install \
303 --root=$RPM_BUILD_ROOT \
304 --prefix=%{l_prefix} \
305 --install-lib=%{l_prefix}/lib/git
306 ) || exit $?
307 %endif
309 # install Guilt add-on
310 %if "%{with_guilt}" == "yes"
311 ( cd guilt-%{V_guilt}
312 %{l_make} %{l_mflags} install \
313 PREFIX=$RPM_BUILD_ROOT%{l_prefix}
314 ) || exit $?
315 %endif
317 # install Tig add-on
318 %if "%{with_tig}" == "yes"
319 ( cd tig-%{V_tig}
320 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
321 ) || exit $?
322 %endif
324 # install GC-Utils add-on
325 %if "%{with_gcutils}" == "yes"
326 ( cd gc-utils
327 %{l_make} %{l_mflags} \
328 prefix=$RPM_BUILD_ROOT%{l_prefix} \
329 mandir=$RPM_BUILD_ROOT%{l_prefix}/man \
330 install
331 ) || exit $?
332 %endif
334 # install run-command script
335 %{l_shtool} mkdir -f -p -m 755 \
336 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
337 %{l_shtool} install -c -m 755 %{l_value -s -a} \
338 %{SOURCE rc.git} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
340 # strip down installation
341 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
342 strip $RPM_BUILD_ROOT%{l_prefix}/libexec/git-core/* >/dev/null 2>&1 || true
343 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
345 # create additional directories
346 %{l_shtool} mkdir -f -p -m 755 \
347 $RPM_BUILD_ROOT%{l_prefix}/var/git/run \
348 $RPM_BUILD_ROOT%{l_prefix}/var/git/db
350 # determine installation files
351 %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
352 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
353 %{l_files_std} `cat perl-openpkg-files` \
354 '%config %{l_prefix}/etc/git/*' \
355 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/git/*'
357 %files -f files
359 %clean