Clean up dist conditionals, don't pretend to support EL-4 builds

This commit is contained in:
Todd Zullinger 2013-01-04 22:36:01 -05:00
parent dae85881ce
commit f8c03bb1de

142
git.spec
View File

@ -1,68 +1,31 @@
# 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 # Settings for EL-5
# - Leave git-* binaries in %{_bindir}
# - Don't use noarch subpackages
# - Use proper libcurl devel package
# - Patch emacs and tweak docbook spaces
# - Explicitly enable ipv6 for git-daemon
# - Define missing python macro
%if 0%{?rhel} && 0%{?rhel} <= 5 %if 0%{?rhel} && 0%{?rhel} <= 5
%global gitcoredir %{_bindir} %global gitcoredir %{_bindir}
%else %global noarch_sub 0
%global gitcoredir %{_libexecdir}/git-core %global libcurl_devel curl-devel
%endif %global emacs_old 1
# 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 %global docbook_suppress_sp 1
%else %global enable_ipv6 1
%global emacs_old 0
%global docbook_suppress_sp 0
%endif
# Enable ipv6 for git-daemon, use desktop --vendor option and setup python
# macros on EL <= 5
%if 0%{?rhel} && 0%{?rhel} <= 5
%global enable_ipv6 1
%global use_desktop_vendor 1
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%else %else
%global enable_ipv6 1 %global gitcoredir %{_libexecdir}/git-core
%global use_desktop_vendor 1 %global noarch_sub 1
%endif %global libcurl_devel libcurl-devel
%global emacs_old 0
# Only build git-arch for Fedora < 16, where tla is available %global docbook_suppress_sp 0
%if 0%{?fedora} && 0%{?fedora} < 16 %global enable_ipv6 0
%global arch_support 1
%else
%global arch_support 0
%endif %endif
# Build gnome-keyring git-credential helper on Fedora and RHEL >= 7 # Build gnome-keyring git-credential helper on Fedora and RHEL >= 7
%if 0%{?rhel} >= 7 || 0%{?fedora} %if 0%{?fedora} || 0%{?rhel} >= 7
%global gnome_keyring 1 %global gnome_keyring 1
%else %else
%global gnome_keyring 0 %global gnome_keyring 0
@ -91,36 +54,30 @@ Patch4: 0001-DESTDIR-support-in-contrib-subtree-Makefile.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 %{emacs_support}
BuildRequires: emacs BuildRequires: emacs
%endif
BuildRequires: %{libcurl_devel}
BuildRequires: expat-devel BuildRequires: expat-devel
BuildRequires: gettext BuildRequires: gettext
BuildRequires: pcre-devel
BuildRequires: openssl-devel
BuildRequires: zlib-devel >= 1.2
%{!?_without_docs:BuildRequires: asciidoc >= 8.4.1, xmlto} %{!?_without_docs:BuildRequires: asciidoc >= 8.4.1, xmlto}
BuildRequires: %{libcurl_devel}
%if %{gnome_keyring} %if %{gnome_keyring}
BuildRequires: libgnome-keyring-devel BuildRequires: libgnome-keyring-devel
%endif %endif
BuildRequires: pcre-devel
BuildRequires: openssl-devel
BuildRequires: zlib-devel >= 1.2
Requires: less Requires: less
Requires: openssh-clients Requires: openssh-clients
%if %{perl_error}
Requires: perl(Error) Requires: perl(Error)
%endif
Requires: perl-Git = %{version}-%{release} Requires: perl-Git = %{version}-%{release}
Requires: rsync Requires: rsync
Requires: zlib >= 1.2 Requires: zlib >= 1.2
Provides: git-core = %{version}-%{release} Provides: git-core = %{version}-%{release}
Obsoletes: git-core <= %{git_core_version} Obsoletes: git-core <= 1.5.4.3
# Obsolete git-arch as needed # Obsolete git-arch
%if ! %{arch_support}
Obsoletes: git-arch < %{version}-%{release} Obsoletes: git-arch < %{version}-%{release}
%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
@ -138,9 +95,6 @@ Group: Development/Tools
BuildArch: noarch BuildArch: noarch
%endif %endif
Requires: git = %{version}-%{release} Requires: git = %{version}-%{release}
%if %{arch_support}
Requires: git-arch = %{version}-%{release}
%endif
Requires: git-cvs = %{version}-%{release} Requires: git-cvs = %{version}-%{release}
Requires: git-email = %{version}-%{release} Requires: git-email = %{version}-%{release}
Requires: git-gui = %{version}-%{release} Requires: git-gui = %{version}-%{release}
@ -148,10 +102,8 @@ Requires: git-svn = %{version}-%{release}
Requires: git-p4 = %{version}-%{release} Requires: git-p4 = %{version}-%{release}
Requires: gitk = %{version}-%{release} Requires: gitk = %{version}-%{release}
Requires: perl-Git = %{version}-%{release} Requires: perl-Git = %{version}-%{release}
%if %{emacs_support}
Requires: emacs-git = %{version}-%{release} Requires: emacs-git = %{version}-%{release}
%endif Obsoletes: git <= 1.5.4.3
Obsoletes: git <= %{git_core_version}
%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
@ -203,23 +155,11 @@ Group: Development/Tools
BuildArch: noarch BuildArch: noarch
%endif %endif
Requires: git = %{version}-%{release}, cvs Requires: git = %{version}-%{release}, cvs
%if %{require_cvsps}
Requires: cvsps Requires: cvsps
Requires: perl-DBD-SQLite Requires: perl-DBD-SQLite
%endif
%description cvs %description cvs
Git tools for importing CVS repositories. Git tools for importing CVS repositories.
%if %{arch_support}
%package arch
Summary: Git tools for importing Arch repositories
Group: Development/Tools
BuildArch: noarch
Requires: git = %{version}-%{release}, tla
%description arch
Git tools for importing Arch repositories.
%endif
%package email %package email
Summary: Git tools for sending email Summary: Git tools for sending email
Group: Development/Tools Group: Development/Tools
@ -228,9 +168,7 @@ 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 %{perl_net_smtp_ssl}
Requires: perl(Net::SMTP::SSL) Requires: perl(Net::SMTP::SSL)
%endif
%description email %description email
Git tools for sending email. Git tools for sending email.
@ -262,10 +200,8 @@ Group: Development/Libraries
BuildArch: noarch BuildArch: noarch
%endif %endif
Requires: git = %{version}-%{release} Requires: git = %{version}-%{release}
%if %{perl_error}
BuildRequires: perl(Error), perl(ExtUtils::MakeMaker) BuildRequires: perl(Error), perl(ExtUtils::MakeMaker)
Requires: perl(Error) Requires: perl(Error)
%endif
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
%description -n perl-Git %description -n perl-Git
@ -283,7 +219,6 @@ Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $versi
%description -n perl-Git-SVN %description -n perl-Git-SVN
Perl interface to Git. Perl interface to Git.
%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
@ -308,7 +243,6 @@ Requires: emacs-git = %{version}-%{release}
%description -n emacs-git-el %description -n emacs-git-el
%{summary}. %{summary}.
%endif
%prep %prep
%setup -q %setup -q
@ -360,9 +294,7 @@ chmod +x %{__perl_requires}
%build %build
make %{?_smp_mflags} all %{!?_without_docs: doc} make %{?_smp_mflags} all %{!?_without_docs: doc}
%if %{emacs_support}
make -C contrib/emacs make -C contrib/emacs
%endif
%if %{gnome_keyring} %if %{gnome_keyring}
make -C contrib/credential/gnome-keyring/ make -C contrib/credential/gnome-keyring/
@ -377,7 +309,6 @@ 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 %{emacs_support}
%if %{emacs_old} %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
@ -391,7 +322,6 @@ for elc in %{buildroot}%{elispdir}/*.elc ; do
done done
install -Dpm 644 %{SOURCE2} \ install -Dpm 644 %{SOURCE2} \
%{buildroot}%{_emacs_sitestartdir}/git-init.el %{buildroot}%{_emacs_sitestartdir}/git-init.el
%endif
%if %{gnome_keyring} %if %{gnome_keyring}
install -pm 755 contrib/credential/gnome-keyring/git-credential-gnome-keyring \ install -pm 755 contrib/credential/gnome-keyring/git-credential-gnome-keyring \
@ -416,9 +346,8 @@ find %{buildroot} -type f -name perllocal.pod -exec rm -f {} ';'
# use yet # use yet
rm -rf %{buildroot}%{python_sitelib} %{buildroot}%{gitcoredir}/git-remote-testgit rm -rf %{buildroot}%{python_sitelib} %{buildroot}%{gitcoredir}/git-remote-testgit
%if ! %{arch_support} # git-archimport is not supported
find %{buildroot} Documentation -type f -name 'git-archimport*' -exec rm -f {} ';' find %{buildroot} Documentation -type f -name 'git-archimport*' -exec rm -f {} ';'
%endif
(find %{buildroot}{%{_bindir},%{_libexecdir}} -type f | grep -vE "archimport|p4|svn|cvs|email|gitk|git-gui|git-citool|git-daemon" | sed -e s@^%{buildroot}@@) > bin-man-doc-files (find %{buildroot}{%{_bindir},%{_libexecdir}} -type f | grep -vE "archimport|p4|svn|cvs|email|gitk|git-gui|git-citool|git-daemon" | sed -e s@^%{buildroot}@@) > bin-man-doc-files
(find %{buildroot}{%{_bindir},%{_libexecdir}} -mindepth 1 -type d | grep -vE "archimport|p4|svn|cvs|email|gitk|git-gui|git-citool|git-daemon" | sed -e 's@^%{buildroot}@%dir @') >> bin-man-doc-files (find %{buildroot}{%{_bindir},%{_libexecdir}} -mindepth 1 -type d | grep -vE "archimport|p4|svn|cvs|email|gitk|git-gui|git-citool|git-daemon" | sed -e 's@^%{buildroot}@%dir @') >> bin-man-doc-files
@ -469,10 +398,7 @@ install -pm 644 contrib/completion/git-prompt.sh \
%{buildroot}%{_datadir}/git-core/contrib/completion/ %{buildroot}%{_datadir}/git-core/contrib/completion/
# install git-gui .desktop file # install git-gui .desktop file
desktop-file-install \ desktop-file-install --vendor fedora \
%if %{use_desktop_vendor}
--vendor fedora \
%endif
--dir=%{buildroot}%{_datadir}/applications %{SOURCE5} --dir=%{buildroot}%{_datadir}/applications %{SOURCE5}
# find translations # find translations
@ -522,15 +448,6 @@ rm -rf %{buildroot}
%{!?_without_docs: %{_mandir}/man1/*cvs*.1*} %{!?_without_docs: %{_mandir}/man1/*cvs*.1*}
%{!?_without_docs: %doc Documentation/*git-cvs*.html } %{!?_without_docs: %doc Documentation/*git-cvs*.html }
%if %{arch_support}
%files arch
%defattr(-,root,root)
%doc Documentation/git-archimport.txt
%{gitcoredir}/git-archimport
%{!?_without_docs: %{_mandir}/man1/git-archimport.1*}
%{!?_without_docs: %doc Documentation/git-archimport.html }
%endif
%files email %files email
%defattr(-,root,root) %defattr(-,root,root)
%doc Documentation/*email*.txt %doc Documentation/*email*.txt
@ -566,7 +483,6 @@ rm -rf %{buildroot}
%defattr(-,root,root) %defattr(-,root,root)
%{!?_without_docs: %{_mandir}/man3/*Git*SVN*.3pm*} %{!?_without_docs: %{_mandir}/man3/*Git*SVN*.3pm*}
%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
@ -577,7 +493,6 @@ rm -rf %{buildroot}
%files -n emacs-git-el %files -n emacs-git-el
%defattr(-,root,root) %defattr(-,root,root)
%{elispdir}/*.el %{elispdir}/*.el
%endif
%files daemon %files daemon
%defattr(-,root,root) %defattr(-,root,root)
@ -604,6 +519,7 @@ rm -rf %{buildroot}
- Update asciidoc requirements, drop unsupported ASCIIDOC7 - Update asciidoc requirements, drop unsupported ASCIIDOC7
- Define GNU_ROFF to force ASCII apostrophes in manpages (so copy/paste works) - Define GNU_ROFF to force ASCII apostrophes in manpages (so copy/paste works)
- Install tcsh completion (requires manual setup by users) - Install tcsh completion (requires manual setup by users)
- Clean up dist conditionals, don't pretend to support EL-4 builds
* Wed Feb 20 2013 Adam Tkac <atkac redhat com> - 1.8.1.4-1 * Wed Feb 20 2013 Adam Tkac <atkac redhat com> - 1.8.1.4-1
- update to 1.8.1.4 - update to 1.8.1.4