Name:      redland
Summary:   RDF Application Framework
Version:   1.0.15
Release:   1%{?_dist_release}

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

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

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: curl-devel
BuildRequires: db4-devel
BuildRequires: libiodbc-devel
BuildRequires: libtool-ltdl-devel
BuildRequires: libxml2-devel >= 2.4.0
BuildRequires: MySQL-devel
BuildRequires: postgresql-devel
BuildRequires: raptor2-devel
BuildRequires: rasqal-devel >= 0.9.26
BuildRequires: sqlite3-devel

%description
Redland is a library that provides a high-level interface for RDF
(Resource Description Framework) implemented in an object-based API.
It is modular and supports different RDF parsers, serializers,
storage and query languages.  Redland is designed for developers to
provide RDF support in their applications as well as a core library
for RDF developers to start with.

%package mysql
Summary: MySQL storage support for Redland
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}

%description mysql
This package provides Redland's storage support for graphs in memory and
persistently with MySQL files or URIs.

%package pgsql
Summary: PostgreSQL storage support for Redland
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}

%description pgsql
This package provides Redland's storage support for graphs in memory and
persistently with PostgreSQL files or URIs.

%package devel
Summary: Libraries and header files for programs that use Redland.
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
Header files for development with Redland


%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 --disable-static

make %{?_smp_mflags}


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

make install DESTDIR=$RPM_BUILD_ROOT

#unpackaged files
find $RPM_BUILD_ROOT -name \*.la -exec rm {} \;

%clean
[ "$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 LICENSE.txt NEWS README
%doc LICENSE-2.0.txt NOTICE TODO
%doc FAQS.html LICENSE.html NEWS.html README.html TODO.html
%{_bindir}/rdfproc
%{_bindir}/redland-db-upgrade
%{_libdir}/librdf.so.*
%dir %{_libdir}/redland
%{_libdir}/redland/librdf_storage_sqlite.so
%{_libdir}/redland/librdf_storage_virtuoso.so
%{_datadir}/redland/mysql-v1.ttl
%{_datadir}/redland/mysql-v2.ttl
%{_mandir}/man1/rdfproc.1*
%{_mandir}/man1/redland-db-upgrade.1*
%{_mandir}/man3/redland.3*

%files mysql
%defattr(-,root,root,-)
%{_libdir}/redland/librdf_storage_mysql.so

%files pgsql
%defattr(-,root,root,-)
%{_libdir}/redland/librdf_storage_postgresql.so

%files devel
%defattr(-, root, root)
%doc ChangeLog RELEASE.html
%doc %{_datadir}/gtk-doc/html
%{_bindir}/redland-config
%{_libdir}/librdf*.so
%{_libdir}/pkgconfig/redland.pc
%{_datadir}/%{name}/Redland.i
%{_includedir}/redland.h
%{_includedir}/librdf.h 
%{_includedir}/rdf_*.h
%{_mandir}/man1/redland-config.1*


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

* Fri Aug 19 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 1.0.14-1
- new upstream release
- added mysql, pgsql subpackages

* Mon Sep 20 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 1.0.10-6
- rebuilt with rpm-4.8.1

* Mon Apr 12 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 1.0.10-5
- BuildRequires: libiodbc-devel instead of unixODBC-devel

* Thu Feb 11 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 1.0.10-4
- added Patch50 and 51 from FC
  * Mon Jan 04 2010 Rex Dieter <rdieter@fedoraproject.org> - 1.0.10-3
  - no_undefined patch
  * Sun Jan 03 2010 Rex Dieter <rdieter@fedoraproject.org> - 1.0.10-2
  - pkgconfig_requires_private patch

* Thu Feb 11 2010 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 1.0.10-3
- rebuilt with rasqal-0.9.17 on ppc

* Sun Feb 07 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.10-2
- add BuildRequires: pkgconfig, unixODBC-devel
- add Requires: unixODBC

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

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

* Thu Oct 30 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0.7-2
- redland-devel requires {raptor,rasqal}-devel instead of {rapter,rasqal}

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

* Thu Feb 21 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.0.7-0vl1
- new upstream release
- drop .la

* Sun May 20 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.0.6-0vl1
- initial release for VineSeed
- disable MySQL, postgresql and sqlite

* Sat May  5 2007  Dave Beckett <dave@dajobe.org>
- Add /usr/share/redland/mysql-v1.ttl and /usr/share/redland/mysql-v2.ttl

* Wed Feb 15 2006  Dave Beckett <dave@dajobe.org>
- Require db4-devel
- Disable postgresql for now

* Thu Aug 11 2005  Dave Beckett <dave.beckett@bristol.ac.uk>
- Update Source:
- Do not require python-devel at build time
- Add sqlite-devel build requirement.
- Use %%configure and %%makeinstall

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

* Mon Nov 1 2004  Dave Beckett <dave.beckett@bristol.ac.uk>
- License now LGPL/Apache 2
- Added LICENSE-2.0.txt and NOTICE

* Mon Jul 19 2004  Dave Beckett <dave.beckett@bristol.ac.uk>
- move perl, python packages into redland-bindings

* Mon Jul 12 2004  Dave Beckett <dave.beckett@bristol.ac.uk>
- put /usr/share/redland/Redland.i in redland-devel

* Wed May  5 2004  Dave Beckett <dave.beckett@bristol.ac.uk>
- require raptor 1.3.0
- require rasqal 0.2.0

* Fri Jan 30 2004  Dave Beckett <dave.beckett@bristol.ac.uk>
- require raptor 1.2.0
- update for removal of python distutils
- require python 2.2.0+
- require perl 5.8.0+
- build and require mysql
- do not build and require threestore

* Sun Jan 4 2004  Dave Beckett <dave.beckett@bristol.ac.uk>
- added redland-python package
- export some more docs

* Mon Dec 15 2003 Dave Beckett <dave.beckett@bristol.ac.uk>
- require raptor 1.1.0
- require libxml 2.4.0 or newer
- added pkgconfig redland.pc
- split redland/devel package shared libs correctly

* Mon Sep 8 2003 Dave Beckett <dave.beckett@bristol.ac.uk>
- require raptor 1.0.0
 
* Thu Sep 4 2003 Dave Beckett <dave.beckett@bristol.ac.uk>
- added rdfproc
 
* Thu Aug 28 2003 Dave Beckett <dave.beckett@bristol.ac.uk>
- patches added post 0.9.13 to fix broken perl UNIVERSAL::isa
 
* Thu Aug 21 2003 Dave Beckett <dave.beckett@bristol.ac.uk>
- Add redland-db-upgrade.1
- Removed duplicate perl CORE shared objects

* Sun Aug 17 2003 Dave Beckett <dave.beckett@bristol.ac.uk>
- Updates for new perl module names.

* Tue Apr 22 2003 Dave Beckett <dave.beckett@bristol.ac.uk>
- Updated for Redhat 9, RPM 4

* Fri Feb 12 2003 Dave Beckett <dave.beckett@bristol.ac.uk>
- Updated for redland 0.9.12

* Fri Jan 4 2002 Dave Beckett <dave.beckett@bristol.ac.uk>
- Updated for new Perl module names

* Fri Sep 14 2001 Dave Beckett <dave.beckett@bristol.ac.uk>
- Added shared libraries
