File xmlmind-assembly.spec of Package xmlmind-assembly

#
# spec file for package assembly
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


%define _version   1_3_3 
%define _name      assembly
#
Name:           xmlmind-assembly
Version:        1.3.3
Release:        0
Summary:        DocBook Assembly Processor
License:        MIT
Group:          Development/Libraries/Java
URL:            http://www.xmlmind.com/xmleditor/assembly.shtml
Source0:        %{_name}-%{_version}.zip
Source1:        %{_name}.xml
BuildRequires:  ant
BuildRequires:  docbook5-xsl-stylesheets
BuildRequires:  java-devel >= 1.6
BuildRequires:  javapackages-tools
BuildRequires:  unzip
Requires:       java >= 1.6
Requires:       saxon9
# xml-commons-resolver
Requires:       xerces-j2-xml-resolver
BuildArch:      noarch

%description
XMLmind Assembly Processor is a Java™ software component and
a command-line utility (called assembly) which processes a
DocBook v5.1 assembly and all the referenced topics in order
to create the equivalent “flat”, monolithic, document (e.g.
a DocBook v5.1 book). This equivalent document is called
the realized document.

The realized document is then transformed to other formats
(PDF, HTML, etc), normally, as if it were created by hand,
using the DocBook XSL stylesheets.

XMLmind Assembly Processor includes XInclude 1.1 and DocBook
Transclusion processors, which allows to create modular
DocBook v5.1 documents without facing limitations.


%package doc
Summary:        RELAX NG validator in Java
%description doc
Documentation for XMLmind Assembly Processor



%prep
%setup -q -n %{_name}-%{_version}
cp %{S:1} .


%build
pushd src
%{ant}
popd

# Building manpage:
DB=/usr/share/xml/docbook/stylesheet/nwalsh5/current/
xsltproc $DB/manpages/docbook.xsl %{_name}.xml
xsltproc --output %{_name}.html $DB/xhtml/docbook.xsl %{_name}.xml


%install
mkdir -p %{buildroot}%{_javadir} %{buildroot}%{_mandir}/man1/ \
         %{buildroot}%{_defaultdocdir}/%{name}

install -m644 %{_name}.1 %{buildroot}%{_mandir}/man1/
install -m644 lib/%{_name}.jar %{buildroot}%{_javadir}

cp -a doc/* %{buildroot}%{_defaultdocdir}/%{name}


# $1 main class
# $2 flags
# $3 options
# $4 jars (separated by ':')
# $5 the name of the script you wish to create
# $6 weather to prefer a jre over a sdk when finishing a jvm
# HINT: Don't introduce linebreaks as this will break the jpackage_script macro!
FLAGS="-Djava.awt.headless=true -Dxml.catalog.files=\$XML_CATALOG_FILES"
%jpackage_script com.xmlmind.assembly.Processor "$FLAGS" "" assembly:xerces-j2-xml-resolver:saxon9 assembly ""


%files
%doc %{_name}.html
%license legal/MIT-LICENSE.txt
%{_javadir}/%{_name}.jar
%{_bindir}/*
%{_mandir}/man1/%{_name}.1%{ext_man}
%exclude %{_defaultdocdir}/%{name}/api/
%exclude %{_defaultdocdir}/%{name}/manual/
%exclude %{_defaultdocdir}/%{name}/resources/
%exclude %{_defaultdocdir}/%{name}/index.html


%files doc
%{_defaultdocdir}/%{name}/*
%exclude  %{_defaultdocdir}/%{name}/assembly.html

%changelog
openSUSE Build Service is sponsored by