Rework most spec file dist conditionals
Over time the spec file had become littered with conditional statements to enable, disable, patch, and/or tweak things for various releases. Consolidate all these at the top of the spec file to make it easier to add future conditions.
This commit is contained in:
parent
3f0dc974fa
commit
7e2e90daed
132
git.spec
132
git.spec
@ -1,10 +1,65 @@
|
|||||||
# Pass --without docs to rpmbuild if you don't want the documentation
|
# Pass --without docs to rpmbuild if you don't want the documentation
|
||||||
|
|
||||||
|
# Leave git-* binaries in %{_bindir} on EL <= 5
|
||||||
%if 0%{?rhel} && 0%{?rhel} <= 5
|
%if 0%{?rhel} && 0%{?rhel} <= 5
|
||||||
%global gitcoredir %{_bindir}
|
%global gitcoredir %{_bindir}
|
||||||
%else
|
%else
|
||||||
%global gitcoredir %{_libexecdir}/git-core
|
%global gitcoredir %{_libexecdir}/git-core
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
# Build noarch subpackages and use libcurl-devel on Fedora and EL >= 6
|
||||||
|
%if 0%{?fedora} || 0%{?rhel} >= 6
|
||||||
|
%global noarch_sub 1
|
||||||
|
%global libcurl_devel libcurl-devel
|
||||||
|
%else
|
||||||
|
%global noarch_sub 0
|
||||||
|
%global libcurl_devel curl-devel
|
||||||
|
%endif
|
||||||
|
|
||||||
|
# Build git-emacs, use perl(Error) and perl(Net::SMTP::SSL), require cvsps, and
|
||||||
|
# adjust git-core obsolete version on Fedora and EL >= 5. (We don't really
|
||||||
|
# support EL-4, but folks stuck using it have enough problems, no point making
|
||||||
|
# it harder on them.)
|
||||||
|
%if 0%{?fedora} || 0%{?rhel} >= 5
|
||||||
|
%global emacs_support 1
|
||||||
|
%global git_core_version 1.5.4.3
|
||||||
|
%global perl_error 1
|
||||||
|
%global perl_net_smtp_ssl 1
|
||||||
|
%global require_cvsps 1
|
||||||
|
%else
|
||||||
|
%global emacs_support 0
|
||||||
|
%global git_core_version 1.5.4.7-4
|
||||||
|
%global perl_error 0
|
||||||
|
%global perl_net_smtp_ssl 0
|
||||||
|
%global require_cvsps 0
|
||||||
|
%endif
|
||||||
|
|
||||||
|
# Patch emacs and tweak docbook spaces on EL-5
|
||||||
|
%if 0%{?rhel} == 5
|
||||||
|
%global emacs_old 1
|
||||||
|
%global docbook_suppress_sp 1
|
||||||
|
%else
|
||||||
|
%global emacs_old 0
|
||||||
|
%global docbook_suppress_sp 0
|
||||||
|
%endif
|
||||||
|
|
||||||
|
# Enable ipv6 for git-daemon and use desktop --vendor option on EL <= 5
|
||||||
|
%if 0%{?rhel} && 0%{?rhel} <= 5
|
||||||
|
%global enable_ipv6 1
|
||||||
|
%global use_desktop_vendor 1
|
||||||
|
%else
|
||||||
|
%global enable_ipv6 1
|
||||||
|
%global use_desktop_vendor 1
|
||||||
|
%endif
|
||||||
|
|
||||||
|
# Use asciidoc-7 on EL <= 4. Again, we don't support EL-4, but no need to make
|
||||||
|
# it more difficult to build a modern git there.
|
||||||
|
%if 0%{?rhel} && 0%{?rhel} <= 4
|
||||||
|
%global asciidoc7 1
|
||||||
|
%else
|
||||||
|
%global asciidoc7 0
|
||||||
|
%endif
|
||||||
|
|
||||||
# Only build git-arch for Fedora < 16, where tla is available
|
# Only build git-arch for Fedora < 16, where tla is available
|
||||||
%if 0%{?fedora} && 0%{?fedora} < 16
|
%if 0%{?fedora} && 0%{?fedora} < 16
|
||||||
%global arch_support 1
|
%global arch_support 1
|
||||||
@ -35,14 +90,10 @@ Patch3: git-1.7-el5-emacs-support.patch
|
|||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
|
|
||||||
BuildRequires: desktop-file-utils
|
BuildRequires: desktop-file-utils
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 5
|
%if %{emacs_support}
|
||||||
BuildRequires: emacs
|
BuildRequires: emacs
|
||||||
%endif
|
%endif
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 6
|
BuildRequires: %{libcurl_devel}
|
||||||
BuildRequires: libcurl-devel
|
|
||||||
%else
|
|
||||||
BuildRequires: curl-devel
|
|
||||||
%endif
|
|
||||||
BuildRequires: expat-devel
|
BuildRequires: expat-devel
|
||||||
BuildRequires: gettext
|
BuildRequires: gettext
|
||||||
BuildRequires: openssl-devel
|
BuildRequires: openssl-devel
|
||||||
@ -51,7 +102,7 @@ BuildRequires: zlib-devel >= 1.2
|
|||||||
|
|
||||||
Requires: less
|
Requires: less
|
||||||
Requires: openssh-clients
|
Requires: openssh-clients
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 5
|
%if %{perl_error}
|
||||||
Requires: perl(Error)
|
Requires: perl(Error)
|
||||||
%endif
|
%endif
|
||||||
Requires: perl-Git = %{version}-%{release}
|
Requires: perl-Git = %{version}-%{release}
|
||||||
@ -59,13 +110,7 @@ Requires: rsync
|
|||||||
Requires: zlib >= 1.2
|
Requires: zlib >= 1.2
|
||||||
|
|
||||||
Provides: git-core = %{version}-%{release}
|
Provides: git-core = %{version}-%{release}
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 5
|
Obsoletes: git-core <= %{git_core_version}
|
||||||
Obsoletes: git-core <= 1.5.4.3
|
|
||||||
%else
|
|
||||||
# EL-4 has 1.5.4.7-3.el4. We don't support this, but no point making it more
|
|
||||||
# difficult than it needs to be (folks stuck on EL-4 have it bad enough ;).
|
|
||||||
Obsoletes: git-core <= 1.5.4.7-4
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Git is a fast, scalable, distributed revision control system with an
|
Git is a fast, scalable, distributed revision control system with an
|
||||||
@ -79,7 +124,7 @@ SCMs, install the git-all meta-package.
|
|||||||
%package all
|
%package all
|
||||||
Summary: Meta-package to pull in all git tools
|
Summary: Meta-package to pull in all git tools
|
||||||
Group: Development/Tools
|
Group: Development/Tools
|
||||||
%if 0%{?fedora} >= 10 || 0%{?rhel} >= 6
|
%if %{noarch_sub}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%endif
|
%endif
|
||||||
Requires: git = %{version}-%{release}
|
Requires: git = %{version}-%{release}
|
||||||
@ -92,16 +137,10 @@ Requires: git-gui = %{version}-%{release}
|
|||||||
Requires: git-svn = %{version}-%{release}
|
Requires: git-svn = %{version}-%{release}
|
||||||
Requires: gitk = %{version}-%{release}
|
Requires: gitk = %{version}-%{release}
|
||||||
Requires: perl-Git = %{version}-%{release}
|
Requires: perl-Git = %{version}-%{release}
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 5
|
%if %{emacs_support}
|
||||||
Requires: emacs-git = %{version}-%{release}
|
Requires: emacs-git = %{version}-%{release}
|
||||||
%endif
|
%endif
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 5
|
Obsoletes: git <= %{git_core_version}
|
||||||
Obsoletes: git <= 1.5.4.3
|
|
||||||
%else
|
|
||||||
# EL-4 has 1.5.4.7-3.el4. We don't support this, but no point making it more
|
|
||||||
# difficult than it needs to be (folks stuck on EL-4 have it bad enough ;).
|
|
||||||
Obsoletes: git <= 1.5.4.7-4
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%description all
|
%description all
|
||||||
Git is a fast, scalable, distributed revision control system with an
|
Git is a fast, scalable, distributed revision control system with an
|
||||||
@ -120,7 +159,7 @@ The git dæmon for supporting git:// access to git repositories
|
|||||||
%package -n gitweb
|
%package -n gitweb
|
||||||
Summary: Simple web interface to git repositories
|
Summary: Simple web interface to git repositories
|
||||||
Group: Development/Tools
|
Group: Development/Tools
|
||||||
%if 0%{?fedora} >= 10 || 0%{?rhel} >= 6
|
%if %{noarch_sub}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%endif
|
%endif
|
||||||
Requires: git = %{version}-%{release}
|
Requires: git = %{version}-%{release}
|
||||||
@ -132,7 +171,7 @@ Simple web interface to track changes in git repositories
|
|||||||
%package svn
|
%package svn
|
||||||
Summary: Git tools for importing Subversion repositories
|
Summary: Git tools for importing Subversion repositories
|
||||||
Group: Development/Tools
|
Group: Development/Tools
|
||||||
%if 0%{?fedora} >= 10 || 0%{?rhel} >= 6
|
%if %{noarch_sub}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%endif
|
%endif
|
||||||
Requires: git = %{version}-%{release}, subversion, perl(Term::ReadKey)
|
Requires: git = %{version}-%{release}, subversion, perl(Term::ReadKey)
|
||||||
@ -142,11 +181,11 @@ Git tools for importing Subversion repositories.
|
|||||||
%package cvs
|
%package cvs
|
||||||
Summary: Git tools for importing CVS repositories
|
Summary: Git tools for importing CVS repositories
|
||||||
Group: Development/Tools
|
Group: Development/Tools
|
||||||
%if 0%{?fedora} >= 10 || 0%{?rhel} >= 6
|
%if %{noarch_sub}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%endif
|
%endif
|
||||||
Requires: git = %{version}-%{release}, cvs
|
Requires: git = %{version}-%{release}, cvs
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 5
|
%if %{require_cvsps}
|
||||||
Requires: cvsps
|
Requires: cvsps
|
||||||
Requires: perl-DBD-SQLite
|
Requires: perl-DBD-SQLite
|
||||||
%endif
|
%endif
|
||||||
@ -166,12 +205,12 @@ Git tools for importing Arch repositories.
|
|||||||
%package email
|
%package email
|
||||||
Summary: Git tools for sending email
|
Summary: Git tools for sending email
|
||||||
Group: Development/Tools
|
Group: Development/Tools
|
||||||
%if 0%{?fedora} >= 10 || 0%{?rhel} >= 6
|
%if %{noarch_sub}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%endif
|
%endif
|
||||||
Requires: git = %{version}-%{release}, perl-Git = %{version}-%{release}
|
Requires: git = %{version}-%{release}, perl-Git = %{version}-%{release}
|
||||||
Requires: perl(Authen::SASL)
|
Requires: perl(Authen::SASL)
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 5
|
%if %{perl_net_smtp_ssl}
|
||||||
Requires: perl(Net::SMTP::SSL)
|
Requires: perl(Net::SMTP::SSL)
|
||||||
%endif
|
%endif
|
||||||
%description email
|
%description email
|
||||||
@ -180,7 +219,7 @@ Git tools for sending email.
|
|||||||
%package gui
|
%package gui
|
||||||
Summary: Git GUI tool
|
Summary: Git GUI tool
|
||||||
Group: Development/Tools
|
Group: Development/Tools
|
||||||
%if 0%{?fedora} >= 10 || 0%{?rhel} >= 6
|
%if %{noarch_sub}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%endif
|
%endif
|
||||||
Requires: git = %{version}-%{release}, tk >= 8.4
|
Requires: git = %{version}-%{release}, tk >= 8.4
|
||||||
@ -191,7 +230,7 @@ Git GUI tool.
|
|||||||
%package -n gitk
|
%package -n gitk
|
||||||
Summary: Git revision tree visualiser
|
Summary: Git revision tree visualiser
|
||||||
Group: Development/Tools
|
Group: Development/Tools
|
||||||
%if 0%{?fedora} >= 10 || 0%{?rhel} >= 6
|
%if %{noarch_sub}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%endif
|
%endif
|
||||||
Requires: git = %{version}-%{release}, tk >= 8.4
|
Requires: git = %{version}-%{release}, tk >= 8.4
|
||||||
@ -201,11 +240,11 @@ Git revision tree visualiser.
|
|||||||
%package -n perl-Git
|
%package -n perl-Git
|
||||||
Summary: Perl interface to Git
|
Summary: Perl interface to Git
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
%if 0%{?fedora} >= 10 || 0%{?rhel} >= 6
|
%if %{noarch_sub}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%endif
|
%endif
|
||||||
Requires: git = %{version}-%{release}
|
Requires: git = %{version}-%{release}
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 5
|
%if %{perl_error}
|
||||||
BuildRequires: perl(Error), perl(ExtUtils::MakeMaker)
|
BuildRequires: perl(Error), perl(ExtUtils::MakeMaker)
|
||||||
Requires: perl(Error)
|
Requires: perl(Error)
|
||||||
%endif
|
%endif
|
||||||
@ -214,12 +253,12 @@ Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $versi
|
|||||||
%description -n perl-Git
|
%description -n perl-Git
|
||||||
Perl interface to Git.
|
Perl interface to Git.
|
||||||
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 5
|
%if %{emacs_support}
|
||||||
%package -n emacs-git
|
%package -n emacs-git
|
||||||
Summary: Git version control system support for Emacs
|
Summary: Git version control system support for Emacs
|
||||||
Group: Applications/Editors
|
Group: Applications/Editors
|
||||||
Requires: git = %{version}-%{release}
|
Requires: git = %{version}-%{release}
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 6
|
%if %{noarch_sub}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
Requires: emacs(bin) >= %{_emacs_version}
|
Requires: emacs(bin) >= %{_emacs_version}
|
||||||
%else
|
%else
|
||||||
@ -232,7 +271,7 @@ Requires: emacs-common
|
|||||||
%package -n emacs-git-el
|
%package -n emacs-git-el
|
||||||
Summary: Elisp source files for git version control system support for Emacs
|
Summary: Elisp source files for git version control system support for Emacs
|
||||||
Group: Applications/Editors
|
Group: Applications/Editors
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 6
|
%if %{noarch_sub}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%endif
|
%endif
|
||||||
Requires: emacs-git = %{version}-%{release}
|
Requires: emacs-git = %{version}-%{release}
|
||||||
@ -246,7 +285,7 @@ Requires: emacs-git = %{version}-%{release}
|
|||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
%patch2 -p1
|
%patch2 -p1
|
||||||
%if 0%{?rhel} == 5
|
%if %{emacs_old}
|
||||||
%patch3 -p1
|
%patch3 -p1
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -267,16 +306,16 @@ prefix = %{_prefix}
|
|||||||
gitwebdir = %{_var}/www/git
|
gitwebdir = %{_var}/www/git
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
%if 0%{?rhel} && 0%{?rhel} <= 5
|
%if "%{gitcoredir}" == "%{_bindir}"
|
||||||
echo gitexecdir = %{_bindir} >> config.mak
|
echo gitexecdir = %{_bindir} >> config.mak
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if 0%{?rhel} && 0%{?rhel} == 5
|
%if %{docbook_suppress_sp}
|
||||||
# This is needed for 1.69.1-1.71.0
|
# This is needed for 1.69.1-1.71.0
|
||||||
echo DOCBOOK_SUPPRESS_SP = 1 >> config.mak
|
echo DOCBOOK_SUPPRESS_SP = 1 >> config.mak
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if 0%{?rhel} && 0%{?rhel} <= 4
|
%if %{asciidoc7}
|
||||||
echo ASCIIDOC7 = 1 >> config.mak
|
echo ASCIIDOC7 = 1 >> config.mak
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -294,7 +333,7 @@ chmod +x %{__perl_requires}
|
|||||||
%build
|
%build
|
||||||
make %{?_smp_mflags} all %{!?_without_docs: doc}
|
make %{?_smp_mflags} all %{!?_without_docs: doc}
|
||||||
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 5
|
%if %{emacs_support}
|
||||||
make -C contrib/emacs
|
make -C contrib/emacs
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -305,8 +344,8 @@ sed -i '/^#!bash/,+1 d' contrib/completion/git-completion.bash
|
|||||||
rm -rf %{buildroot}
|
rm -rf %{buildroot}
|
||||||
make %{?_smp_mflags} INSTALLDIRS=vendor install %{!?_without_docs: install-doc}
|
make %{?_smp_mflags} INSTALLDIRS=vendor install %{!?_without_docs: install-doc}
|
||||||
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 5
|
%if %{emacs_support}
|
||||||
%if 0%{?rhel} == 5
|
%if %{emacs_old}
|
||||||
%global _emacs_sitelispdir %{_datadir}/emacs/site-lisp
|
%global _emacs_sitelispdir %{_datadir}/emacs/site-lisp
|
||||||
%global _emacs_sitestartdir %{_emacs_sitelispdir}/site-start.d
|
%global _emacs_sitestartdir %{_emacs_sitelispdir}/site-start.d
|
||||||
%endif
|
%endif
|
||||||
@ -350,7 +389,7 @@ enable_ipv6=" # xinetd does not enable IPv6 by default
|
|||||||
perl -p \
|
perl -p \
|
||||||
-e "s|\@GITCOREDIR\@|%{gitcoredir}|g;" \
|
-e "s|\@GITCOREDIR\@|%{gitcoredir}|g;" \
|
||||||
-e "s|\@BASE_PATH\@|%{_var}/lib/git|g;" \
|
-e "s|\@BASE_PATH\@|%{_var}/lib/git|g;" \
|
||||||
%if 0%{?rhel} && 0%{?rhel} <= 5
|
%if %{enable_ipv6}
|
||||||
-e "s|^}|$enable_ipv6\n$&|;" \
|
-e "s|^}|$enable_ipv6\n$&|;" \
|
||||||
%endif
|
%endif
|
||||||
%{SOURCE2} > %{buildroot}%{_sysconfdir}/xinetd.d/git
|
%{SOURCE2} > %{buildroot}%{_sysconfdir}/xinetd.d/git
|
||||||
@ -368,7 +407,7 @@ popd > /dev/null
|
|||||||
|
|
||||||
# install git-gui .desktop file
|
# install git-gui .desktop file
|
||||||
desktop-file-install \
|
desktop-file-install \
|
||||||
%if 0%{?rhel} && 0%{?rhel} <= 5
|
%if %{use_desktop_vendor}
|
||||||
--vendor fedora \
|
--vendor fedora \
|
||||||
%endif
|
%endif
|
||||||
--dir=%{buildroot}%{_datadir}/applications %{SOURCE4}
|
--dir=%{buildroot}%{_datadir}/applications %{SOURCE4}
|
||||||
@ -449,7 +488,7 @@ rm -rf %{buildroot}
|
|||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{!?_without_docs: %{_mandir}/man3/*Git*.3pm*}
|
%{!?_without_docs: %{_mandir}/man3/*Git*.3pm*}
|
||||||
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 5
|
%if %{emacs_support}
|
||||||
%files -n emacs-git
|
%files -n emacs-git
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%doc contrib/emacs/README
|
%doc contrib/emacs/README
|
||||||
@ -485,6 +524,7 @@ rm -rf %{buildroot}
|
|||||||
%changelog
|
%changelog
|
||||||
* Tue Jul 26 2011 Todd Zullinger <tmz@pobox.com> - 1.7.6-4
|
* Tue Jul 26 2011 Todd Zullinger <tmz@pobox.com> - 1.7.6-4
|
||||||
- Drop git-arch on fedora >= 16, the tla package has been retired
|
- Drop git-arch on fedora >= 16, the tla package has been retired
|
||||||
|
- Rework most spec file dist conditionals to make future changes easier
|
||||||
|
|
||||||
* Thu Jul 21 2011 Petr Sabata <contyk@redhat.com> - 1.7.6-3
|
* Thu Jul 21 2011 Petr Sabata <contyk@redhat.com> - 1.7.6-3
|
||||||
- Perl mass rebuild
|
- Perl mass rebuild
|
||||||
|
Loading…
Reference in New Issue
Block a user