summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Zullinger <tmz@pobox.com>2018-06-15 21:14:20 -0400
committerTodd Zullinger <tmz@pobox.com>2018-06-16 22:36:05 -0400
commita4d1cbe61c442d74f144b13ae74847a9c4dede36 (patch)
treeca3abc0462b60521f6f317a69203f0a93f5e1c7a
parent9febbf3744cfe862cfc0d8cfbfc8d559d11aa1a2 (diff)
downloadcgit_EL6-a4d1cbe61c442d74f144b13ae74847a9c4dede36.tar.gz
use %bcond_(with|without) to toggle highlight
Apply the highlight v3 patch unconditionally and drop a crufty comment regarding el5.
-rw-r--r--cgit.spec27
1 files changed, 12 insertions, 15 deletions
diff --git a/cgit.spec b/cgit.spec
index b294487..e94b94c 100644
--- a/cgit.spec
+++ b/cgit.spec
@@ -10,13 +10,11 @@
# the *.py files in cgit are not importable python modules
%global _python_bytecompile_extra 0
-%global syntax_highlight 1
-
-# Temporarily -- in epel-7-ppc64 is not highlight package currently, #1117261
-%if 0%{?rhel} == 7
-%ifarch ppc64
-%global syntax_highlight 0
-%endif
+# The highlight package is not available in epel-7-ppc64
+%if 0%{?rhel} == 7 && %{_arch} == ppc64
+%bcond_with highlight
+%else
+%bcond_without highlight
%endif
Name: cgit
@@ -32,12 +30,13 @@ Source1: https://www.kernel.org/pub/software/scm/git//git-%{gitver}.tar.x
Source2: cgitrc
Source3: README.SELinux
+# All supported releases use highlight version 3.
+Patch0: cgit-0.9.1-highlightv3.patch
+
# Security guys might try to repoquery for this.
Provides: bundled(git) = %gitver
-%if %{syntax_highlight}
-# All supported releases use highlight version 3.
-Patch1: cgit-0.9.1-highlightv3.patch
+%if %{with highlight}
BuildRequires: highlight
%endif
@@ -64,9 +63,7 @@ Cgit is a fast web interface for git. It uses caching to increase performance.
%prep
%setup -q -a 1
-%if %{syntax_highlight}
-%patch1 -p1
-%endif
+%patch0 -p1
# setup the git dir
rm -rf git
@@ -125,8 +122,7 @@ EOF
# Something in the a2x chain doesn't like running in parallel. :/
make -j1 doc-man doc-html
-%if %{syntax_highlight}
-# el5 highlight doesn't know --print-style
+%if %{with highlight}
highlight --print-style --style-outfile=stdout >> cgit.css
%endif
@@ -163,6 +159,7 @@ install -d -m0755 %{buildroot}%{cachedir}
%changelog
* Fri Jun 15 2018 Todd Zullinger <tmz@pobox.com> - 1.1-11
- disable automatic compilation of *.py files outside of python sitelib
+- use %%bcond_(with|without) to toggle highlight
* Mon Jun 04 2018 Todd Zullinger <tmz@pobox.com>
- make config: drop redundant DESTDIR/INSTALL, add COPYTREE