Add %{emacs_filesystem} to simplify emacs support
Use a single macro rather than testing for %{fedora} and %{rhel} versions repeatedly. The "dist" logic is best kept at the start of the spec file (as much as possible). Cleanup a few comments related to "dist" checks while we're at it.
This commit is contained in:
parent
f0946b65f2
commit
049553f03c
29
git.spec
29
git.spec
@ -3,11 +3,12 @@
|
|||||||
|
|
||||||
%global gitexecdir %{_libexecdir}/git-core
|
%global gitexecdir %{_libexecdir}/git-core
|
||||||
|
|
||||||
# Settings for F-19+ and EL-7+
|
# Settings for Fedora and EL >= 7
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
%if 0%{?fedora} || 0%{?rhel} >= 7
|
||||||
%global bashcomp_pkgconfig 1
|
%global bashcomp_pkgconfig 1
|
||||||
%global bashcompdir %(pkg-config --variable=completionsdir bash-completion 2>/dev/null)
|
%global bashcompdir %(pkg-config --variable=completionsdir bash-completion 2>/dev/null)
|
||||||
%global bashcomproot %(dirname %{bashcompdir} 2>/dev/null)
|
%global bashcomproot %(dirname %{bashcompdir} 2>/dev/null)
|
||||||
|
%global emacs_filesystem 1
|
||||||
%global libsecret 1
|
%global libsecret 1
|
||||||
%global use_new_rpm_filters 1
|
%global use_new_rpm_filters 1
|
||||||
%global use_systemd 1
|
%global use_systemd 1
|
||||||
@ -15,9 +16,11 @@
|
|||||||
%global bashcomp_pkgconfig 0
|
%global bashcomp_pkgconfig 0
|
||||||
%global bashcompdir %{_sysconfdir}/bash_completion.d
|
%global bashcompdir %{_sysconfdir}/bash_completion.d
|
||||||
%global bashcomproot %{bashcompdir}
|
%global bashcomproot %{bashcompdir}
|
||||||
|
%global emacs_filesystem 0
|
||||||
%global libsecret 0
|
%global libsecret 0
|
||||||
%global use_new_rpm_filters 0
|
%global use_new_rpm_filters 0
|
||||||
%global use_systemd 0
|
%global use_systemd 0
|
||||||
|
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Settings for EL <= 7
|
# Settings for EL <= 7
|
||||||
@ -25,10 +28,8 @@
|
|||||||
%{!?__global_ldflags: %global __global_ldflags -Wl,-z,relro}
|
%{!?__global_ldflags: %global __global_ldflags -Wl,-z,relro}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# fallback for F17- && RHEL6-
|
# Test links in HTML documentation on Fedora (linkchecker is not in EL)
|
||||||
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
|
%if 0%{?fedora}
|
||||||
|
|
||||||
%if 0%{?fedora} && 0%{?fedora} >= 25
|
|
||||||
%global test_links 1
|
%global test_links 1
|
||||||
%else
|
%else
|
||||||
%global test_links 0
|
%global test_links 0
|
||||||
@ -162,13 +163,8 @@ Requires: perl(Term::ReadKey)
|
|||||||
%endif
|
%endif
|
||||||
Requires: perl-Git = %{version}-%{release}
|
Requires: perl-Git = %{version}-%{release}
|
||||||
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
%if %{emacs_filesystem}
|
||||||
Requires: emacs-filesystem >= %{_emacs_version}
|
Requires: emacs-filesystem >= %{_emacs_version}
|
||||||
# These can be removed in Fedora 26
|
|
||||||
Obsoletes: emacs-git <= 2.4.5
|
|
||||||
Obsoletes: emacs-git-el <= 2.4.5
|
|
||||||
Provides: emacs-git = %{version}-%{release}
|
|
||||||
Provides: emacs-git-el = %{version}-%{release}
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Obsolete gnome-keyring credential helper (remove in Fedora 29)
|
# Obsolete gnome-keyring credential helper (remove in Fedora 29)
|
||||||
@ -198,7 +194,7 @@ Requires: perl-Git = %{version}-%{release}
|
|||||||
%if ! %{defined perl_bootstrap}
|
%if ! %{defined perl_bootstrap}
|
||||||
Requires: perl(Term::ReadKey)
|
Requires: perl(Term::ReadKey)
|
||||||
%endif
|
%endif
|
||||||
%if 0%{?rhel} && 0%{?rhel} <= 6
|
%if ! %{emacs_filesystem}
|
||||||
Requires: emacs-git = %{version}-%{release}
|
Requires: emacs-git = %{version}-%{release}
|
||||||
%endif
|
%endif
|
||||||
%description all
|
%description all
|
||||||
@ -334,7 +330,7 @@ Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $versi
|
|||||||
%description -n perl-Git-SVN
|
%description -n perl-Git-SVN
|
||||||
%{summary}.
|
%{summary}.
|
||||||
|
|
||||||
%if 0%{?rhel} && 0%{?rhel} <= 6
|
%if ! %{emacs_filesystem}
|
||||||
%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
|
||||||
@ -638,7 +634,7 @@ rm -rf %{buildroot}
|
|||||||
|
|
||||||
%files -f bin-man-doc-git-files
|
%files -f bin-man-doc-git-files
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
%if %{emacs_filesystem}
|
||||||
%{elispdir}
|
%{elispdir}
|
||||||
%{_emacs_sitestartdir}/git-init.el
|
%{_emacs_sitestartdir}/git-init.el
|
||||||
%endif
|
%endif
|
||||||
@ -730,7 +726,7 @@ rm -rf %{buildroot}
|
|||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{?with_docs:%{_mandir}/man3/*Git*SVN*.3pm*}
|
%{?with_docs:%{_mandir}/man3/*Git*SVN*.3pm*}
|
||||||
|
|
||||||
%if 0%{?rhel} && 0%{?rhel} <= 6
|
%if ! %{emacs_filesystem}
|
||||||
%files -n emacs-git
|
%files -n emacs-git
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{_pkgdocdir}/contrib/emacs/README
|
%{_pkgdocdir}/contrib/emacs/README
|
||||||
@ -770,6 +766,9 @@ rm -rf %{buildroot}
|
|||||||
# No files for you!
|
# No files for you!
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Jan 12 2018 Todd Zullinger <tmz@pobox.com>
|
||||||
|
- Add %%{emacs_filesystem} to simplify emacs support
|
||||||
|
|
||||||
* Thu Jan 11 2018 Todd Zullinger <tmz@pobox.com>
|
* Thu Jan 11 2018 Todd Zullinger <tmz@pobox.com>
|
||||||
- Update BuildRequires for tests
|
- Update BuildRequires for tests
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user