Blob Blame History Raw
%bcond_without tests

%global pypi_name owlrl

%global _description %{expand:
A simple implementation of the OWL2 RL Profile, as well as a basic RDFS
inference, on top of RDFLib. Based mechanical forward chaining. The
distribution contains:

* scripts/RDFConvertService: can be used as a CGI script to invoke the
library. It may have to be adapted to the local server setup.
* scripts/owlrl: script that can be run locally on to transform a file into RDF
(on the standard output). Run the script with -h to get the available flags.}

Name:           python-owl_rl
Version:        5.2.3
Release:        1%{?dist}
Summary:        OWL-RL and RDFS based RDF Closure inferencing for Python

License:        W3C

BuildArch:      noarch

%description %_description

%package -n python3-owl_rl
Summary:        %{summary}
BuildRequires:  python3-devel
BuildRequires:  %{py3_dist setuptools}
BuildRequires:  %{py3_dist rdflib}
# Remove rdflib-jsonld from deps when rdflib >= 6.0.0 comes
BuildRequires:  %{py3_dist rdflib-jsonld}

Requires:       %{py3_dist rdflib-jsonld}

%if %{with tests}
BuildRequires:  %{py3_dist pytest}
BuildRequires:  %{py3_dist lxml}
BuildRequires:  %{py3_dist pyyaml}

%py_provides python3-owl_rl
Obsoletes:		python3-owlrl <= 5.2.1-3

%description -n python3-owl_rl %_description

%package doc
Summary:        %{summary}

BuildRequires:  %{py3_dist sphinx}
BuildRequires:  %{py3_dist sphinx_rtd_theme}

%description doc %_description

%autosetup -n OWL-RL-%{version}
rm -rf %{pypi_name}.egg-info
find . -type f -name "*.py" -exec sed -i '/^#![  ]*\/usr\/bin\/env.*$/ d' {} 2>/dev/null ';'

# Remove unnecessary shebang from the file
sed -i '1d' owlrl/

# Remove pathlib from install_requires from
sed -i -e 's/, "pathlib"//g'


# Build documentation
pushd docs
PYTHONPATH=. sphinx-build-3 source html
rm -rvf html/.buildinfo
rm -rvf html/.doctrees


%if %{with tests}
# test_version_converter needs an internet connection, therefore disabled
%pytest -k 'not cls_maxqc1' \
    --deselect test/

%files -n python3-owl_rl
%doc README.rst
%license LICENSE.txt

%files doc
%license LICENSE.txt
%doc docs/html

* Sun Oct 24 2021 Aniket Pradhan <major AT fedoraproject DOT org> - 5.2.3-1
- Update to v5.2.3
- Mention rdflib-jsonld as an explicit requirement because the current version of rdflib is < 6

* Fri Jul 23 2021 Fedora Release Engineering <> - 5.2.1-6
- Rebuilt for

* Thu Jun 17 2021 Aniket Pradhan <major AT fedoraproject DOT org> - 5.2.1-5
- Fix Obsoletes version

* Thu Jun 17 2021 Aniket Pradhan <major AT fedoraproject DOT org> - 5.2.1-4
- Fix subpackage name

* Fri Jun 04 2021 Python Maint <> - 5.2.1-3
- Rebuilt for Python 3.10

* Wed May 26 2021 Aniket Pradhan <major AT fedoraproject DOT org> - 5.2.1-2
- Fix description

* Mon May 10 2021 Aniket Pradhan <major AT fedoraproject DOT org> - 5.2.1-1
- Initial build