Sync from SUSE:ALP:Source:Standard:1.0 source-highlight revision a689604ba006e2ea9eb25225282d759e

This commit is contained in:
Adrian Schröter 2023-06-07 08:39:42 +02:00
commit a26ca4df24
11 changed files with 628 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,41 @@
From 52ac9fe79c41f300b86a8f51df5b02d0d562b966 Mon Sep 17 00:00:00 2001
From: Tom Tromey <tom@tromey.com>
Date: Wed, 10 Jun 2020 20:38:27 -0600
Subject: [PATCH] Remove "throw" specifications
C++ throw specifications were deprecated in C++11.
This patch removes them from the library.
---
lib/srchilite/fileutil.cc | 2 +-
lib/srchilite/fileutil.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/srchilite/fileutil.cc b/lib/srchilite/fileutil.cc
index 59a6d64..963178c 100644
--- a/lib/srchilite/fileutil.cc
+++ b/lib/srchilite/fileutil.cc
@@ -48,7 +48,7 @@ void set_file_util_verbose(bool b) {
// FIXME avoid using a global variable
std::string start_path;
-string readFile(const string &fileName) throw (IOException) {
+string readFile(const string &fileName) {
ifstream file(fileName.c_str());
if (!file.is_open()) {
diff --git a/lib/srchilite/fileutil.h b/lib/srchilite/fileutil.h
index 7335a9b..042eb56 100644
--- a/lib/srchilite/fileutil.h
+++ b/lib/srchilite/fileutil.h
@@ -27,7 +27,7 @@ extern std::string start_path;
* @return the contents of the file
* @throw IOException
*/
-string readFile(const string &fileName) throw (IOException);
+string readFile(const string &fileName);
//char *read_file(const string &fileName);
--
2.31.1

1
baselibs.conf Normal file
View File

@ -0,0 +1 @@
libsource-highlight4

BIN
source-highlight-3.1.9.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,17 @@
-----BEGIN PGP SIGNATURE-----
iQJDBAABCAAtFiEE6f6K6VDLB/W+sugFA2p1MJ0z5bUFAl2h6vwPHHRvbUB0cm9t
ZXkuY29tAAoJEANqdTCdM+W1oWEP/RJEfZTp3WrGB+Fe1+FNiMDq+iGcdbm9MXpr
fp871ds+zvm7Wb4WJEAMtrNSqozNQ1BLJdYuKovI4tWV/ej+189R7vqf1JytU31H
8Sx6QokDt/cU+4NA4CBdXZoDEGwcQiFC5mQQCFiZqhJ70ayvnMRQ+XapMxFF+p2c
pRv7+qgJVCrxRS7Vj21ZozFR7ZcMpm/fvZujWFL04DVh3hh84MDnlidl8xzNLoFW
f9TJVgKA1ulA8urLzEfF9b8jRgpit1xXao86uwmW/t9wnYsUEZWqUQ9W9BvheufY
2tjjwoQHBpPg6fyEZGenUcYMXKsbGK4Ce9kJItn6MTvo73OZ1sdjJtTxixMwHQh2
NeNQ4TejoYJ7cM0YxT/peZcczlF9i2hQOIV7eqsbjhQSRD75POMnwcv98jqEzFE0
gg9GiNg1RRgP2RtY/U0XCw2RjPEIpk8TalrUA8h0iQgGV837maTJKfpII2C29I+m
EARjLz3k3tz/zBLtzPrVEJXCPp0V7WpHxyrBmrk46gHw0Dqlxtnpe58a40AeyKsN
BwM8uH9ghWbizmg0UKXvEssycLGSzkB/G1c3l8nkI7V6dvNymuX5By4GpuakUiPz
1zRJ9Q2yLOaF8owcRYStc5iLgolaTvTGVlbc6xoU1ZZE+obhINv5AX102uh8hvMk
cx600fqZ
=7IK7
-----END PGP SIGNATURE-----

View File

@ -0,0 +1,10 @@
Alias /source-highlight "/srv/source-highlight"
<Directory "/srv/source-highlight">
Options ExecCGI
AllowOverride None
AddHandler cgi-script .cgi
DirectoryIndex source-highlight.cgi
Order allow,deny
Allow from all
</Directory>

View File

@ -0,0 +1,12 @@
diff --git a/lib/srchilite/srchilite.doxyfile.in b/lib/srchilite/srchilite.doxyfile.in
index e98a536..45ef2d9 100644
--- a/lib/srchilite/srchilite.doxyfile.in
+++ b/lib/srchilite/srchilite.doxyfile.in
@@ -727,6 +727,7 @@ HTML_HEADER =
# standard footer.
HTML_FOOTER =
+HTML_FOOTER_DESCRIPTION = FALSE
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to

260
source-highlight.changes Normal file
View File

@ -0,0 +1,260 @@
-------------------------------------------------------------------
Tue Apr 26 07:51:16 UTC 2022 - Dirk Müller <dmueller@suse.com>
- add gpg signature validation
- use https:// as source reference
-------------------------------------------------------------------
Fri Dec 17 11:15:15 UTC 2021 - Danilo Spinella <danilo.spinella@suse.com>
- Replace ctags hard requirement with a recommendation for
libsource-highlight, fixes bsc#1193401
- Run spec-cleaner
-------------------------------------------------------------------
Tue Jun 1 09:33:31 UTC 2021 - Christophe Giboudeaux <christophe@krop.fr>
- Add GCC 11 compatibility fix:
* 0001-Remove-throw-specifications.patch
- Update source-highlight-doxygen_disable_timestamp_in_footer.patch
to allow using %autosetup
-------------------------------------------------------------------
Mon Dec 28 08:02:57 UTC 2020 - Martin Pluskal <mpluskal@suse.com>
- Do not use keyring for now as key signing key is not properly
published
- Modernise spec-file and simplify depenency conditionals
-------------------------------------------------------------------
Tue Dec 22 08:16:54 UTC 2020 - Arjen de Korte <suse+build@de-korte.org>
- restore keyring as sig is available from upstream
-------------------------------------------------------------------
Thu Aug 20 19:31:20 UTC 2020 - Dirk Mueller <dmueller@suse.com>
- update to 3.1.9:
* changed esc.style to work better with dark theme terminals
* updated C and C++ to more recent standards
* fixed zsh.lang
* added new Python keywords
* added Rust
* added ixpe
* added vim
- remove keyring as sig no longer is available
-------------------------------------------------------------------
Thu Feb 2 14:51:06 UTC 2017 - adam.majer@suse.de
- use individual libboost-*-devel packages instead of boost-devel
-------------------------------------------------------------------
Mon Mar 7 09:49:19 UTC 2016 - fcrozat@suse.com
- Add use-lessopen.patch: use lessopen.sh instead of lesspipe in
src-hilite-lesspipe.sh, since our less package ships with
lessopen.sh (boo#1016309).
-------------------------------------------------------------------
Wed Apr 1 13:54:12 UTC 2015 - mpluskal@suse.com
- Update to 3.1.8
* src/lang.map: .f mapped to fotran
* src/sh.lang: do not consider $' a variable
* https://savannah.gnu.org/bugs/?36613
- Use correct requires for info
-------------------------------------------------------------------
Wed Mar 18 07:48:00 UTC 2015 - mpluskal@suse.com
- Add baselibs.conf to sources
-------------------------------------------------------------------
Tue Mar 17 16:58:03 UTC 2015 - mpluskal@suse.com
- Cleanup spec file with spec-cleaner
- Add gpg signature
- Use graphviz-gd instead of graphiz-gnome
- Disable build of static library
- Remove source-highlight-rpmlintrc
-------------------------------------------------------------------
Fri Mar 28 15:51:31 UTC 2014 - schwab@suse.de
- Build with graphiz-gnome, needed for png support in dot
-------------------------------------------------------------------
Sun Dec 29 15:33:29 UTC 2013 - benoit.monin@gmx.fr
- update to 3.1.7:
* language definition for Lilypond
* language definition for R statistics programming language
* language definition for ISLISP
* improved Erlang definition file
* new output format: ESC 256 ascii code
-------------------------------------------------------------------
Wed May 16 08:39:18 UTC 2012 - coolo@suse.com
- remove explicit lib requires that are even wrong in parts
-------------------------------------------------------------------
Wed May 9 13:10:28 UTC 2012 - coolo@suse.com
- format sources to readd preamble
-------------------------------------------------------------------
Mon Feb 13 10:56:15 UTC 2012 - coolo@suse.com
- patch license to follow spdx.org standard
-------------------------------------------------------------------
Mon Jan 02 20:20:09 UTC 2012 - pascal.bleser@opensuse.org
- update to 3.1.6:
* language definition file for T/Foswiki TML markup
* new output format: ODF (e.g. for LibreOffice or to generate ODF
color-highlighted snippets to be used by ODF back-ends, like asciidoc-odf)
* new output format: MediaWiki
-------------------------------------------------------------------
Sun Sep 04 14:36:55 UTC 2011 - pascal.bleser@opensuse.org
- soname bumped from 3 to 4
- dropped source-highlight-boost_ldflags_lib64.patch, was merged upstream
- update to 3.1.5:
* boost m4 macro finds boost in lib64
* boost m4 macro files are not installed
* updated php lang definition with new php 5 keywords
* language definition for Scheme
* language definition for Po files
* language definition for Opa
* language definition for Javalog
* language definition for UPC
* fixed a bug in scala.lang dealing with keywords
* updated sql.lang
* Emacs lisp files highlighted as Lisp
* improved logtalk.lang
* embed inputlang in the output file
* highlight _ in variable declarations
* correctly highlight for less when filenames contain spaces
-------------------------------------------------------------------
Tue Jun 15 15:37:20 UTC 2010 - pascal.bleser@opensuse.org
- update to 3.1.4:
* php handles embedded html
* html handles embedded css and javascript
* Google's Protocol Buffers language definition added
* CakePhp template files highlighted as php
* haskell literate programming highlighting
* vala language definition
* lisp language definition
-------------------------------------------------------------------
Wed Jan 20 00:14:29 UTC 2010 - pascal.bleser@opensuse.org
- update to 3.1.3:
* --tab option is correcly handled
* bash is highlighted
-------------------------------------------------------------------
Thu Dec 24 23:03:38 UTC 2009 - pascal.bleser@opensuse.org
- update to 3.1.2:
* language for files starting with <? and <!doctype is now
inferred
* some language definitions were added: manifest files, asm,
applescript, vbscript, awk, bat, clipper, cobol, D, Erlang, and
compiler output errors
* a style for label and path was added
* label elements are recognized in C/C++
* logtalk.lang was improved
* email regular expression in url.lang was improved
-------------------------------------------------------------------
Thu Sep 24 00:00:00 CEST 2009 - pascal.bleser@opensuse.org
- SONAME change from 1 to 3
- added baselibs.conf
- update to 3.1.1:
* access to static global LangDefManager, LangMaps is provided through the
class Instances
* a mechanism for setting a global data directory value was added, together
with library utility functions to retrieve .lang and .outlang files
* the SourceHighlight class returns the output file extension
* the background color for the document is kept empty if it is not specified
in the style file
* the utils.h file is installed in the header directory
* White is a standard color in style files
* language definition files for Texinfo and Haskell were added
-------------------------------------------------------------------
Sat Jun 13 00:00:00 CEST 2009 - pascal.bleser@opensuse.org
- update to 3.1:
* some library utility functions to retrieve .style and .css files were added
* a language definition for Oz was added
-------------------------------------------------------------------
Thu May 21 00:00:00 CEST 2009 - pascal.bleser@opensuse.org
- moved to openSUSE Build Service (devel:tools)
-------------------------------------------------------------------
Wed May 20 00:00:00 CEST 2009 - pascal.bleser@opensuse.org
- package the CGI into a -cgi subpackage
- update to 3.0.1:
* fixed library manual link in index.html
* doxyfile is now distributed
* better formatting for < and > in latex output
* doxygen documentation can be built even when building in a separate
directory
* added man page for source-highlight-settings
-------------------------------------------------------------------
Sun May 10 00:00:00 CEST 2009 - pascal.bleser@opensuse.org
- update to 3.0:
* source-highlight now also provides a C++ library
* --regex-range has been added (highlight only specified lines of an input
file)
* --docdir is used for the documentation directory
* the --binary-output command line option has been added
* the program source-highlight-settings has been added to write a
configuration file for source-highlight
* language definitions for generic configuration files and for pkg-config
files have been added
* the input language is now also discovered using the whole file name
* in .lang files, it is now possible to specify the exit level
- changes from 2.11.1:
* language definitions for Fortran, Caml, and JavaScript were improved
* ada language definition file was added
- changes from 2.11:
* language definitions for Scala and Xorg configuration files were added
* the procedure for regular expression matching was improved
* boost regex library discovery in the configure script was improved
* the configuration file for bash_completion was added
* it is now possible to highlight only specific ranges of lines
-------------------------------------------------------------------
Wed Sep 10 00:00:00 CEST 2008 - guru@unixtech.be
- update to 2.10:
* formatting is applied even when generating anchors and references
* noref is handled also for output languages using onestyle (e.g., xhtml)
* improved fortran highlighting
* improved python highlighting
* fixed title in docbook output
* language definition for ldap files (e.g., ldiff files)
* language definition for autoconf files
* improved m4 language definition
* improved logtalk language definition
* url.lang handles ~ in urls
* language definition for glsl.lang (provided by Cesare Tirabassi)

51
source-highlight.keyring Normal file
View File

@ -0,0 +1,51 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBF1Fn+gBEACx0bUS0RsvbUnZHCjU+xlAj2X2o0V+aL+0kb4GBMthEDVKcRN6
a4h7cEtaRj2ReJ/xGIYJDr8dBsU+V1xQ3hENxah7PRs3ia3ptzuWu1ahhJ7JnTB9
+y7/osKfKoFZtcM02m+H8UcNtGt8qcWzZsbvUAMuY5JJ3CBpU6Rm9/TFrTCRH6jt
pNL30VkiBdOeeHPvcXiPHvl4FO6W0L+RCr1Ep/ZgJ3CtSqqhuL9wTZZiughqiN5U
UkF2c2dqAYd6LBOtucBGMcScBbgBKNeXrTy0/eprvCrkKEU9iEuf6+bNZRx49Dwn
ccsxM6qjd/JnBsqIbFCb4LSFnIvmSE2Jw90VslzlepWaPbeaRlFsIZr+D/QRH2MS
wfwlGTKbfIV6hoXUEc+BEA+ciUvuhp3jW7pSTiADhF3XdrGt900M8QBugxi9rqev
iq0JmYS16mGQ5C6En8b8dKX3cqyu3iTwbnEkfNuvkWtckOy54C1Hx4baXDR6C05+
8aKpiMRWNP5lUYDFmfG25n+ndL+LC+680nLVbGfjQ30aG1VQMetZSe3Gybjbxnv5
zMnGVdcsXHEeR6qtRCt2gLnK12on48tCKrodIdfgBq1RZUWEZ9bO/tJtRRzEj2wH
PS57OWBPcEWyfLN4rsQwK+tNAtnXDHDzJGhNDdH5GHT3rYDNwB9JmlmuFwARAQAB
tBtUb20gVHJvbWV5IDx0b21AdHJvbWV5LmNvbT6JAk4EEwEIADgWIQTp/orpUMsH
9b6y6AUDanUwnTPltQUCXUWf6AIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAK
CRADanUwnTPltdEvD/wNWkGnGu/KhPkqeonBLN/y9VhWYifd2971dFvm85Lc4Eqh
N9w5pMPyyLA1ThJwBy53bXbaicGec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source-highlight.spec Normal file
View File

@ -0,0 +1,197 @@
#
# spec file for package source-highlight
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define soname 4
Name: source-highlight
Version: 3.1.9
Release: 0
Summary: Source Code Highlighter with Support for Many Languages
License: GPL-3.0-only
Group: Productivity/Publishing/Other
URL: https://www.gnu.org/software/src-highlite
Source0: https://ftp.gnu.org/gnu/src-highlite/source-highlight-%{version}.tar.gz
Source1: https://ftp.gnu.org/gnu/src-highlite/source-highlight-%{version}.tar.gz.sig
Source2: %{name}.keyring
Source3: baselibs.conf
Source4: source-highlight-apache2.conf
Patch0: source-highlight-doxygen_disable_timestamp_in_footer.patch
# PATCH-FIX-OPENSUSE use-lessopen.patch boo#1016309 fcrozat@suse.com -- use lessopen, not lesspipe
Patch1: use-lessopen.patch
# PATCH-FIX-UPSTREAM
Patch2: 0001-Remove-throw-specifications.patch
BuildRequires: bison
BuildRequires: ctags
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: flex
BuildRequires: gcc-c++
BuildRequires: graphviz-gd
BuildRequires: help2man
BuildRequires: libboost_regex-devel
BuildRequires: libicu-devel
BuildRequires: libstdc++-devel
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: texinfo
Requires(post): %{install_info_prereq}
Requires(preun): %{install_info_prereq}
%description
Source-highlight reads source language specifications dynamically, thus it can
be easily extended (without recompiling the sources) for handling new
languages. It also reads output format specifications dynamically, and thus it
can be easily extended (without recompiling the sources) for handling new
output formats. The syntax for these specifications is quite easy (take a look
at the manual).
%package -n libsource-highlight%{soname}
Summary: Source Code Highlighting C++ Library
Group: System/Libraries
# libsource-highlight is only used by gdb, which does not use the ctags
# feature. Use a recommendation instead of a hard requirement, bsc#1193401
Recommends: ctags
%description -n libsource-highlight%{soname}
Source-highlight reads source language specifications dynamically, thus it can
be easily extended (without recompiling the sources) for handling new
languages. It also reads output format specifications dynamically, and thus it
can be easily extended (without recompiling the sources) for handling new
output formats. The syntax for these specifications is quite easy (take a look
at the manual).
libsource-highlight is a C++ library that provides the features of
Source-highlight.
%package -n libsource-highlight-devel
Summary: Source Code Highlighting C++ Library
Group: Development/Libraries/C and C++
Requires: libsource-highlight%{soname} = %{version}-%{release}
Requires(post): %{install_info_prereq}
Requires(preun): %{install_info_prereq}
%description -n libsource-highlight-devel
Source-highlight reads source language specifications dynamically, thus it can
be easily extended (without recompiling the sources) for handling new
languages. It also reads output format specifications dynamically, and thus it
can be easily extended (without recompiling the sources) for handling new
output formats. The syntax for these specifications is quite easy (take a look
at the manual).
libsource-highlight is a C++ library that provides the features of
Source-highlight.
%package cgi
Summary: Source Code Highlighting CGI
Group: Productivity/Networking/Web/Utilities
Requires: apache2
%description cgi
Source-highlight reads source language specifications dynamically, thus it can
be easily extended (without recompiling the sources) for handling new
languages. It also reads output format specifications dynamically, and thus it
can be easily extended (without recompiling the sources) for handling new
output formats. The syntax for these specifications is quite easy (take a look
at the manual).
This package contains a CGI that can be used to highlight source code on
your webserver using source-highlight.
%prep
%autosetup -p1
sed -i 's/\r//g' doc/*.css
%build
BOOST_REGEX=$(/bin/ls -1 "%{_libdir}"/libboost_regex*mt*.so 2>/dev/null | head -1)
[ -n "$BOOST_REGEX" ] || BOOST_REGEX=$(/bin/ls -1 "%{_libdir}"/libboost_regex*.so 2>/dev/null | head -1)
if [ -n "$BOOST_REGEX" ]; then
BOOST_REGEX="${BOOST_REGEX##*/lib}"
BOOST_REGEX="${BOOST_REGEX%.so}"
BOOST_REGEX_PARAM="--with-boost-regex=${BOOST_REGEX}"
else
BOOST_REGEX_PARAM=""
fi
%configure \
"$BOOST_REGEX_PARAM" \
--with-bash-completion="%{_sysconfdir}/bash_completion.d" \
--with-doxygen \
--enable-static=no
%make_build
%make_build -C src source-highlight-cgi
%install
%make_install
install -d "%{buildroot}/srv/source-highlight"
libtool --mode=install install -m 0755 src/source-highlight-cgi "%{buildroot}/srv/source-highlight/source-highlight.cgi"
install -D -m0644 "%{SOURCE4}" "%{buildroot}%{_sysconfdir}/apache2/conf.d/%{name}.conf"
find %{buildroot} -type f -name "*.la" -delete -print
rm -rf "%{buildroot}%{_docdir}/%{name}/html"
rm -rf "%{buildroot}%{_datadir}/doc"
chmod 0644 AUTHORS ChangeLog COPYING CREDITS NEWS README THANKS TODO.txt
%if 0%{?suse_version} >= 1030
%fdupes -s "%{buildroot}%{_datadir}/"
%endif
%post
%install_info --info-dir="%{_infodir}" "%{_infodir}/source-highlight".info%{ext_info}
%preun
%install_info_delete --info-dir="%{_infodir}" "%{_infodir}/source-highlight".info%{ext_info}
%post -n libsource-highlight-devel
%install_info --info-dir="%{_infodir}" "%{_infodir}/source-highlight-lib".info%{ext_info}
%preun -n libsource-highlight-devel
%install_info_delete --info-dir="%{_infodir}" "%{_infodir}/source-highlight-lib".info%{ext_info}
%post -n libsource-highlight%{soname} -p /sbin/ldconfig
%postun -n libsource-highlight%{soname} -p /sbin/ldconfig
%files
%license COPYING
%doc AUTHORS ChangeLog CREDITS NEWS README THANKS TODO.txt
%config %{_sysconfdir}/bash_completion.d/source-highlight
%{_bindir}/*
%{_datadir}/source-highlight
%{_mandir}/man1/*.1%{?ext_man}
%{_infodir}/source-highlight.info%{ext_man}
%files -n libsource-highlight%{soname}
%{_libdir}/libsource-highlight.so.%{soname}
%{_libdir}/libsource-highlight.so.%{soname}.*.*
%files -n libsource-highlight-devel
%{_includedir}/srchilite
%{_libdir}/libsource-highlight.so
%{_libdir}/pkgconfig/source-highlight.pc
%{_infodir}/source-highlight-lib.info%{?ext_info}
%files cgi
%config(noreplace) %{_sysconfdir}/apache2/conf.d/source-highlight.conf
%dir %{_sysconfdir}/apache2
%dir %{_sysconfdir}/apache2/conf.d
%dir /srv/source-highlight
/srv/source-highlight/source-highlight.cgi
%changelog

13
use-lessopen.patch Normal file
View File

@ -0,0 +1,13 @@
Index: source-highlight-3.1.8/src/src-hilite-lesspipe.sh.in
===================================================================
--- source-highlight-3.1.8.orig/src/src-hilite-lesspipe.sh.in 2015-03-28 17:24:29.000000000 +0100
+++ source-highlight-3.1.8/src/src-hilite-lesspipe.sh.in 2016-03-07 10:30:18.229292034 +0100
@@ -7,7 +7,7 @@
*Makefile|*makefile)
source-highlight --failsafe -f esc --lang-def=makefile.lang --style-file=esc.style -i "$source" ;;
*.tar|*.tgz|*.gz|*.bz2|*.xz)
- lesspipe "$source" ;;
+ lessopen.sh "$source" ;;
*) source-highlight --failsafe --infer-lang -f esc --style-file=esc.style -i "$source" ;;
esac
done