Files
xslthl/xslthl.spec

89 lines
2.7 KiB
RPMSpec

#
# spec file for package xslthl
#
# Copyright (c) 2023 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/
#
Name: xslthl
Version: 2.1.4+20230711.8aaebea
Release: 0
Summary: Java based XSLT Processor extension for syntax highlighting
License: Zlib
Group: Productivity/Publishing/XML
URL: https://github.com/xmlark/%{name}
Source0: %{name}-%{version}.tar.xz
Source1: %{name}-build.xml
BuildRequires: ant
BuildRequires: dos2unix
BuildRequires: fdupes
BuildRequires: javapackages-local >= 6
BuildRequires: saxon10
BuildRequires: xalan-j2
BuildArch: noarch
%description
This is an implementation of syntax highlighting as an extension module for
XSLT processors (Xalan, Saxon), so if you have e.g. article about programming
written in DocBook, code examples can be automatically syntax highlighted
during the XSLT processing phase.
%package javadoc
Summary: API documentation for %{name}
%description javadoc
API documentation for %{name}.
%prep
%setup -q
cp %{SOURCE1} build.xml
find \( -name \*.xml -or -name \*.xsl -or -name \*.txt -or -name \*.java \) -exec dos2unix '{}' \+
# Remove Saxon 6 support
%pom_remove_dep saxon:saxon
rm -f src/main/java/net/sf/xslthl/ConnectorSaxon6.java
# Remove Saxon [8.5,10) support
%pom_change_dep net.sf.saxon:saxon net.sf.saxon:Saxon-HE:"[10,)"
rm -f src/main/java/net/sf/xslthl/ConnectorSaxonB.java
%build
%{ant} all
%install
install -dm0755 %{buildroot}%{_javadir}/%{name}
install -pm0644 target/lib/%{name}*.jar %{buildroot}%{_javadir}/%{name}.jar
install -dm0755 %{buildroot}%{_mavenpomdir}/%{name}
%{mvn_install_pom} pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom
%add_maven_depmap %{name}.pom %{name}.jar
install -dm0755 %{buildroot}%{_datadir}/%{name}
cp -prf highlighters %{buildroot}%{_datadir}/%{name}
%fdupes -s %{buildroot}%{_datadir}/%{name}
install -dm0755 %{buildroot}%{_javadocdir}/%{name}
cp -pr target/javadoc/* %{buildroot}%{_javadocdir}/%{name}/
%fdupes -s %{buildroot}%{_javadocdir}/%{name}
%files -f .mfiles
%{_datadir}/%{name}
%doc CHANGES.txt examples
%license LICENSE.txt
%files javadoc
%license LICENSE.txt
%{_javadocdir}/%{name}
%changelog