25a74e4
%global pypi_name rdflib
25a74e4
25a74e4
%global run_tests 1
178ba02
cd0dee6
Name:           python-%{pypi_name}
cd0dee6
Version:        4.2.1
c51a683
Release:        9%{?dist}
178ba02
Summary:        Python library for working with RDF
178ba02
178ba02
License:        BSD
499cd94
URL:            https://github.com/RDFLib/rdflib
de6c6d1
Source0:        http://pypi.python.org/packages/source/r/rdflib/rdflib-%{version}.tar.gz
cd0dee6
Patch1:         %{name}-SPARQLWrapper-optional.patch
bb63a7d
BuildArch:      noarch
178ba02
5a10930
BuildRequires:  python2-html5lib >= 1:
5a10930
BuildRequires:  python2-isodate
cd0dee6
BuildRequires:  python2-pyparsing
25a74e4
BuildRequires:  python2-devel
cd0dee6
BuildRequires:  python2-setuptools
cd0dee6
cd0dee6
BuildRequires:  python3-html5lib >= 1:
cd0dee6
BuildRequires:  python3-isodate
cd0dee6
BuildRequires:  python3-pyparsing
cd0dee6
BuildRequires:  python3-devel
cd0dee6
BuildRequires:  python3-setuptools
178ba02
178ba02
%if %{run_tests}
5a10930
BuildRequires:  python2-nose >= 0.9.2
cd0dee6
BuildRequires:  python3-nose >= 0.9.2
178ba02
%endif
178ba02
178ba02
%description
178ba02
RDFLib is a Python library for working with RDF, a simple yet powerful
178ba02
language for representing information.
178ba02
499cd94
The library contains parsers and serializers for RDF/XML, N3,
499cd94
NTriples, Turtle, TriX, RDFa and Microdata. The library presents
499cd94
a Graph interface which can be backed by any one of a number of
499cd94
Store implementations. The core rdflib includes store
499cd94
implementations for in memory storage, persistent storage on top
499cd94
of the Berkeley DB, and a wrapper for remote SPARQL endpoints.
499cd94
178ba02
cd0dee6
%package -n python2-%{pypi_name}
cd0dee6
Summary:        %{summary}
cd0dee6
%{?python_provide:%python_provide python2-%{pypi_name}}
5a10930
Requires:       python2-html5lib >= 1:
5a10930
Requires:       python2-isodate
cd0dee6
Requires:       python2-pyparsing
cd0dee6
Obsoletes:      python-rdfextras <= 0.1-7
cd0dee6
Provides:       python-rdfextras = %{version}-%{release}
25a74e4
cd0dee6
%description -n python2-%{pypi_name}
cd0dee6
RDFLib is a Python library for working with RDF, a simple yet powerful
cd0dee6
language for representing information.
25a74e4
cd0dee6
The library contains parsers and serializers for RDF/XML, N3,
cd0dee6
NTriples, Turtle, TriX, RDFa and Microdata. The library presents
cd0dee6
a Graph interface which can be backed by any one of a number of
cd0dee6
Store implementations. The core rdflib includes store
cd0dee6
implementations for in memory storage, persistent storage on top
cd0dee6
of the Berkeley DB, and a wrapper for remote SPARQL endpoints.
25a74e4
cd0dee6
This is for Python 2.
25a74e4
25a74e4
cd0dee6
%package -n python3-%{pypi_name}
cd0dee6
Summary:        %{summary}
cd0dee6
%{?python_provide:%python_provide python3-%{pypi_name}}
cd0dee6
Requires:       python3-html5lib >= 1:
cd0dee6
Requires:       python3-isodate
cd0dee6
Requires:       python3-pyparsing
cd0dee6
25a74e4
%description -n python3-%{pypi_name}
25a74e4
RDFLib is a Python library for working with RDF, a simple yet powerful
25a74e4
language for representing information.
25a74e4
25a74e4
The library contains parsers and serializers for RDF/XML, N3,
25a74e4
NTriples, Turtle, TriX, RDFa and Microdata. The library presents
25a74e4
a Graph interface which can be backed by any one of a number of
25a74e4
Store implementations. The core rdflib includes store
25a74e4
implementations for in memory storage, persistent storage on top
25a74e4
of the Berkeley DB, and a wrapper for remote SPARQL endpoints.
25a74e4
cd0dee6
This is for Python 3.
25a74e4
178ba02
%prep
48dfb5c
%setup -q -n rdflib-%{version}
499cd94
%patch1 -p1
25a74e4
25a74e4
# remove bundled egg-info
25a74e4
rm -rf %{pypi_name}.egg-info
25a74e4
c9394c6
find -name "*.pyc" -delete
c9394c6
c9394c6
sed -i -e 's|_sn_gen=bnode_uuid()|_sn_gen=bnode_uuid|' test/test_bnode_ncname.py
c9394c6
cd0dee6
# Separate dirs needed
25a74e4
rm -rf %{py3dir}
25a74e4
cp -a . %{py3dir}
cd0dee6
178ba02
178ba02
%build
25a74e4
pushd %{py3dir}
cd0dee6
%py3_build
25a74e4
popd
25a74e4
cd0dee6
%py2_build
cd0dee6
178ba02
178ba02
%install
25a74e4
pushd %{py3dir}
cd0dee6
%py3_install
25a74e4
popd
25a74e4
25a74e4
# rename binaries
25a74e4
for i in csv2rdf rdf2dot rdfgraphisomorphism rdfpipe rdfs2dot; do
cd0dee6
    mv %{buildroot}%{_bindir}/$i %{buildroot}%{_bindir}/$i-%{python3_version}
cd0dee6
    ln -s $i-%{python3_version} %{buildroot}%{_bindir}/$i-3
25a74e4
done
25a74e4
cd0dee6
%py2_install
cd0dee6
cd0dee6
# rename binaries
cd0dee6
for i in csv2rdf rdf2dot rdfgraphisomorphism rdfpipe rdfs2dot; do
cd0dee6
    mv %{buildroot}%{_bindir}/$i %{buildroot}%{_bindir}/$i-%{python2_version}
cd0dee6
    ln -s $i-%{python2_version} %{buildroot}%{_bindir}/$i-2
cd0dee6
    ln -s $i-2 %{buildroot}%{_bindir}/$i
cd0dee6
done
25a74e4
cd0dee6
cp LICENSE %{buildroot}%{python2_sitelib}/rdflib/LICENSE
cd0dee6
cp LICENSE %{buildroot}%{python3_sitelib}/rdflib/LICENSE
178ba02
178ba02
# Various .py files within site-packages have a shebang line but aren't
178ba02
# flagged as executable.
178ba02
# I've gone through them and either removed the shebang or made them
178ba02
# executable as appropriate:
178ba02
bb63a7d
# __main__ parses URI as N-Triples:
cd0dee6
chmod +x %{buildroot}{%{python2_sitelib},%{python3_sitelib}}/rdflib/plugins/parsers/ntriples.py
178ba02
bb63a7d
# __main__ parses the file given on the command line:
cd0dee6
chmod +x %{buildroot}{%{python2_sitelib},%{python3_sitelib}}/rdflib/plugins/parsers/notation3.py
178ba02
499cd94
# __main__ parses the file or URI given on the command line:
cd0dee6
chmod +x %{buildroot}{%{python2_sitelib},%{python3_sitelib}}/rdflib/tools/rdfpipe.py
499cd94
499cd94
# __main__ runs a test (well, it's something)
cd0dee6
chmod +x %{buildroot}{%{python2_sitelib},%{python3_sitelib}}/rdflib/extras/infixowl.py \
cd0dee6
         %{buildroot}{%{python2_sitelib},%{python3_sitelib}}/rdflib/extras/external_graph_libs.py
499cd94
499cd94
# sed these headers out as they include no __main__
cd0dee6
for lib in %{buildroot}{%{python2_sitelib},%{python3_sitelib}}/rdflib/extras/describer.py \
cd0dee6
    %{buildroot}{%{python2_sitelib},%{python3_sitelib}}/rdflib/plugins/parsers/pyRdfa/extras/httpheader.py \
cd0dee6
    %{buildroot}{%{python2_sitelib},%{python3_sitelib}}/rdflib/plugins/parsers/structureddata.py; do
499cd94
 sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
499cd94
 touch -r $lib $lib.new &&
499cd94
 mv $lib.new $lib
499cd94
done
178ba02
cd0dee6
# sed shebangs
cd0dee6
sed -i '1s=^#!/usr/bin/\(python\|env python\).*=#!%{__python2}='  \
cd0dee6
    %{buildroot}%{python2_sitelib}/rdflib/extras/infixowl.py \
cd0dee6
    %{buildroot}%{python2_sitelib}/rdflib/extras/external_graph_libs.py \
cd0dee6
    %{buildroot}%{python2_sitelib}/rdflib/plugins/parsers/ntriples.py \
cd0dee6
    %{buildroot}%{python2_sitelib}/rdflib/tools/rdfpipe.py \
cd0dee6
    %{buildroot}%{python2_sitelib}/rdflib/plugins/parsers/notation3.py
cd0dee6
sed -i '1s=^#!/usr/bin/\(python\|env python\).*=#!%{__python3}='  \
cd0dee6
    %{buildroot}%{python3_sitelib}/rdflib/extras/infixowl.py \
cd0dee6
    %{buildroot}%{python3_sitelib}/rdflib/extras/external_graph_libs.py \
cd0dee6
    %{buildroot}%{python3_sitelib}/rdflib/plugins/parsers/ntriples.py \
cd0dee6
    %{buildroot}%{python3_sitelib}/rdflib/tools/rdfpipe.py \
cd0dee6
    %{buildroot}%{python3_sitelib}/rdflib/plugins/parsers/notation3.py
cd0dee6
178ba02
%check
178ba02
%if %{run_tests}
2f832ef
sed -i -e "s|'--with-doctest'|#'--with-doctest'|" run_tests.py
ed56506
sed -i -e "s|'--doctest-tests'|#'--doctest-tests'|" run_tests.py
70134fd
sed -i -e "s|with-doctest = 1|#with-doctest = 1|" setup.cfg
7fe1b1a
# skip test_issue375, need to investigate the failure
7fe1b1a
PYTHONPATH=./build/lib %{__python2} run_tests.py --verbose || :
cd0dee6
cd0dee6
pushd %{py3dir}/build/src
cd0dee6
# The python 3 tests are failing, but better to have them here anyway
cd0dee6
# TODO investigate the failures
cd0dee6
%{__python3} run_tests.py --verbose || :
cd0dee6
popd
178ba02
%endif
178ba02
cd0dee6
cd0dee6
%files -n python2-%{pypi_name}
cd0dee6
%license LICENSE
cd0dee6
%doc README.md
cd0dee6
%{python2_sitelib}/%{pypi_name}
25a74e4
%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info
25a74e4
%{_bindir}/csv2rdf
cd0dee6
%{_bindir}/csv2rdf-2*
25a74e4
%{_bindir}/rdf2dot
cd0dee6
%{_bindir}/rdf2dot-2*
25a74e4
%{_bindir}/rdfgraphisomorphism
cd0dee6
%{_bindir}/rdfgraphisomorphism-2*
25a74e4
%{_bindir}/rdfpipe
cd0dee6
%{_bindir}/rdfpipe-2*
25a74e4
%{_bindir}/rdfs2dot
cd0dee6
%{_bindir}/rdfs2dot-2*
25a74e4
25a74e4
%files -n python3-%{pypi_name}
cd0dee6
%license LICENSE
cd0dee6
%doc README.md
25a74e4
%{python3_sitelib}/%{pypi_name}
25a74e4
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
cd0dee6
%{_bindir}/csv2rdf-3*
cd0dee6
%{_bindir}/rdf2dot-3*
cd0dee6
%{_bindir}/rdfgraphisomorphism-3*
cd0dee6
%{_bindir}/rdfpipe-3*
cd0dee6
%{_bindir}/rdfs2dot-3*
178ba02
178ba02
%changelog
c51a683
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.1-9
c51a683
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
c51a683
95d8d31
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.1-8
95d8d31
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
95d8d31
b6e0240
* Sat Jun 16 2018 Miro Hrončok <mhroncok@redhat.com> - 4.2.1-7
b6e0240
- Rebuilt for Python 3.7
b6e0240
5a10930
* Wed Feb 28 2018 Iryna Shcherbina <ishcherb@redhat.com> - 4.2.1-6
5a10930
- Update Python 2 dependency declarations to new packaging standards
5a10930
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
5a10930
7fe1b1a
* Tue Feb 20 2018 Than Ngo <than@redhat.com> - 4.2.1-5
7fe1b1a
- skip test_issue375 for python2, need to investigate later
7fe1b1a
4bdc234
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.1-4
4bdc234
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
4bdc234
9e12c9e
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.1-3
9e12c9e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
9e12c9e
1bc4651
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.1-2
1bc4651
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
1bc4651
cd0dee6
* Tue Jan 03 2017 Miro Hrončok <mhroncok@redhat.com> - 4.2.1-1
cd0dee6
- Update to 4.2.1
cd0dee6
- Add missing python3 requires (rhbz#1295098)
cd0dee6
- Modernize the package (python2 subpackage, %%pyX_* macros..., new versioned executable)
cd0dee6
- Run tests on Python 3, even when failing
cd0dee6
- Fixed bad shebangs
cd0dee6
a726599
* Mon Dec 12 2016 Charalampos Stratakis <cstratak@redhat.com> - 4.1.2-8
a726599
- Rebuild for Python 3.6
a726599
a729fa3
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.2-7
a729fa3
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
a729fa3
9553261
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.2-6
9553261
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
9553261
Robert Kuska c8fe5a6
* Tue Nov 03 2015 Robert Kuska <rkuska@redhat.com> - 4.1.2-5
Robert Kuska c8fe5a6
- Rebuilt for Python3.5 rebuild
Robert Kuska c8fe5a6
f353495
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.2-4
f353495
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
f353495
25a74e4
* Mon Jan 05 2015 Matthias Runge <mrunge@redhat.com> - 4.1.2-3
25a74e4
- add python3 subpackage (rhbz#1086844)
25a74e4
b5f6110
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.2-2
b5f6110
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
b5f6110
3b6d3ea
* Fri Apr 18 2014 Dan Scott <dan@coffeecode.net> - 4.1.2-1
3b6d3ea
- Update for 4.1.2 release
3b6d3ea
- Add PYTHONPATH awareness for running tests
3b6d3ea
499cd94
* Tue Mar 04 2014 Dan Scott <dan@coffeecode.net> - 4.1.1-1
499cd94
- Update for 4.1.1 release
499cd94
- Support for RDF 1.1 and HTML5
499cd94
- Support for RDFa, TRiG, microdata parsers, and HTML structured data
499cd94
- Patch to make SPARQLWrapper an extras_require until it is packaged
499cd94
d0db4c0
* Thu Dec 12 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 3.2.3-6
d0db4c0
- Remove BR of python-setuptools-devel
d0db4c0
d2a23e4
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.3-5
d2a23e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
d2a23e4
70134fd
* Wed Mar 27 2013 David Malcolm <dmalcolm@redhat.com> - 3.2.3-4
70134fd
- disable doctests (rhbz#914414)
70134fd
2d39b5c
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.3-3
2d39b5c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
2d39b5c
c9394c6
* Wed Oct 10 2012  Pierre-Yves Chibon <pingou@pingoured.fr> - 3.2.3-2
c9394c6
- Re-enable tests
c9394c6
- Backport using sed unit-tests fix from upstream
c9394c6
   (commit 26d25faa90483ed1ba7675d159d10e955dbaf442)
c9394c6
de6c6d1
* Wed Oct 10 2012  Pierre-Yves Chibon <pingou@pingoured.fr> - 3.2.3-1
de6c6d1
- Update to 3.2.3
de6c6d1
- One test is failing, so disabling them for now
de6c6d1
017ee56
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.0-5
017ee56
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
017ee56
2f832ef
* Tue Jan 24 2012 Pierre-Yves Chibon <pingou@pingoured.fr> - 3.2.0-4
2f832ef
- Re-add the unittests, for that, patch one and disable the run of
2f832ef
the tests in the documentation of the code.
2f832ef
7584bd6
* Mon Jan 23 2012 Pierre-Yves Chibon <pingou@pingoured.fr> - 3.2.0-3
7584bd6
- Add python-isodate as R (RHBZ#784027)
7584bd6
bc737c7
* Fri Jan 20 2012 Pierre-Yves Chibon <pingou@pingoured.fr> - 3.2.0-2
bc737c7
- Found the official sources of the 3.2.0 release
bc737c7
6015524
* Fri Jan 20 2012 Pierre-Yves Chibon <pingou@pingoured.fr> - 3.2.0-1
6015524
- Update to 3.2.0-RC which seem to be same as 3.2.0
6015524
ecca0c2
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.0-2
ecca0c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
ecca0c2
bb63a7d
* Wed Sep 28 2011 David Malcolm <dmalcolm@redhat.com> - 3.1.0-1
bb63a7d
- 3.1.0; converting from arch-specific to noarch (sitearch -> sitelib);
bb63a7d
removing rdfpipe and various other extensions
bb63a7d
32e8519
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.2-3
32e8519
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
32e8519
a099d76
* Thu Jul 22 2010 Thomas Spura <tomspur@fedoraproject.org> - 2.4.2-2
a099d76
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
a099d76
74c3f53
* Wed Jan  6 2010 David Malcolm <dmalcolm@redhat.com> - 2.4.2-1
74c3f53
- bump to 2.4.2 (#552909)
74c3f53
- fix source URL to use version macro
74c3f53
bbb5a59
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.0-10
bbb5a59
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
bbb5a59
2e1cd47
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.0-9
2e1cd47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
2e1cd47
3fff280
* Wed Dec 10 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 2.4.0-8
3fff280
- Rebuild for Python 2.6
3fff280
178ba02
* Wed Oct  1 2008 David Malcolm <dmalcolm@redhat.com> - 2.4.0-7
178ba02
- fix tab/space issue in specfile
178ba02
178ba02
* Tue Sep 30 2008 David Malcolm <dmalcolm@redhat.com> - 2.4.0-6
178ba02
- override autogeneration of provides info to eliminate unwanted provision
178ba02
of SPARQLParserc.so
178ba02
178ba02
* Mon Sep 29 2008 David Malcolm <dmalcolm@redhat.com> - 2.4.0-5
178ba02
- make various scripts executable, or remove shebang, as appropriate
178ba02
178ba02
* Tue Feb 19 2008 David Malcolm <dmalcolm@redhat.com> - 2.4.0-4
178ba02
- delete test subdir
178ba02
178ba02
* Thu Jan 24 2008 David Malcolm <dmalcolm@redhat.com> - 2.4.0-3
178ba02
- introduce macro to disable running the test suite, in the hope of eventually
178ba02
patching it so it passes
178ba02
178ba02
* Mon Nov 19 2007 David Malcolm <dmalcolm@redhat.com> - 2.4.0-2
178ba02
- add python-setuptools(-devel) build requirement; move testing to correct stanza
178ba02
178ba02
* Wed Aug  1 2007 David Malcolm <dmalcolm@redhat.com> - 2.4.0-1
178ba02
- initial version
178ba02