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

Last change on this file since 921 was 921, checked in by dmik, 9 years ago

spec: git: Release version 2.11.0-1.

File size: 18.7 KB
Line 
1# Note: this .spec is borrowed from http://pkgs.fedoraproject.org/cgit/rpms/git.git
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 noarch_sub 1
8%global libcurl_devel libcurl-devel
9%global docbook_suppress_sp 0
10%global enable_ipv6 0
11%global use_prebuilt_docs 0
12
13%global bashcompdir %{_sysconfdir}/bash_completion.d
14%global bashcomproot %{bashcompdir}
15%global use_systemd 0
16
17Name: git
18Version: 2.11.0
19Release: 1%{?dist}
20Summary: Fast Version Control System
21License: GPLv2
22Group: Development/Tools
23URL: https://git-scm.com/
24
25%define svn_url http://svn.netlabs.org/repos/ports/git/trunk
26%define svn_rev 1885
27
28Source: %{name}-%{version}-r%{svn_rev}.zip
29
30BuildRequires: gcc make subversion zip
31
32BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
33
34%if ! %{use_prebuilt_docs} && ! 0%{?_without_docs}
35BuildRequires: asciidoc >= 8.4.1
36BuildRequires: xmlto
37%endif
38#BuildRequires: emacs
39BuildRequires: expat-devel
40BuildRequires: gettext
41BuildRequires: %{libcurl_devel}
42#BuildRequires: pcre-devel
43#BuildRequires: perl-generators
44#BuildRequires: perl(Test)
45BuildRequires: openssl-devel
46BuildRequires: zlib-devel >= 1.2
47%if %{use_systemd}
48# For macros
49BuildRequires: systemd
50%endif
51
52Requires: git-core = %{version}-%{release}
53Requires: git-core-doc = %{version}-%{release}
54#Requires: perl(Error)
55%if ! %{defined perl_bootstrap}
56#Requires: perl(Term::ReadKey)
57%endif
58Requires: perl-Git = %{version}-%{release}
59
60# Obsolete git-arch
61Obsoletes: git-arch < %{version}-%{release}
62
63%description
64Git is a fast, scalable, distributed revision control system with an
65unusually rich command set that provides both high-level operations
66and full access to internals.
67
68The git rpm installs common set of tools which are usually using with
69small amount of dependencies. To install all git packages, including
70tools for integrating with other SCMs, install the git-all meta-package.
71
72%package all
73Summary: Meta-package to pull in all git tools
74Group: Development/Tools
75%if %{noarch_sub}
76BuildArch: noarch
77%endif
78Requires: git = %{version}-%{release}
79Requires: git-cvs = %{version}-%{release}
80Requires: git-email = %{version}-%{release}
81Requires: git-gui = %{version}-%{release}
82Requires: git-svn = %{version}-%{release}
83Requires: git-p4 = %{version}-%{release}
84Requires: gitk = %{version}-%{release}
85Requires: perl-Git = %{version}-%{release}
86%if ! %{defined perl_bootstrap}
87#Requires: perl(Term::ReadKey)
88%endif
89#Requires: emacs-git = %{version}-%{release}
90Obsoletes: git <= 1.5.4.3
91
92%description all
93Git is a fast, scalable, distributed revision control system with an
94unusually rich command set that provides both high-level operations
95and full access to internals.
96
97This is a dummy package which brings in all subpackages.
98
99%package core
100Summary: Core package of git with minimal funcionality
101Group: Development/Tools
102Requires: less
103#Requires: openssh-clients
104#Requires: rsync
105Requires: zlib >= 1.2
106%description core
107Git is a fast, scalable, distributed revision control system with an
108unusually rich command set that provides both high-level operations
109and full access to internals.
110
111The git-core rpm installs really the core tools with minimal
112dependencies. Install git package for common set of tools.
113To install all git packages, including tools for integrating with
114other SCMs, install the git-all meta-package.
115
116%package core-doc
117Summary: Documentation files for git-core
118Group: Development/Tools
119Requires: git-core = %{version}-%{release}
120
121%description core-doc
122Documentation files for git-core package including man pages.
123
124%package daemon
125Summary: Git protocol dÊmon
126Group: Development/Tools
127Requires: git = %{version}-%{release}
128%if %{use_systemd}
129Requires: systemd
130Requires(post): systemd
131Requires(preun): systemd
132Requires(postun): systemd
133%else
134#Requires: xinetd
135%endif
136%description daemon
137The git dÊmon for supporting git:// access to git repositories
138
139%if 0
140%package -n gitweb
141Summary: Simple web interface to git repositories
142Group: Development/Tools
143%if %{noarch_sub}
144BuildArch: noarch
145%endif
146Requires: git = %{version}-%{release}
147
148%description -n gitweb
149Simple web interface to track changes in git repositories
150%endif
151
152%package p4
153Summary: Git tools for working with Perforce depots
154Group: Development/Tools
155%if %{noarch_sub}
156BuildArch: noarch
157%endif
158BuildRequires: python
159Requires: git = %{version}-%{release}
160%description p4
161%{summary}.
162
163%package svn
164Summary: Git tools for importing Subversion repositories
165Group: Development/Tools
166Requires: git = %{version}-%{release}, subversion
167Requires: perl(Digest::MD5)
168%if ! %{defined perl_bootstrap}
169#Requires: perl(Term::ReadKey)
170%endif
171%description svn
172Git tools for importing Subversion repositories.
173
174%package cvs
175Summary: Git tools for importing CVS repositories
176Group: Development/Tools
177%if %{noarch_sub}
178BuildArch: noarch
179%endif
180Requires: git = %{version}-%{release}, cvs
181Requires: cvsps
182Requires: perl(DBD::SQLite)
183%description cvs
184Git tools for importing CVS repositories.
185
186%package email
187Summary: Git tools for sending email
188Group: Development/Tools
189%if %{noarch_sub}
190BuildArch: noarch
191%endif
192Requires: git = %{version}-%{release}, perl-Git = %{version}-%{release}
193Requires: perl(Authen::SASL)
194Requires: perl(Net::SMTP::SSL)
195%description email
196Git tools for sending email.
197
198%if 0
199
200%package gui
201Summary: Git GUI tool
202Group: Development/Tools
203%if %{noarch_sub}
204BuildArch: noarch
205%endif
206Requires: git = %{version}-%{release}, tk >= 8.4
207Requires: gitk = %{version}-%{release}
208%description gui
209Git GUI tool.
210
211%package -n gitk
212Summary: Git revision tree visualiser
213Group: Development/Tools
214%if %{noarch_sub}
215BuildArch: noarch
216%endif
217Requires: git = %{version}-%{release}, tk >= 8.4
218%description -n gitk
219Git revision tree visualiser.
220
221%endif
222
223%package -n perl-Git
224Summary: Perl interface to Git
225Group: Development/Libraries
226%if %{noarch_sub}
227BuildArch: noarch
228%endif
229Requires: git = %{version}-%{release}
230#BuildRequires: perl(Error)
231BuildRequires: perl(ExtUtils::MakeMaker)
232#Requires: perl(Error)
233#Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
234
235%description -n perl-Git
236Perl interface to Git.
237
238%package -n perl-Git-SVN
239Summary: Perl interface to Git::SVN
240Group: Development/Libraries
241%if %{noarch_sub}
242BuildArch: noarch
243%endif
244Requires: git = %{version}-%{release}
245Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
246
247%description -n perl-Git-SVN
248Perl interface to Git.
249
250%if 0
251
252%package -n emacs-git
253Summary: Git version control system support for Emacs
254Group: Applications/Editors
255Requires: git = %{version}-%{release}
256%if %{noarch_sub}
257BuildArch: noarch
258Requires: emacs(bin) >= %{_emacs_version}
259%else
260Requires: emacs-common
261%endif
262
263%description -n emacs-git
264%{summary}.
265
266%package -n emacs-git-el
267Summary: Elisp source files for git version control system support for Emacs
268Group: Applications/Editors
269%if %{noarch_sub}
270BuildArch: noarch
271%endif
272Requires: emacs-git = %{version}-%{release}
273
274%description -n emacs-git-el
275%{summary}.
276
277%endif
278
279%debug_package
280
281%prep
282%if %(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" ; then echo 1 ; else echo 0 ; fi')
283%setup -q
284%else
285%setup -n "%{name}-%{version}" -Tc
286svn export -r %{svn_rev} %{svn_url} . --force
287rm -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip"
288(cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" "%{name}-%{version}")
289%endif
290
291# Use these same options for every invocation of 'make'.
292# Otherwise it will rebuild in %%install due to flags changes.
293cat << \EOF > config.mak
294V = 1
295CFLAGS = %{optflags}
296#LDFLAGS = %{__global_ldflags}
297#BLK_SHA1 = 1
298#NEEDS_CRYPTO_WITH_SSL = 1
299#USE_LIBPCRE = 1
300ETC_GITCONFIG = %{_sysconfdir}/gitconfig
301DESTDIR = %{buildroot}
302INSTALL = %{_bindir}/install -p
303GITWEB_PROJECTROOT = %{_var}/lib/git
304GNU_ROFF = 1
305htmldir = %{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
306prefix = %{_prefix}
307gitwebdir = %{_var}/www/git
308EOF
309
310%if "%{gitcoredir}" == "%{_bindir}"
311echo gitexecdir = %{_bindir} >> config.mak
312%endif
313
314%if %{docbook_suppress_sp}
315# This is needed for 1.69.1-1.71.0
316echo DOCBOOK_SUPPRESS_SP = 1 >> config.mak
317%endif
318
319%build
320make %{?_smp_mflags} all
321%if ! %{use_prebuilt_docs} && ! 0%{?_without_docs}
322make %{?_smp_mflags} doc
323%endif
324
325%if 0
326make -C contrib/emacs
327%endif
328
329make -C contrib/subtree/
330
331# Remove shebang from bash-completion script
332sed -i '/^#!bash/,+1 d' contrib/completion/git-completion.bash
333
334%install
335rm -rf %{buildroot}
336make %{?_smp_mflags} INSTALLDIRS=vendor install
337%if ! %{use_prebuilt_docs} && ! 0%{?_without_docs}
338make %{?_smp_mflags} INSTALLDIRS=vendor install-doc
339%else
340%if %{use_prebuilt_docs}
341cp -a prebuilt_docs/man/* %{buildroot}%{_mandir}
342cp -a prebuilt_docs/html/* Documentation/
343%endif
344%endif
345
346%if 0
347
348%global elispdir %{_emacs_sitelispdir}/git
349make -C contrib/emacs install \
350 emacsdir=%{buildroot}%{elispdir}
351for elc in %{buildroot}%{elispdir}/*.elc ; do
352 install -pm 644 contrib/emacs/$(basename $elc .elc).el \
353 %{buildroot}%{elispdir}
354done
355install -Dpm 644 %{SOURCE10} \
356 %{buildroot}%{_emacs_sitestartdir}/git-init.el
357
358%endif
359
360make -C contrib/subtree install
361%if ! %{use_prebuilt_docs} && ! 0%{?_without_docs}
362make -C contrib/subtree install-doc
363%endif
364# it's ugly hack, but this file don't need to be copied to this directory
365# it's already part of git-core-doc and it's alone here
366rm -f %{buildroot}%{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}/git-subtree.html
367
368%if 0
369mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d
370install -pm 0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/httpd/conf.d/git.conf
371sed "s|@PROJECTROOT@|%{_var}/lib/git|g" \
372 %{SOURCE14} > %{buildroot}%{_sysconfdir}/gitweb.conf
373%else
374rm -rf %{buildroot}%{_var}/www/git/
375%endif
376
377find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
378find %{buildroot} -type f -name '*.bs' -empty -exec rm -f {} ';'
379find %{buildroot} -type f -name perllocal.pod -exec rm -f {} ';'
380
381# git-archimport is not supported
382find %{buildroot} Documentation -type f -name 'git-archimport*' -exec rm -f {} ';'
383
384exclude_re="archimport|email|git-citool|git-cvs|git-daemon|git-gui|git-remote-bzr|git-remote-hg|gitk|p4|svn"
385(find %{buildroot}%{_bindir} %{buildroot}%{_libexecdir} -type f | grep -vE "$exclude_re" | sed -e s@^%{buildroot}@@) > bin-man-doc-files
386(find %{buildroot}%{_bindir} %{buildroot}%{_libexecdir} -mindepth 1 -type d | grep -vE "$exclude_re" | sed -e 's@^%{buildroot}@%dir @') >> bin-man-doc-files
387(find %{buildroot}%{perl_vendorlib} -type f | sed -e s@^%{buildroot}@@) > perl-git-files
388(find %{buildroot}%{perl_vendorlib} -mindepth 1 -type d | sed -e 's@^%{buildroot}@%dir @') >> perl-git-files
389# Split out Git::SVN files
390grep Git/SVN perl-git-files > perl-git-svn-files
391sed -i "/Git\/SVN/ d" perl-git-files
392%if %{!?_without_docs:1}0
393(find %{buildroot}%{_mandir} -type f | grep -vE "$exclude_re|Git" | sed -e s@^%{buildroot}@@ -e 's/$/*/' ) >> bin-man-doc-files
394%else
395rm -rf %{buildroot}%{_mandir}
396%endif
397
398mkdir -p %{buildroot}%{_var}/lib/git
399%if %{use_systemd}
400mkdir -p %{buildroot}%{_unitdir}
401cp -a %{SOURCE15} %{SOURCE16} %{buildroot}%{_unitdir}
402%else
403%if 0
404mkdir -p %{buildroot}%{_sysconfdir}/xinetd.d
405# On EL <= 5, xinetd does not enable IPv6 by default
406enable_ipv6=" # xinetd does not enable IPv6 by default
407 flags = IPv6"
408perl -p \
409 -e "s|\@GITCOREDIR\@|%{gitcoredir}|g;" \
410 -e "s|\@BASE_PATH\@|%{_var}/lib/git|g;" \
411%if %{enable_ipv6}
412 -e "s|^}|$enable_ipv6\n$&|;" \
413%endif
414 %{SOURCE11} > %{buildroot}%{_sysconfdir}/xinetd.d/git
415%endif
416%endif
417
418# Setup bash completion
419install -Dpm 644 contrib/completion/git-completion.bash %{buildroot}%{bashcompdir}/git
420ln -s git %{buildroot}%{bashcompdir}/gitk
421
422# Install tcsh completion
423mkdir -p %{buildroot}%{_datadir}/git-core/contrib/completion
424install -pm 644 contrib/completion/git-completion.tcsh \
425 %{buildroot}%{_datadir}/git-core/contrib/completion/
426
427# Move contrib/hooks out of %%docdir and make them executable
428mkdir -p %{buildroot}%{_datadir}/git-core/contrib
429mv contrib/hooks %{buildroot}%{_datadir}/git-core/contrib
430chmod +x %{buildroot}%{_datadir}/git-core/contrib/hooks/*
431ln -s %{buildroot}%{_datadir}/git-core/contrib/hooks contrib/
432
433# Install git-prompt.sh
434mkdir -p %{buildroot}%{_datadir}/git-core/contrib/completion
435install -pm 644 contrib/completion/git-prompt.sh \
436 %{buildroot}%{_datadir}/git-core/contrib/completion/
437
438%if 0
439# install git-gui .desktop file
440desktop-file-install \
441%if %{desktop_vendor_tag}
442 --vendor fedora \
443%endif
444 --dir=%{buildroot}%{_datadir}/applications %{SOURCE13}
445%endif
446
447# find translations
448%find_lang %{name} %{name}.lang
449cat %{name}.lang >> bin-man-doc-files
450
451# quiet some rpmlint complaints
452chmod -R g-w %{buildroot}
453find %{buildroot} -name git-mergetool--lib | xargs chmod a-x
454# rm -f {Documentation/technical,contrib/emacs,contrib/credential/gnome-keyring}/.gitignore
455# These files probably are not needed
456find . -name .gitignore -delete
457chmod a-x Documentation/technical/api-index.sh
458find contrib -type f | xargs chmod -x
459
460# Split core files
461not_core_re="git-(add--interactive|am|credential-netrc|difftool|instaweb|relink|request-pull|send-mail|submodule)|gitweb|prepare-commit-msg|pre-rebase"
462grep -vE "$not_core_re|\/man\/" bin-man-doc-files > bin-files-core
463%if %{use_prebuilt_docs} || ! 0%{?_without_docs}
464grep -vE "$not_core_re" bin-man-doc-files | grep "\/man\/" > man-doc-files-core
465%endif
466grep -E "$not_core_re" bin-man-doc-files > bin-man-doc-git-files
467
468
469%clean
470rm -rf %{buildroot}
471
472%if %{use_systemd}
473%post daemon
474%systemd_post git@.service
475
476%preun daemon
477%systemd_preun git@.service
478
479%postun daemon
480%systemd_postun_with_restart git@.service
481%endif
482
483%files -f bin-man-doc-git-files
484%defattr(-,root,root)
485%if 0
486%{elispdir}
487%{_emacs_sitestartdir}/git-init.el
488%endif
489%{_datadir}/git-core/contrib/hooks/update-paranoid
490%{_datadir}/git-core/contrib/hooks/setgitperms.perl
491#%{_datadir}/git-core/*
492#%doc Documentation/*.txt
493#%{!?_without_docs: %doc Documentation/*.html}
494#%{!?_without_docs: %doc Documentation/howto/* Documentation/technical/*}
495
496%files core -f bin-files-core
497%defattr(-,root,root)
498%{!?_licensedir:%global license %doc}
499%license COPYING
500# exlude is best way here because of troubels with symlinks inside git-core/
501%exclude %{_datadir}/git-core/contrib/hooks/update-paranoid
502%exclude %{_datadir}/git-core/contrib/hooks/setgitperms.perl
503%{bashcomproot}
504%{_datadir}/git-core/
505
506%if %{use_prebuilt_docs} || ! 0%{?_without_docs}
507%files core-doc -f man-doc-files-core
508%else
509%files core-doc
510%endif
511%defattr(-,root,root)
512%doc README.md Documentation/*.txt Documentation/RelNotes contrib/
513%{!?_without_docs: %doc Documentation/*.html Documentation/docbook-xsl.css}
514%{!?_without_docs: %doc Documentation/howto Documentation/technical}
515%if ! %{use_prebuilt_docs}
516%{!?_without_docs: %doc contrib/subtree/git-subtree.html}
517%endif
518
519%files p4
520%defattr(-,root,root)
521%{gitcoredir}/*p4*
522%{gitcoredir}/mergetools/p4merge
523%doc Documentation/*p4*.txt
524%{!?_without_docs: %{_mandir}/man1/*p4*.1*}
525%{!?_without_docs: %doc Documentation/*p4*.html }
526
527%files svn
528%defattr(-,root,root)
529%{gitcoredir}/*svn*
530%doc Documentation/*svn*.txt
531%{!?_without_docs: %{_mandir}/man1/*svn*.1*}
532%{!?_without_docs: %doc Documentation/*svn*.html }
533
534%files cvs
535%defattr(-,root,root)
536%doc Documentation/*git-cvs*.txt
537%if "%{gitcoredir}" != "%{_bindir}"
538%{_bindir}/git-cvsserver
539%endif
540%{gitcoredir}/*cvs*
541%{!?_without_docs: %{_mandir}/man1/*cvs*.1*}
542%{!?_without_docs: %doc Documentation/*git-cvs*.html }
543
544%files email
545%defattr(-,root,root)
546%doc Documentation/*email*.txt
547%{gitcoredir}/*email*
548%{!?_without_docs: %{_mandir}/man1/*email*.1*}
549%{!?_without_docs: %doc Documentation/*email*.html }
550
551%if 0
552
553%files gui
554%defattr(-,root,root)
555%{gitcoredir}/git-gui*
556%{gitcoredir}/git-citool
557%{_datadir}/applications/*git-gui.desktop
558%{_datadir}/git-gui/
559%{!?_without_docs: %{_mandir}/man1/git-gui.1*}
560%{!?_without_docs: %doc Documentation/git-gui.html}
561%{!?_without_docs: %{_mandir}/man1/git-citool.1*}
562%{!?_without_docs: %doc Documentation/git-citool.html}
563
564%files -n gitk
565%defattr(-,root,root)
566%doc Documentation/*gitk*.txt
567%{_bindir}/*gitk*
568%{_datadir}/gitk
569%{!?_without_docs: %{_mandir}/man1/*gitk*.1*}
570%{!?_without_docs: %doc Documentation/*gitk*.html }
571
572%endif
573
574%files -n perl-Git -f perl-git-files
575%defattr(-,root,root)
576%{!?_without_docs: %exclude %{_mandir}/man3/*Git*SVN*.3pm*}
577%{!?_without_docs: %{_mandir}/man3/*Git*.3pm*}
578
579%files -n perl-Git-SVN -f perl-git-svn-files
580%defattr(-,root,root)
581%{!?_without_docs: %{_mandir}/man3/*Git*SVN*.3pm*}
582
583%if 0
584
585%files -n emacs-git
586%defattr(-,root,root)
587%doc contrib/emacs/README
588%dir %{elispdir}
589%{elispdir}/*.elc
590%{_emacs_sitestartdir}/git-init.el
591
592%files -n emacs-git-el
593%defattr(-,root,root)
594%{elispdir}/*.el
595
596%endif
597
598%files daemon
599%defattr(-,root,root)
600%doc Documentation/*daemon*.txt
601%if %{use_systemd}
602%{_unitdir}/git.socket
603%{_unitdir}/git@.service
604%else
605%if 0
606%config(noreplace)%{_sysconfdir}/xinetd.d/git
607%endif
608%endif
609%{gitcoredir}/git-daemon*
610%{_var}/lib/git
611%{!?_without_docs: %{_mandir}/man1/*daemon*.1*}
612%{!?_without_docs: %doc Documentation/*daemon*.html}
613
614%if 0
615%files -n gitweb
616%defattr(-,root,root)
617%doc gitweb/INSTALL gitweb/README
618%config(noreplace)%{_sysconfdir}/gitweb.conf
619%config(noreplace)%{_sysconfdir}/httpd/conf.d/git.conf
620%{_var}/www/git/
621%endif
622
623%files all
624# No files for you!
625
626%changelog
627* Tue Dec 13 2016 Dmitriy Kuminov <coding@dmik.org> 2.11.0-1
628- Update git to version 2.11.0.
629- Increase stack size to 8 MB to fix crashes when cloning huge repos.
630- Link against LIBCx 0.4 (this brings EXCEPTQ TRP report generator).
631- Rebuild against LIBC 0.6.6 and GCC 4.9.2.
632- Enable %lang definitions.
633
634* Wed Sep 10 2014 yd
635- added debug package with symbolic info for exceptq.
636
637* Wed Sep 10 2014 Dmitriy Kuminov <coding@dmik.org> 2.0.0-1
638- Update git to version 2.0.0.
639- Fix cloning and pushing over HTTP(S).
640- Remove many old unneeded patches to have less OS/2-dependent code.
641
642* Sat Dec 17 2011 yd
643- rebuild due to gcc 4.4.6 bug.
644
645* Sun Nov 27 2011 yd
646- use /@unixroot/usr/bin shell.
647
648* Wed Sep 28 2011 yd
649- fixed build patches.
650- fixed expat support.
651
652* Sat Sep 24 2011 yd
653- symlink script files to exe, so execvp can find them.
654- ignore CR while reading CRLF terminated text files.
655
656* Tue Sep 20 2011 yd
657- disable broken_path_fix macro.
658
659* Mon Sep 19 2011 yd
660- use bigger stack for threads; use socketpair instead of pipes.
Note: See TracBrowser for help on using the repository browser.