forked from pool/python-rdflib
Use same package decl for doc multibuild
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-rdflib?expand=0&rev=67
This commit is contained in:
parent
8f3b4c15ad
commit
b9b69e8fb0
@ -19,19 +19,41 @@
|
|||||||
%global flavor @BUILD_FLAVOR@%{nil}
|
%global flavor @BUILD_FLAVOR@%{nil}
|
||||||
%if "%{flavor}" == "doc"
|
%if "%{flavor}" == "doc"
|
||||||
%bcond_without doc
|
%bcond_without doc
|
||||||
|
%define psuffix -doc
|
||||||
%else
|
%else
|
||||||
%bcond_with doc
|
%bcond_with doc
|
||||||
|
%define psuffix %{nil}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Tests don't work and cause a dependency loop with python-SPARQLWrapper
|
# Tests don't work and cause a dependency loop with python-SPARQLWrapper
|
||||||
%bcond_with tests
|
%bcond_with tests
|
||||||
Name: python-rdflib
|
Name: python-rdflib%{psuffix}
|
||||||
Version: 7.0.0
|
Version: 7.0.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: A Python library for working with RDF
|
Summary: A Python library for working with RDF
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
URL: http://rdflib.net/
|
URL: http://rdflib.net/
|
||||||
Source: https://files.pythonhosted.org/packages/source/r/rdflib/rdflib-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/r/rdflib/rdflib-%{version}.tar.gz
|
||||||
|
BuildRequires: fdupes
|
||||||
|
BuildRequires: python-rpm-macros
|
||||||
|
Requires(post): update-alternatives
|
||||||
|
Requires(postun): update-alternatives
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%if %{with tests}
|
||||||
|
BuildRequires: %{python_module SPARQLWrapper}
|
||||||
|
BuildRequires: %{python_module flake8}
|
||||||
|
BuildRequires: %{python_module pytest}
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{with doc}
|
||||||
|
BuildRequires: %{python_module rdflib = %{version}}
|
||||||
|
BuildRequires: python3-Sphinx
|
||||||
|
BuildRequires: python3-myst-parser
|
||||||
|
BuildRequires: python3-sphinx-autodoc-typehints
|
||||||
|
BuildRequires: python3-sphinxcontrib-apidoc
|
||||||
|
Provides: %{python_module rdflib-doc = %{version}}
|
||||||
|
%else
|
||||||
BuildRequires: %{python_module base >= 3.8}
|
BuildRequires: %{python_module base >= 3.8}
|
||||||
BuildRequires: %{python_module html5lib}
|
BuildRequires: %{python_module html5lib}
|
||||||
BuildRequires: %{python_module isodate}
|
BuildRequires: %{python_module isodate}
|
||||||
@ -40,26 +62,11 @@ BuildRequires: %{python_module poetry-core}
|
|||||||
BuildRequires: %{python_module pyparsing}
|
BuildRequires: %{python_module pyparsing}
|
||||||
BuildRequires: %{python_module wheel}
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: %{python_module xml}
|
BuildRequires: %{python_module xml}
|
||||||
BuildRequires: fdupes
|
|
||||||
BuildRequires: python-rpm-macros
|
|
||||||
BuildRequires: python3-Sphinx
|
|
||||||
BuildRequires: python3-myst-parser
|
|
||||||
BuildRequires: python3-sphinxcontrib-apidoc
|
|
||||||
Requires: python-html5lib
|
Requires: python-html5lib
|
||||||
Requires: python-isodate
|
Requires: python-isodate
|
||||||
Requires: python-pyparsing
|
Requires: python-pyparsing
|
||||||
Requires(post): update-alternatives
|
|
||||||
Requires(postun): update-alternatives
|
|
||||||
BuildArch: noarch
|
|
||||||
%if %{with tests}
|
|
||||||
BuildRequires: %{python_module SPARQLWrapper}
|
|
||||||
BuildRequires: %{python_module flake8}
|
|
||||||
BuildRequires: %{python_module pytest}
|
|
||||||
%endif
|
|
||||||
%if %{with doc}
|
|
||||||
BuildRequires: python3-sphinx-autodoc-typehints
|
|
||||||
%endif
|
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
RDFLib is a Python library for working with RDF, a simple yet powerful
|
RDFLib is a Python library for working with RDF, a simple yet powerful
|
||||||
@ -67,21 +74,11 @@ language for representing information. The library contains an RDF/XML
|
|||||||
parser/serializer that conforms to the RDF/XML Syntax Specification (Revised).
|
parser/serializer that conforms to the RDF/XML Syntax Specification (Revised).
|
||||||
The library also contains both in-memory and persistent Graph backends.
|
The library also contains both in-memory and persistent Graph backends.
|
||||||
|
|
||||||
%package -n %{name}-doc
|
|
||||||
Summary: A Python library for working with RDF
|
|
||||||
Provides: %{python_module rdflib-doc = %{version}}
|
|
||||||
BuildRequires: %{python_module rdflib = %{version}}
|
|
||||||
|
|
||||||
%description -n %{name}-doc
|
|
||||||
RDFLib is a Python library for working with RDF, a simple yet powerful
|
|
||||||
language for representing information. The library contains an RDF/XML
|
|
||||||
parser/serializer that conforms to the RDF/XML Syntax Specification (Revised).
|
|
||||||
The library also contains both in-memory and persistent Graph backends.
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1 -n rdflib-%{version}
|
%autosetup -p1 -n rdflib-%{version}
|
||||||
# remove unwanted shebang
|
# remove unwanted shebang
|
||||||
find rdflib -name "*.py" | xargs sed -i '1 { /^#!/ d }'
|
find rdflib -name "*.py" | xargs sed -i '1 { /^#!/ d }'
|
||||||
|
chmod -x rdflib/plugins/parsers/notation3.py
|
||||||
|
|
||||||
%if %{without doc}
|
%if %{without doc}
|
||||||
%build
|
%build
|
||||||
@ -89,7 +86,6 @@ find rdflib -name "*.py" | xargs sed -i '1 { /^#!/ d }'
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
|
||||||
%if %{with doc}
|
%if %{with doc}
|
||||||
# Build the docs, we need the module queryable
|
# Build the docs, we need the module queryable
|
||||||
pushd docs
|
pushd docs
|
||||||
@ -115,6 +111,12 @@ popd
|
|||||||
%pytest
|
%pytest
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if %{with doc}
|
||||||
|
%files -n %{name}
|
||||||
|
%doc docs/_build/html
|
||||||
|
|
||||||
|
%else
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%python_install_alternative rdfs2dot
|
%python_install_alternative rdfs2dot
|
||||||
%python_install_alternative rdfpipe
|
%python_install_alternative rdfpipe
|
||||||
@ -129,12 +131,6 @@ popd
|
|||||||
%python_uninstall_alternative rdf2dot
|
%python_uninstall_alternative rdf2dot
|
||||||
%python_uninstall_alternative csv2rdf
|
%python_uninstall_alternative csv2rdf
|
||||||
|
|
||||||
%if %{with doc}
|
|
||||||
%files -n %{name}-doc
|
|
||||||
%doc docs/_build/html
|
|
||||||
|
|
||||||
%else
|
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README.md
|
%doc README.md
|
||||||
|
Loading…
Reference in New Issue
Block a user