From 00a8980c58f90c0a44c94afd56ec1735df98a10e Mon Sep 17 00:00:00 2001 From: Petr Stodulka Date: Fri, 21 Jul 2017 16:31:01 +0200 Subject: [PATCH] add test by linkchecker for broken links in doc files Links in docfiles are now automatically checked for correct paths by linkchecker. The test is available only for Fedora 25+ system, because the utility is not available for RHEL. --- git.spec | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/git.spec b/git.spec index 5f34e70..57721bd 100644 --- a/git.spec +++ b/git.spec @@ -71,6 +71,12 @@ # fallback for F17- && RHEL6- %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} +%if 0%{?fedora} && 0%{?fedora} >= 25 +%global test_links 1 +%else +%global test_links 0 +%endif + Name: git Version: 2.13.3 Release: 2%{?dist} @@ -115,6 +121,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if ! %{use_prebuilt_docs} && ! 0%{?_without_docs} BuildRequires: asciidoc >= 8.4.1 BuildRequires: xmlto +%if %{test_links} +BuildRequires: linkchecker +%endif %endif BuildRequires: desktop-file-utils BuildRequires: emacs @@ -662,6 +671,9 @@ find %{buildroot}%{_pkgdocdir}/{howto,technical} -type f \ ##### #DOC %check +%if %{test_links} +find %{buildroot}%{_pkgdocdir} -name "*.html" | xargs linkchecker +%endif %ifarch s390x # Skip grep tests which fail intermittently on s390x export GIT_SKIP_TESTS="t7810"