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

Last change on this file since 457 was 457, checked in by dmik, 11 years ago

spec: git: Release 2.0.0-1.

File size: 15.5 KB
Line 
1# Note: this .spec is borrowed from git-2.1.0-1.fc22.src.rpm
2
3# Pass --without docs to rpmbuild if you don't want the documentation (force it for now)
4%define _without_docs 1
5
6%global gitcoredir %{_libexecdir}/git-core
7%global libcurl_devel libcurl-devel
8%global docbook_suppress_sp 0
9%global enable_ipv6 0
10
11%global use_systemd 0
12
13Name: git
14Version: 2.0.0
15Release: 1%{?dist}
16Summary: Fast Version Control System
17License: GPLv2
18Group: Development/Tools
19URL: http://git-scm.com/
20#Source0: http://www.kernel.org/pub/software/scm/git/%{name}-%{version}.tar.gz
21
22%define svn_url http://svn.netlabs.org/repos/ports/git/branches/2.0
23%define svn_rev 864
24
25Source: %{name}-%{version}-r%{svn_rev}.zip
26
27BuildRequires: gcc make subversion zip
28
29BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
30
31%if ! 0%{?_without_docs}
32BuildRequires: asciidoc >= 8.4.1
33BuildRequires: xmlto
34%endif
35#BuildRequires: emacs
36BuildRequires: expat-devel
37BuildRequires: gettext
38BuildRequires: libcurl-devel
39#BuildRequires: pcre-devel
40BuildRequires: openssl-devel
41BuildRequires: zlib-devel >= 1.2
42
43#Requires: less
44#Requires: openssh-clients
45#Requires: perl(Error)
46#Requires: perl(Term::ReadKey)
47Requires: perl-Git = %{version}-%{release}
48#Requires: rsync
49Requires: zlib >= 1.2
50
51Provides: git-core = %{version}-%{release}
52
53# Obsolete git-arch
54Obsoletes: git-arch < %{version}-%{release}
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
68BuildArch: noarch
69Requires: git = %{version}-%{release}
70Requires: git-cvs = %{version}-%{release}
71Requires: git-email = %{version}-%{release}
72#Requires: git-gui = %{version}-%{release}
73Requires: git-svn = %{version}-%{release}
74Requires: git-p4 = %{version}-%{release}
75#Requires: gitk = %{version}-%{release}
76Requires: perl-Git = %{version}-%{release}
77#Requires: emacs-git = %{version}-%{release}
78Obsoletes: git <= 1.5.4.3
79
80%description all
81Git is a fast, scalable, distributed revision control system with an
82unusually rich command set that provides both high-level operations
83and full access to internals.
84
85This is a dummy package which brings in all subpackages.
86
87%package bzr
88Summary: Git tools for working with bzr repositories
89Group: Development/Tools
90BuildArch: noarch
91Requires: git = %{version}-%{release}
92Requires: bzr
93
94%description bzr
95%{summary}.
96
97%package daemon
98Summary: Git protocol dÊmon
99Group: Development/Tools
100Requires: git = %{version}-%{release}
101#%if %{use_systemd}
102#Requires: systemd
103#Requires(post): systemd
104#Requires(preun): systemd
105#Requires(postun): systemd
106#%else
107#Requires: xinetd
108#%endif
109%description daemon
110The git dÊmon for supporting git:// access to git repositories
111
112%if 0
113%package -n gitweb
114Summary: Simple web interface to git repositories
115Group: Development/Tools
116BuildArch: noarch
117Requires: git = %{version}-%{release}
118
119%description -n gitweb
120Simple web interface to track changes in git repositories
121%endif
122
123%package hg
124Summary: Git tools for working with mercurial repositories
125Group: Development/Tools
126BuildArch: noarch
127Requires: git = %{version}-%{release}
128Requires: mercurial >= 1.8
129
130%description hg
131%{summary}.
132
133%package p4
134Summary: Git tools for working with Perforce depots
135Group: Development/Tools
136BuildArch: noarch
137BuildRequires: python
138Requires: git = %{version}-%{release}
139%description p4
140%{summary}.
141
142%package svn
143Summary: Git tools for importing Subversion repositories
144Group: Development/Tools
145Requires: git = %{version}-%{release}, subversion, subversion-perl
146#Requires: perl(Term::ReadKey)
147%description svn
148Git tools for importing Subversion repositories.
149
150%package cvs
151Summary: Git tools for importing CVS repositories
152Group: Development/Tools
153BuildArch: noarch
154Requires: git = %{version}-%{release}, cvs
155Requires: cvsps
156Requires: perl-DBD-SQLite
157%description cvs
158Git tools for importing CVS repositories.
159
160%package email
161Summary: Git tools for sending email
162Group: Development/Tools
163BuildArch: noarch
164Requires: git = %{version}-%{release}, perl-Git = %{version}-%{release}
165Requires: perl(Authen::SASL)
166Requires: perl(Net::SMTP::SSL)
167%description email
168Git tools for sending email.
169
170%if 0
171
172%package gui
173Summary: Git GUI tool
174Group: Development/Tools
175BuildArch: noarch
176Requires: git = %{version}-%{release}, tk >= 8.4
177Requires: gitk = %{version}-%{release}
178%description gui
179Git GUI tool.
180
181%package -n gitk
182Summary: Git revision tree visualiser
183Group: Development/Tools
184BuildArch: noarch
185Requires: git = %{version}-%{release}, tk >= 8.4
186%description -n gitk
187Git revision tree visualiser.
188
189%endif
190
191%package -n perl-Git
192Summary: Perl interface to Git
193Group: Development/Libraries
194BuildArch: noarch
195Requires: git = %{version}-%{release}
196#BuildRequires: perl(Error)
197BuildRequires: perl(ExtUtils::MakeMaker)
198#Requires: perl(Error)
199#Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
200
201%description -n perl-Git
202Perl interface to Git.
203
204%package -n perl-Git-SVN
205Summary: Perl interface to Git::SVN
206Group: Development/Libraries
207BuildArch: noarch
208Requires: git = %{version}-%{release}
209Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
210
211%description -n perl-Git-SVN
212Perl interface to Git.
213
214%if 0
215
216%package -n emacs-git
217Summary: Git version control system support for Emacs
218Group: Applications/Editors
219Requires: git = %{version}-%{release}
220BuildArch: noarch
221Requires: emacs(bin) >= %{_emacs_version}
222
223%description -n emacs-git
224%{summary}.
225
226%package -n emacs-git-el
227Summary: Elisp source files for git version control system support for Emacs
228Group: Applications/Editors
229BuildArch: noarch
230Requires: emacs-git = %{version}-%{release}
231
232%description -n emacs-git-el
233%{summary}.
234
235%endif
236
237
238%prep
239%if %(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" ; then echo 1 ; else echo 0 ; fi')
240%setup -q
241%else
242%setup -n "%{name}-%{version}" -Tc
243svn export -r %{svn_rev} %{svn_url} . --force
244rm -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip"
245(cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" "%{name}-%{version}")
246%endif
247
248# Use these same options for every invocation of 'make'.
249# Otherwise it will rebuild in %%install due to flags changes.
250cat << \EOF > config.mak
251V = 1
252CFLAGS = %{optflags}
253#BLK_SHA1 = 1
254#NEEDS_CRYPTO_WITH_SSL = 1
255#USE_LIBPCRE = 1
256ETC_GITCONFIG = %{_sysconfdir}/gitconfig
257DESTDIR = %{buildroot}
258INSTALL = install -p
259GITWEB_PROJECTROOT = %{_var}/lib/git
260GNU_ROFF = 1
261htmldir = %{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
262prefix = %{_prefix}
263gitwebdir = %{_var}/www/git
264EOF
265
266%if "%{gitcoredir}" == "%{_bindir}"
267echo gitexecdir = %{_bindir} >> config.mak
268%endif
269
270%if %{docbook_suppress_sp}
271# This is needed for 1.69.1-1.71.0
272echo DOCBOOK_SUPPRESS_SP = 1 >> config.mak
273%endif
274
275%build
276make %{?_smp_mflags} all
277%if ! 0%{?_without_docs}
278make doc
279%endif
280
281%if 0
282make -C contrib/emacs
283%endif
284
285make -C contrib/subtree/
286
287# Remove shebang from bash-completion script
288sed -i '/^#!bash/,+1 d' contrib/completion/git-completion.bash
289
290%install
291rm -rf %{buildroot}
292make INSTALLDIRS=vendor install
293%if ! 0%{?_without_docs}
294make INSTALLDIRS=vendor install-doc
295%endif
296
297%if 0
298
299%global elispdir %{_emacs_sitelispdir}/git
300make -C contrib/emacs install \
301 emacsdir=%{buildroot}%{elispdir}
302for elc in %{buildroot}%{elispdir}/*.elc ; do
303 install -pm 644 contrib/emacs/$(basename $elc .elc).el \
304 %{buildroot}%{elispdir}
305done
306install -Dpm 644 %{SOURCE2} \
307 %{buildroot}%{_emacs_sitestartdir}/git-init.el
308
309%endif
310
311make -C contrib/subtree install
312%if ! 0%{?_without_docs}
313make -C contrib/subtree install-doc
314%endif
315
316%if 0
317mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d
318install -pm 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/httpd/conf.d/git.conf
319sed "s|@PROJECTROOT@|%{_var}/lib/git|g" \
320 %{SOURCE6} > %{buildroot}%{_sysconfdir}/gitweb.conf
321%else
322rm -rf %{buildroot}%{_var}/www/git/
323%endif
324
325find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
326find %{buildroot} -type f -name '*.bs' -empty -exec rm -f {} ';'
327find %{buildroot} -type f -name perllocal.pod -exec rm -f {} ';'
328
329# git-archimport is not supported
330find %{buildroot} Documentation -type f -name 'git-archimport*' -exec rm -f {} ';'
331
332exclude_re="archimport|email|git-citool|git-cvs|git-daemon|git-gui|git-remote-bzr|git-remote-hg|gitk|p4|svn"
333(find %{buildroot}%{_bindir} %{buildroot}%{_libexecdir} -type f | grep -vE "$exclude_re" | sed -e s@^%{buildroot}@@) > bin-man-doc-files
334(find %{buildroot}%{_bindir} %{buildroot}%{_libexecdir} -mindepth 1 -type d | grep -vE "$exclude_re" | sed -e 's@^%{buildroot}@%dir @') >> bin-man-doc-files
335(find %{buildroot}%{perl_vendorlib} -type f | sed -e s@^%{buildroot}@@) > perl-git-files
336(find %{buildroot}%{perl_vendorlib} -mindepth 1 -type d | sed -e 's@^%{buildroot}@%dir @') >> perl-git-files
337# Split out Git::SVN files
338grep Git/SVN perl-git-files > perl-git-svn-files
339sed -i "/Git\/SVN/ d" perl-git-files
340%if %{!?_without_docs:1}0
341(find %{buildroot}%{_mandir} -type f | grep -vE "$exclude_re|Git" | sed -e s@^%{buildroot}@@ -e 's/$/*/' ) >> bin-man-doc-files
342%else
343rm -rf %{buildroot}%{_mandir}
344%endif
345
346mkdir -p %{buildroot}%{_var}/lib/git
347%if 0
348%if %{use_systemd}
349mkdir -p %{buildroot}%{_unitdir}
350cp -a %{SOURCE12} %{SOURCE13} %{buildroot}%{_unitdir}
351%else
352mkdir -p %{buildroot}%{_sysconfdir}/xinetd.d
353# On EL <= 5, xinetd does not enable IPv6 by default
354enable_ipv6=" # xinetd does not enable IPv6 by default
355 flags = IPv6"
356perl -p \
357 -e "s|\@GITCOREDIR\@|%{gitcoredir}|g;" \
358 -e "s|\@BASE_PATH\@|%{_var}/lib/git|g;" \
359%if %{enable_ipv6}
360 -e "s|^}|$enable_ipv6\n$&|;" \
361%endif
362 %{SOURCE3} > %{buildroot}%{_sysconfdir}/xinetd.d/git
363%endif
364%endif
365
366# Install bzr and hg remote helpers from contrib
367install -pm 755 contrib/remote-helpers/git-remote-* %{buildroot}%{gitcoredir}
368
369# Setup bash completion
370mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
371install -pm 644 contrib/completion/git-completion.bash %{buildroot}%{_sysconfdir}/bash_completion.d/git
372
373# Install tcsh completion
374mkdir -p %{buildroot}%{_datadir}/git-core/contrib/completion
375install -pm 644 contrib/completion/git-completion.tcsh \
376 %{buildroot}%{_datadir}/git-core/contrib/completion/
377
378# Move contrib/hooks out of %%docdir and make them executable
379mkdir -p %{buildroot}%{_datadir}/git-core/contrib
380mv contrib/hooks %{buildroot}%{_datadir}/git-core/contrib
381chmod +x %{buildroot}%{_datadir}/git-core/contrib/hooks/*
382ln -s ../../../git-core/contrib/hooks contrib/
383
384# Install git-prompt.sh
385mkdir -p %{buildroot}%{_datadir}/git-core/contrib/completion
386install -pm 644 contrib/completion/git-prompt.sh \
387 %{buildroot}%{_datadir}/git-core/contrib/completion/
388
389# find translations
390%if 0
391%find_lang %{name} %{name}.lang
392cat %{name}.lang >> bin-man-doc-files
393%else
394find %{buildroot}%{_datadir}/locale/* -type f | sed -e s@^%{buildroot}@@ >> bin-man-doc-files
395%endif
396
397# quiet some rpmlint complaints
398chmod -R g-w %{buildroot}
399find %{buildroot} -name git-mergetool--lib | xargs chmod a-x
400rm -f {Documentation/technical,contrib/emacs,contrib/credential/gnome-keyring}/.gitignore
401chmod a-x Documentation/technical/api-index.sh
402find contrib -type f | xargs chmod -x
403
404
405%clean
406rm -rf %{buildroot}
407
408%if %{use_systemd}
409%post daemon
410%systemd_post git.service
411
412%preun daemon
413%systemd_preun git.service
414
415%postun daemon
416%systemd_postun_with_restart git.service
417%endif
418
419%files -f bin-man-doc-files
420%defattr(-,root,root)
421%{_datadir}/git-core/
422%doc README COPYING Documentation/*.txt Documentation/RelNotes contrib/
423%{!?_without_docs: %doc Documentation/*.html Documentation/docbook-xsl.css}
424%{!?_without_docs: %doc Documentation/howto Documentation/technical}
425%{_sysconfdir}/bash_completion.d
426
427%files bzr
428%defattr(-,root,root)
429%{gitcoredir}/git-remote-bzr
430
431%files hg
432%defattr(-,root,root)
433%{gitcoredir}/git-remote-hg
434
435%files p4
436%defattr(-,root,root)
437%{gitcoredir}/*p4*
438%{gitcoredir}/mergetools/p4merge
439%doc Documentation/*p4*.txt
440%{!?_without_docs: %{_mandir}/man1/*p4*.1*}
441%{!?_without_docs: %doc Documentation/*p4*.html }
442
443%files svn
444%defattr(-,root,root)
445%{gitcoredir}/*svn*
446%doc Documentation/*svn*.txt
447%{!?_without_docs: %{_mandir}/man1/*svn*.1*}
448%{!?_without_docs: %doc Documentation/*svn*.html }
449
450%files cvs
451%defattr(-,root,root)
452%doc Documentation/*git-cvs*.txt
453%{_bindir}/git-cvsserver
454%{gitcoredir}/*cvs*
455%{!?_without_docs: %{_mandir}/man1/*cvs*.1*}
456%{!?_without_docs: %doc Documentation/*git-cvs*.html }
457
458%files email
459%defattr(-,root,root)
460%doc Documentation/*email*.txt
461%{gitcoredir}/*email*
462%{!?_without_docs: %{_mandir}/man1/*email*.1*}
463%{!?_without_docs: %doc Documentation/*email*.html }
464
465%if 0
466
467%files gui
468%defattr(-,root,root)
469%{gitcoredir}/git-gui*
470%{gitcoredir}/git-citool
471%{_datadir}/applications/*git-gui.desktop
472%{_datadir}/git-gui/
473%{!?_without_docs: %{_mandir}/man1/git-gui.1*}
474%{!?_without_docs: %doc Documentation/git-gui.html}
475%{!?_without_docs: %{_mandir}/man1/git-citool.1*}
476%{!?_without_docs: %doc Documentation/git-citool.html}
477
478%files -n gitk
479%defattr(-,root,root)
480%doc Documentation/*gitk*.txt
481%{_bindir}/*gitk*
482%{_datadir}/gitk
483%{!?_without_docs: %{_mandir}/man1/*gitk*.1*}
484%{!?_without_docs: %doc Documentation/*gitk*.html }
485
486%endif
487
488%files -n perl-Git -f perl-git-files
489%defattr(-,root,root)
490%{!?_without_docs: %exclude %{_mandir}/man3/*Git*SVN*.3pm*}
491%{!?_without_docs: %{_mandir}/man3/*Git*.3pm*}
492
493%files -n perl-Git-SVN -f perl-git-svn-files
494%defattr(-,root,root)
495%{!?_without_docs: %{_mandir}/man3/*Git*SVN*.3pm*}
496
497%if 0
498
499%files -n emacs-git
500%defattr(-,root,root)
501%doc contrib/emacs/README
502%dir %{elispdir}
503%{elispdir}/*.elc
504%{_emacs_sitestartdir}/git-init.el
505
506%files -n emacs-git-el
507%defattr(-,root,root)
508%{elispdir}/*.el
509
510%endif
511
512%files daemon
513%defattr(-,root,root)
514%doc Documentation/*daemon*.txt
515%if %{use_systemd}
516%{_unitdir}/git.socket
517%{_unitdir}/git.service
518%else
519%if 0
520%config(noreplace)%{_sysconfdir}/xinetd.d/git
521%endif
522%endif
523%{gitcoredir}/git-daemon*
524%{_var}/lib/git
525%{!?_without_docs: %{_mandir}/man1/*daemon*.1*}
526%{!?_without_docs: %doc Documentation/*daemon*.html}
527
528%if 0
529%files -n gitweb
530%defattr(-,root,root)
531%doc gitweb/INSTALL gitweb/README
532%config(noreplace)%{_sysconfdir}/gitweb.conf
533%config(noreplace)%{_sysconfdir}/httpd/conf.d/git.conf
534%{_var}/www/git/
535%endif
536
537%files all
538# No files for you!
539
540%changelog
541* Wed Sep 10 2014 Dmitriy Kuminov <coding@dmik.org> 2.0.0-1
542- Update git to version 2.0.0.
543- Fix cloning and pushing over HTTP(S).
544- Remove many old unneeded patches to have less OS/2-dependent code.
545
546* Sat Dec 17 2011 yd
547- rebuild due to gcc 4.4.6 bug.
548
549* Sun Nov 27 2011 yd
550- use /@unixroot/usr/bin shell.
551
552* Wed Sep 28 2011 yd
553- fixed build patches.
554- fixed expat support.
555
556* Sat Sep 24 2011 yd
557- symlink script files to exe, so execvp can find them.
558- ignore CR while reading CRLF terminated text files.
559
560* Tue Sep 20 2011 yd
561- disable broken_path_fix macro.
562
563* Mon Sep 19 2011 yd
564- use bigger stack for threads; use socketpair instead of pipes.
Note: See TracBrowser for help on using the repository browser.