Name:      rasqal
Summary:   RDF Query Library
Version:   0.9.32
Release:   1%{?_dist_release}

Group:     System Environment/Libraries
License:   LGPLv2+ or ASL 2.0
URL:       http://librdf.org/rasqal/

Source:    http://download.librdf.org/source/%{name}-%{version}.tar.gz

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: libxml2-devel
BuildRequires: mpfr-devel
BuildRequires: libuuid-devel
BuildRequires: libgcrypt-devel
BuildRequires: raptor2-devel >= 2.0.7

%description
Rasqal is a free software / Open Source C library that handles Resource
Description Framework (RDF) query language syntaxes, query construction
and execution of queries returning results as bindings, boolean, RDF
graphs/triples or syntaxes. The supported query languages are SPARQL
Query 1.0, SPARQL Query 1.1, SPARQL Update 1.1 (no executing) and the
Experimental SPARQL extensions (LAQRS). Rasqal can write binding query
results in the SPARQL XML, SPARQL JSON, CSV, TSV, HTML, ASCII tables,
RDF/XML and Turtle / N3 and read them in SPARQL XML, CSV, TSV, RDF/XML
and Turtle / N3.


%package devel
Summary: Libraries, includes etc to develop with the Rasqal RDF query library
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: raptor2-devel >= 2.0.7

%description devel
Libraries, includes etc to develop with the Rasqal RDF query language library.

%prep
%setup -q

# hack to nuke rpaths
%if "%{_libdir}" != "/usr/lib"
sed -i -e 's|"/lib /usr/lib|"/%{_lib} %{_libdir}|' configure
%endif

%build
%configure --enable-release --enable-silent-rules --disable-static

make %{?_smp_mflags}

%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

make install DESTDIR=$RPM_BUILD_ROOT

# unpackaged files
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la

%check
if [ -x %{_bindir}/rapper ]; then
%ifarch ppc64 s390x
make -k check ||:
%else
make -k check
%endif
else
echo "WARNING: %{_bindir}/rapper not present in buildroot, 'make check' skipped"
fi

%clean
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-, root, root)
%doc AUTHORS COPYING COPYING.LIB ChangeLog LICENSE.txt NEWS README
%doc LICENSE-2.0.txt NOTICE
%doc *.html
%{_libdir}/librasqal*.so.*
%{_bindir}/roqet
%{_mandir}/man1/roqet.1*
%{_mandir}/man3/librasqal.3*

%files devel
%defattr(-, root, root)
%doc docs/README.html
%{_bindir}/rasqal-config
%{_libdir}/librasqal*.so
%{_libdir}/pkgconfig/rasqal.pc
%{_includedir}/*
%{_mandir}/man1/rasqal-config.1*
%doc %{_datadir}/gtk-doc/html


%changelog
* Fri Sep 12 2014 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.9.32-1
- new upstream release

* Wed Jun 05 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9.30-1
- new upstream release

* Sun Jul 29 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9.29-1
- new upstream release

* Sun Nov 20 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.9.28-1
- new upstream release

* Fri Nov 04 2011 NAKAMURA Kenta <kenta@vinelinux.org> 0.9.26-2
- rebuilt with mpfr-3.1.0

* Thu Aug 18 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.9.26-1
- new upstream release

* Mon Sep 20 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.9.20-1
- new upstream release
- rebuilt with rpm-4.8.1

* Sun Mar 14 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.9.19-1
- new upstream release

* Sat Feb  6 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.9.17-1
- new upstream release
- built with new toolchain

* Wed Aug 26 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.9.16-1
- new upstream release

* Sat Mar 29 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 0.9.15-1
- fix release
- drop .a

* Thu Feb 21 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 0.9.15-0vl2
- drop .la

* Wed Dec 12 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 0.9.15-0vl1
- new upstream release

* Fri May 18 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 0.9.14-0vl1
- initial release for VineSeed

* Thu Aug 11 2005  Dave Beckett <dave.beckett@bristol.ac.uk>
- Update Source:
- Use %%makeinstall

* Wed Aug 10 2005  Dave Beckett <dave.beckett@bristol.ac.uk>
- Use %%configure.

* Thu Jul 28 2005  Dave Beckett <dave.beckett@bristol.ac.uk>
- Updated for gtk-doc locations

* Fri Oct 22 2004 <Dave.Beckett@bristol.ac.uk>
- License now LGPL/Apache 2
- Added LICENSE-2.0.txt and NOTICE

* Wed May 5 2004 <Dave.Beckett@bristol.ac.uk>
- Ship roqet and roqet.1

* Sat May 1 2004 <Dave.Beckett@bristol.ac.uk>
- Requires raptor 1.3.0

* Tue Feb 24 2004 <Dave.Beckett@bristol.ac.uk>
- Requires raptor

* Mon Aug 11 2003 <Dave.Beckett@bristol.ac.uk>
- Initial packaging
