File docmanager.spec of Package docmanager

#
# spec file for package docmanager
#
# Copyright (c) 2015 SUSE LINUX Products 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/
#


# As we test our package with Travis already, disable test
# by default
%bcond_with tests

Name:           docmanager
Version:        3.3.3
Release:        0
License:        GPL-3.0
Summary:        Manage DocBook5 Meta-Information
Url:            https://github.com/openSUSE/docmanager
Group:          Applications/Productivity
Source:         %{name}-%{version}.tar.bz2
Requires:       python-lxml >= 3.3.5
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
BuildRequires:  python3
BuildRequires:  python3-devel
BuildRequires:  python3-lxml
BuildRequires:  python3-setuptools
BuildRequires:  docbook-xsl-stylesheets
BuildRequires:  libxslt-tools
BuildRequires:  python3-pytest
BuildRequires:  python-lxml
BuildRequires:  python3-PrettyTable
Requires:		python3-PrettyTable
Requires:       python-lxml
Requires:       python3-lxml
Conflicts:      daps-docmanager

%{!?python3_sitelib: %global python_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}

%description
The DocManager is a tool to manage meta-information within DocBook5 documents.
It is possible to add new information as well as editing and deleting. The main
advantage of this tool is the analyze feature. This feature creates a table with
all wanted information. You can restrict the information with a lightweight SQL syntax.

Upstream project: https://github.com/openSUSE/docmanager

%prep
%setup -q -n %{name}-%{version}

%build
python3 setup.py build
export DB="http://docbook.sourceforge.net/release/xsl/current/"
(cd man; make)
python3 setup.py build

%install
mkdir -p %{buildroot}%{_mandir}/man1 %{buildroot}%{_sysconfdir}/%{name}
cp man/build/%{name}.1 %{buildroot}%{_mandir}/man1

# Move(!) configuration file
mv -vi src/%{name}/%{name}.conf %{buildroot}%{_sysconfdir}/%{name}

python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}


%if %{with tests}
%check
python3 setup.py test -a test
%endif


%files
%defattr(-,root,root)
%{python3_sitelib}/*
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1%{ext_man}
%dir    %{_sysconfdir}/%{name}
%config %{_sysconfdir}/%{name}/%{name}.conf
%exclude %{python3_sitelib}/%{name}/%{name}.conf

%changelog
openSUSE Build Service is sponsored by