source: spec/trunk/SPECS/git.spec@ 208

Last change on this file since 208 was 208, checked in by Yuri Dario, 14 years ago

spec: added git build.

File size: 13.0 KB
Line 
1%define _without_docs 1
2
3# Pass --without docs to rpmbuild if you don't want the documentation
4%if 0%{?rhel} && 0%{?rhel} <= 5
5%global gitcoredir %{_bindir}
6%else
7%global gitcoredir %{_libexecdir}/git-core
8%endif
9
10Name: git
11Version: 1.7.6.1
12Release: 1%{?dist}
13Summary: Fast Version Control System
14License: GPLv2
15Group: Development/Tools
16URL: http://git-scm.com/
17
18Source0: http://kernel.org/pub/software/scm/git/%{name}-%{version}.tar.bz2
19Source1: git-os2.zip
20
21Patch0: git-os2.diff
22
23BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
24
25#BuildRequires: desktop-file-utils
26%if 0%{?fedora}
27BuildRequires: emacs >= 22.2
28BuildRequires: libcurl-devel
29%else
30BuildRequires: curl-devel
31%endif
32#BuildRequires: expat-devel
33BuildRequires: gettext
34BuildRequires: openssl-devel
35BuildRequires: zlib-devel >= 1.2
36#%{!?_without_docs:BuildRequires: asciidoc > 6.0.3, xmlto}
37
38#Requires: less
39#Requires: openssh-clients
40%if 0%{?fedora} || 0%{?rhel} >= 5
41Requires: perl(Error)
42%endif
43#Requires: perl-Git = %{version}-%{release}
44#Requires: rsync
45Requires: zlib >= 1.2
46
47Provides: git-core = %{version}-%{release}
48%if 0%{?fedora} || 0%{?rhel} >= 5
49Obsoletes: git-core <= 1.5.4.3
50%else
51# EL-4 has 1.5.4.7-3.el4. We don't support this, but no point making it more
52# difficult than it needs to be (folks stuck on EL-4 have it bad enough ;).
53Obsoletes: git-core <= 1.5.4.7-4
54%endif
55
56%description
57Git is a fast, scalable, distributed revision control system with an
58unusually rich command set that provides both high-level operations
59and full access to internals.
60
61The git rpm installs the core tools with minimal dependencies. To
62install all git packages, including tools for integrating with other
63SCMs, install the git-all meta-package.
64
65%package all
66Summary: Meta-package to pull in all git tools
67Group: Development/Tools
68%if 0%{?fedora} >= 10
69BuildArch: noarch
70%endif
71Requires: git = %{version}-%{release}
72Requires: git-svn = %{version}-%{release}
73Requires: git-cvs = %{version}-%{release}
74Requires: git-email = %{version}-%{release}
75Requires: gitk = %{version}-%{release}
76Requires: git-gui = %{version}-%{release}
77Requires: perl-Git = %{version}-%{release}
78%if 0%{?fedora}
79Requires: emacs-git = %{version}-%{release}
80Requires: git-arch = %{version}-%{release}
81%endif
82%if 0%{?fedora} || 0%{?rhel} >= 5
83Obsoletes: git <= 1.5.4.3
84%else
85# EL-4 has 1.5.4.7-3.el4. We don't support this, but no point making it more
86# difficult than it needs to be (folks stuck on EL-4 have it bad enough ;).
87Obsoletes: git <= 1.5.4.7-4
88%endif
89
90%description all
91Git is a fast, scalable, distributed revision control system with an
92unusually rich command set that provides both high-level operations
93and full access to internals.
94
95This is a dummy package which brings in all subpackages.
96
97%package daemon
98Summary: Git protocol dÊmon
99Group: Development/Tools
100Requires: git = %{version}-%{release}, xinetd
101%description daemon
102The git dÊmon for supporting git:// access to git repositories
103
104%package -n gitweb
105Summary: Simple web interface to git repositories
106Group: Development/Tools
107%if 0%{?fedora} >= 10
108BuildArch: noarch
109%endif
110Requires: git = %{version}-%{release}
111
112%description -n gitweb
113Simple web interface to track changes in git repositories
114
115
116%package svn
117Summary: Git tools for importing Subversion repositories
118Group: Development/Tools
119%if 0%{?fedora} >= 10
120BuildArch: noarch
121%endif
122Requires: git = %{version}-%{release}, subversion, perl(Term::ReadKey)
123%description svn
124Git tools for importing Subversion repositories.
125
126%package cvs
127Summary: Git tools for importing CVS repositories
128Group: Development/Tools
129%if 0%{?fedora} >= 10
130BuildArch: noarch
131%endif
132Requires: git = %{version}-%{release}, cvs
133%if 0%{?fedora} || 0%{?rhel} >= 5
134Requires: cvsps
135%endif
136%description cvs
137Git tools for importing CVS repositories.
138
139%if 0%{?fedora}
140%package arch
141Summary: Git tools for importing Arch repositories
142Group: Development/Tools
143%if 0%{?fedora} >= 10
144BuildArch: noarch
145%endif
146Requires: git = %{version}-%{release}, tla
147%description arch
148Git tools for importing Arch repositories.
149%endif
150
151%package email
152Summary: Git tools for sending email
153Group: Development/Tools
154%if 0%{?fedora} >= 10
155BuildArch: noarch
156%endif
157Requires: git = %{version}-%{release}, perl-Git = %{version}-%{release}
158Requires: perl(Authen::SASL)
159%if 0%{?fedora} || 0%{?rhel} >= 5
160Requires: perl(Net::SMTP::SSL)
161%endif
162%description email
163Git tools for sending email.
164
165%package gui
166Summary: Git GUI tool
167Group: Development/Tools
168%if 0%{?fedora} >= 10
169BuildArch: noarch
170%endif
171Requires: git = %{version}-%{release}, tk >= 8.4
172Requires: gitk = %{version}-%{release}
173%description gui
174Git GUI tool.
175
176%package -n gitk
177Summary: Git revision tree visualiser
178Group: Development/Tools
179%if 0%{?fedora} >= 10
180BuildArch: noarch
181%endif
182Requires: git = %{version}-%{release}, tk >= 8.4
183%description -n gitk
184Git revision tree visualiser.
185
186%package -n perl-Git
187Summary: Perl interface to Git
188Group: Development/Libraries
189%if 0%{?fedora} >= 10
190BuildArch: noarch
191%endif
192Requires: git = %{version}-%{release}
193%if 0%{?fedora} || 0%{?rhel} >= 5
194BuildRequires: perl(Error), perl(ExtUtils::MakeMaker)
195Requires: perl(Error)
196%endif
197Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
198
199%description -n perl-Git
200Perl interface to Git.
201
202%if 0%{?fedora}
203%package -n emacs-git
204Summary: Git version control system support for Emacs
205Group: Applications/Editors
206%if 0%{?fedora} >= 10
207BuildArch: noarch
208%endif
209Requires: git = %{version}-%{release}, emacs-common >= 22.2
210
211%description -n emacs-git
212%{summary}.
213%endif
214
215%prep
216%setup -q -a 1
217%patch0 -p1
218
219# Use these same options for every invocation of 'make'.
220# Otherwise it will rebuild in %%install due to flags changes.
221cat << \EOF > config.mak
222V = 1
223CFLAGS = %{optflags}
224BLK_SHA1 = 1
225NEEDS_CRYPTO_WITH_SSL = 1
226NO_PYTHON = 1
227ETC_GITCONFIG = %{_sysconfdir}/gitconfig
228DESTDIR = %{buildroot}
229INSTALL = install -p
230GITWEB_PROJECTROOT = %{_var}/lib/git
231htmldir = %{_docdir}/%{name}-%{version}
232prefix = %{_prefix}
233EOF
234
235%if 0%{?fedora}
236cat << \EOF >> config.mak
237ASCIIDOC8 = 1
238ASCIIDOC_NO_ROFF = 1
239EOF
240%endif
241
242%if 0%{?rhel} && 0%{?rhel} <= 5
243echo gitexecdir = %{_bindir} >> config.mak
244%endif
245
246# Filter bogus perl requires
247# packed-refs comes from a comment in contrib/hooks/update-paranoid
248cat << \EOF > %{name}-req
249#!/bin/sh
250%{__perl_requires} $* |\
251sed -e '/perl(packed-refs)/d'
252EOF
253
254%global __perl_requires %{_builddir}/%{name}-%{version}/%{name}-req
255chmod +x %{__perl_requires}
256
257%build
258export MAKESHELL=/bin/sh
259export CONFIG_SHELL=/bin/sh
260export LDFLAGS="-Zbin-files -Zhigh-mem -Zomf -Zexe -Zargs-wild -Zargs-resp"
261export LIBS="-lurpo"
262%configure \
263 --without-tcltk \
264 "--cache-file=%{_topdir}/cache/%{name}-%{_target_cpu}.cache"
265
266make %{?_smp_mflags} all %{!?_without_docs: doc}
267
268%if 0%{?fedora}
269make -C contrib/emacs
270%endif
271
272# Remove shebang from bash-completion script
273sed -i '/^#!bash/,+1 d' contrib/completion/git-completion.bash
274
275%install
276export MAKESHELL=/bin/sh
277rm -rf %{buildroot}
278make %{?_smp_mflags} INSTALLDIRS=vendor install %{!?_without_docs: install-doc}
279
280%if 0%{?fedora}
281make -C contrib/emacs install \
282 emacsdir=%{buildroot}%{_datadir}/emacs/site-lisp
283for elc in %{buildroot}%{_datadir}/emacs/site-lisp/*.elc ; do
284 install -pm 644 contrib/emacs/$(basename $elc .elc).el \
285 %{buildroot}%{_datadir}/emacs/site-lisp
286done
287install -Dpm 644 %{SOURCE1} \
288 %{buildroot}%{_datadir}/emacs/site-lisp/site-start.d/git-init.el
289%endif
290
291mkdir -p %{buildroot}%{_var}/www/git
292#install -pm 644 gitweb/*.css %{buildroot}%{_var}/www/git
293#install -pm 644 gitweb/*.js %{buildroot}%{_var}/www/git
294#install -pm 644 gitweb/*.png %{buildroot}%{_var}/www/git
295#install -pm 755 gitweb/gitweb.cgi %{buildroot}%{_var}/www/git
296#mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d
297#install -pm 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/httpd/conf.d/git.conf
298#sed "s|@PROJECTROOT@|%{_var}/lib/git|g" \
299# %{SOURCE5} > %{buildroot}%{_sysconfdir}/gitweb.conf
300
301find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
302find %{buildroot} -type f -name '*.bs' -empty -exec rm -f {} ';'
303find %{buildroot} -type f -name perllocal.pod -exec rm -f {} ';'
304
305%if ! 0%{?fedora}
306find %{buildroot} Documentation -type f -name 'git-archimport*' -exec rm -f {} ';'
307%endif
308
309(find %{buildroot}%{_bindir} -type f | grep -vE "archimport|svn|cvs|email|gitk|git-gui|git-citool|git-daemon" | sed -e s@^%{buildroot}@@) > bin-man-doc-files
310(find %{buildroot}%{_libexecdir} -type f | grep -vE "archimport|svn|cvs|email|gitk|git-gui|git-citool|git-daemon" | sed -e s@^%{buildroot}@@) >> bin-man-doc-files
311#(find %{buildroot}%{perl_vendorlib} -type f | sed -e s@^%{buildroot}@@) >> perl-files
312%if %{!?_without_docs:1}0
313(find %{buildroot}%{_mandir} -type f | grep -vE "archimport|svn|git-cvs|email|gitk|git-gui|git-citool|git-daemon" | sed -e s@^%{buildroot}@@ -e 's/$/*/' ) >> bin-man-doc-files
314%else
315rm -rf %{buildroot}%{_mandir}
316%endif
317
318mkdir -p %{buildroot}%{_var}/lib/git
319mkdir -p %{buildroot}%{_sysconfdir}/xinetd.d
320# On EL <= 5, xinetd does not enable IPv6 by default
321enable_ipv6=" # xinetd does not enable IPv6 by default
322 flags = IPv6"
323perl -p \
324 -e "s|\@GITCOREDIR\@|%{gitcoredir}|g;" \
325 -e "s|\@BASE_PATH\@|%{_var}/lib/git|g;" \
326%if 0%{?rhel} && 0%{?rhel} <= 5
327 -e "s|^}|$enable_ipv6\n$&|;" \
328%endif
329 %{SOURCE2} > %{buildroot}%{_sysconfdir}/xinetd.d/git
330
331mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
332install -pm 644 contrib/completion/git-completion.bash %{buildroot}%{_sysconfdir}/bash_completion.d/git
333
334# Move contrib/hooks out of %%docdir and make them executable
335#mkdir -p %{buildroot}%{_datadir}/git-core/contrib
336#mv contrib/hooks %{buildroot}%{_datadir}/git-core/contrib
337#chmod +x %{buildroot}%{_datadir}/git-core/contrib/hooks/*
338#pushd contrib > /dev/null
339#ln -s ../../../git-core/contrib/hooks
340#popd > /dev/null
341
342# install git-gui .desktop file
343#desktop-file-install \
344#%if 0%{?rhel} && 0%{?rhel} <= 5
345# --vendor fedora \
346#%endif
347# --dir=%{buildroot}%{_datadir}/applications %{SOURCE4}
348
349# quiet some rpmlint complaints
350chmod -R g-w %{buildroot}
351find %{buildroot} -name git-mergetool--lib | xargs chmod a-x
352rm -f {Documentation/technical,contrib/emacs}/.gitignore
353chmod a-x Documentation/technical/api-index.sh
354find contrib -type f | xargs chmod -x
355
356
357%clean
358rm -rf %{buildroot}
359
360
361%files -f bin-man-doc-files
362%defattr(-,root,root)
363%{_datadir}/git-core/
364%dir %{gitcoredir}
365%doc README COPYING Documentation/*.txt contrib/
366%{!?_without_docs: %doc Documentation/*.html Documentation/docbook-xsl.css}
367%{!?_without_docs: %doc Documentation/howto Documentation/technical}
368%{_sysconfdir}/bash_completion.d
369
370
371%files svn
372%defattr(-,root,root)
373%{gitcoredir}/*svn*
374#%doc Documentation/*svn*.txt
375%{!?_without_docs: %{_mandir}/man1/*svn*.1*}
376%{!?_without_docs: %doc Documentation/*svn*.html }
377
378%files cvs
379%defattr(-,root,root)
380#%doc Documentation/*git-cvs*.txt
381%{_bindir}/git-cvsserver
382%{gitcoredir}/*cvs*
383%{!?_without_docs: %{_mandir}/man1/*cvs*.1*}
384%{!?_without_docs: %doc Documentation/*git-cvs*.html }
385
386%if 0%{?fedora}
387%files arch
388%defattr(-,root,root)
389%doc Documentation/git-archimport.txt
390%{gitcoredir}/git-archimport
391%{!?_without_docs: %{_mandir}/man1/git-archimport.1*}
392%{!?_without_docs: %doc Documentation/git-archimport.html }
393%endif
394
395%files email
396%defattr(-,root,root)
397#%doc Documentation/*email*.txt
398%{gitcoredir}/*email*
399%{!?_without_docs: %{_mandir}/man1/*email*.1*}
400%{!?_without_docs: %doc Documentation/*email*.html }
401
402%files gui
403%defattr(-,root,root)
404#%{gitcoredir}/git-gui*
405#%{gitcoredir}/git-citool
406#%{_datadir}/applications/*git-gui.desktop
407#%{_datadir}/git-gui/
408#%{!?_without_docs: %{_mandir}/man1/git-gui.1*}
409#%{!?_without_docs: %doc Documentation/git-gui.html}
410#%{!?_without_docs: %{_mandir}/man1/git-citool.1*}
411#%{!?_without_docs: %doc Documentation/git-citool.html}
412
413%files -n gitk
414%defattr(-,root,root)
415#%doc Documentation/*gitk*.txt
416#%{_bindir}/*gitk*
417#%{_datadir}/gitk
418#%{!?_without_docs: %{_mandir}/man1/*gitk*.1*}
419#%{!?_without_docs: %doc Documentation/*gitk*.html }
420
421%files -n perl-Git
422# -f perl-files
423%defattr(-,root,root)
424%if 0%{?fedora}
425%files -n emacs-git
426%defattr(-,root,root)
427%doc contrib/emacs/README
428%{_datadir}/emacs/site-lisp/*git*.el*
429%{_datadir}/emacs/site-lisp/site-start.d/git-init.el
430%endif
431
432%files daemon
433%defattr(-,root,root)
434%doc Documentation/*daemon*.txt
435%config(noreplace)%{_sysconfdir}/xinetd.d/git
436%{gitcoredir}/git-daemon.exe
437%{_var}/lib/git
438%{!?_without_docs: %{_mandir}/man1/*daemon*.1*}
439%{!?_without_docs: %doc Documentation/*daemon*.html}
440
441%files -n gitweb
442%defattr(-,root,root)
443#%doc gitweb/INSTALL gitweb/README
444#%config(noreplace)%{_sysconfdir}/gitweb.conf
445#%config(noreplace)%{_sysconfdir}/httpd/conf.d/git.conf
446%{_var}/www/git/
447
448
449%files all
450# No files for you!
451
452%changelog
Note: See TracBrowser for help on using the repository browser.