178ba02
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
178ba02
178ba02
# The upstream test suite does not pass on recent versions of Fedora
178ba02
# See package review (bug 378841)
178ba02
# For now, we disable running the test suite:
178ba02
%define run_tests 0
178ba02
178ba02
Name:           python-rdflib
74c3f53
Version:        2.4.2
a099d76
Release:        2%{?dist}
178ba02
Summary:        Python library for working with RDF
178ba02
178ba02
Group:          Development/Languages
178ba02
License:        BSD
178ba02
URL:            http://rdflib.net
74c3f53
Source0:        http://rdflib.net/rdflib-%{version}.tar.gz
178ba02
178ba02
# Filter out unwanted autogenerated Provides: SPARQLParserc.so
178ba02
# See http://fedoraproject.org/wiki/PackagingDrafts/FilteringAutomaticDependencies
178ba02
Source1:        filter-provides.sh
178ba02
%define _use_internal_dependency_generator 0
178ba02
%define __find_provides %{SOURCE1}
178ba02
178ba02
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
178ba02
178ba02
BuildRequires:  python-devel
178ba02
%if 0%{?fedora} >= 8
178ba02
BuildRequires: python-setuptools-devel
178ba02
%else
178ba02
BuildRequires: python-setuptools
178ba02
%endif
178ba02
178ba02
%if %{run_tests}
178ba02
BuildRequires:  python-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
178ba02
The library contains parsers and serializers for RDF/XML, N3, NTriples,
178ba02
Turtle, TriX and RDFa. The library presents a Graph interface which can
178ba02
be backed by any one of a number of store implementations, including
178ba02
memory, MySQL, Redland, SQLite, Sleepycat, ZODB and SQLObject.
178ba02
178ba02
%prep
178ba02
%setup -q -n rdflib-%{version}
178ba02
chmod +x %{SOURCE1}
178ba02
178ba02
%build
178ba02
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
178ba02
178ba02
%install
178ba02
rm -rf $RPM_BUILD_ROOT
178ba02
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
178ba02
cp LICENSE $RPM_BUILD_ROOT/%{python_sitearch}/rdflib/LICENSE
178ba02
rm -rf $RPM_BUILD_ROOT/%{python_sitearch}/test
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
#   rdflib_tools/RDFPipe.py: __main__ parses RDF from stdin
178ba02
chmod +x $RPM_BUILD_ROOT/%{python_sitearch}/rdflib_tools/RDFPipe.py
178ba02
178ba02
#   sparql/parser.py: __main__ runs self-tests:
178ba02
chmod +x $RPM_BUILD_ROOT/%{python_sitearch}/rdflib/sparql/parser.py
178ba02
178ba02
#   syntax/parsers/n3meta.py doesn't have a meaningful __main__; drop
178ba02
#   the shebang:
178ba02
%{__sed} -i "s|#!/usr/bin/env python||" $RPM_BUILD_ROOT/%{python_sitearch}/rdflib/syntax/parsers/n3p/n3meta.py
178ba02
178ba02
#   syntax/parsers/ntriples.py: __main__ parses NTriples from a URI:
178ba02
chmod +x $RPM_BUILD_ROOT/%{python_sitearch}/rdflib/syntax/parsers/ntriples.py
178ba02
178ba02
#   syntax/parsers/n3p/n3p.py:  __main__ parses N3 from a file
178ba02
chmod +x $RPM_BUILD_ROOT/%{python_sitearch}/rdflib/syntax/parsers/n3p/n3p.py
178ba02
178ba02
#   syntax/parsers/n3p/uripath.py: __main__ runs unit tests:
178ba02
chmod +x $RPM_BUILD_ROOT/%{python_sitearch}/rdflib/syntax/parsers/n3p/uripath.py
178ba02
178ba02
#   syntax/parsers/n3p/n3proc.py: __main__ parses from a URI:
178ba02
chmod +x $RPM_BUILD_ROOT/%{python_sitearch}/rdflib/syntax/parsers/n3p/n3proc.py
178ba02
178ba02
%check
178ba02
%if %{run_tests}
178ba02
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py test
178ba02
%endif
178ba02
178ba02
%clean
178ba02
rm -rf $RPM_BUILD_ROOT
178ba02
178ba02
%files
178ba02
%defattr(-,root,root,-)
178ba02
%doc LICENSE
178ba02
%{python_sitearch}/*
178ba02
%{_bindir}/rdfpipe
178ba02
178ba02
%changelog
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