File geekodoc.spec of Package geekodoc

# spec file for package geekodoc
# 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

%bcond_without  tests

Name:           geekodoc
Release:        0
Summary:        DocBook based RNG Schema for SUSE Documentation
License:        GPL-3.0
Group:          Productivity/Publishing/DocBook
Url:  {name}-%{version}.tar.gz
Source:         %{name}-%{version}.tar.gz
BuildRequires:  docbook_5 >= 5.1
BuildRequires:  jing
BuildRequires:  libxml2-tools
BuildRequires:  make
BuildRequires:  python3-rnginline
BuildRequires:  python3-setuptools
BuildRequires:  trang
Requires:       sgml-skel >= 0.7
Requires(post): sgml-skel >= 0.7
Requires(postun): sgml-skel >= 0.7
Conflicts:      suse-xsl-stylesheets < 2.0.6
BuildArch:      noarch

GeekoDoc is a RELAX NG schema used for current SUSE documentation.

%package -n novdoc
Version:        1.0_%{version}
Release:        0
Summary:        DocBook based Schema for older SUSE Documentation
Group:          Productivity/Publishing/DocBook
Conflicts:      suse-xsl-stylesheets < 2.0.6

%description -n novdoc
NovDoc is a DTD/RELAX NG schema used for older SUSE documentation.

%setup -q

touch geekodoc/rng/geekodoc5.rnc
# GeekoDoc
make %{?_smp_mflags} VERBOSE=1 -C geekodoc/rng
make %{?_smp_mflags} VERBOSE=1 -C geekodoc/rng geekodoc5-flat.rng

# Novdoc
make %{?_smp_mflags} VERBOSE=1 -C novdoc/rng

install -d %{buildroot}%{_datadir}/xml/{geekodoc/rng,novdoc/rng} \

# Install GeekoDoc:
cp geekodoc/rng/geekodoc5-flat.rn? %{buildroot}%{_datadir}/xml/geekodoc/rng

# Install Novdoc:
cp -a novdoc/dtd %{buildroot}%{_datadir}/xml/novdoc
cp novdoc/rng/novdocxi-flat.rn? novdoc/rng/novell.ent %{buildroot}%{_datadir}/xml/novdoc/rng

# Install catalogs:
cp catalog.d/* %{buildroot}%{_sysconfdir}/xml/catalog.d/

# Fixup catalog paths
sed -i 's#"\.\./#"%{_datadir}/xml/#' %{buildroot}%{_sysconfdir}/xml/catalog.d/*



%post -n novdoc

if [ ! -f %{_sysconfdir}/xml/suse-catalog.xml -a -x %{_bindir}/edit-xml-catalog ] ; then
    # susexsl entry
    edit-xml-catalog --group --catalog %{_sysconfdir}/xml/suse-catalog.xml \
       --del suse_schemas
    edit-xml-catalog --group --catalog %{_sysconfdir}/xml/suse-catalog.xml \
       --del novdoc-1.0
exit 0

%postun -n novdoc

%if 0%{with tests}
cd geekodoc/tests
./ -V xmllint
./ -V jing

%license LICENSE ChangeLog
%config %{_sysconfdir}/xml/catalog.d/geekodoc.xml

%files -n novdoc
%license LICENSE
%config %{_sysconfdir}/xml/catalog.d/novdoc.xml

openSUSE Build Service is sponsored by