Name:      raptor
Summary:   RDF Parser Toolkit for Redland
Version:   1.4.21
Release:   3%{?_dist_release}

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

Source:    http://download.librdf.org/source/%{name}-%{version}.tar.gz
# Make the raptor-config file multilib friendly (RHBZ#477342)
Patch0:    raptor-config-multilib.patch
## upstream patches
Patch100:  raptor-1.4.21-curl.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: curl-devel
BuildRequires: libxml2-devel
BuildRequires: libxslt-devel

%description
Raptor is the RDF Parser Toolkit for Redland that provides a set of
Resource Description Framework (RDF) parsers and serializers,
generating RDF triples from the following syntaxes: RDF/XML,
N-Triples, Turtle, several XML RSS tag soup formats, Atom 0.3 and
Atom 1.0 and serializing RDF triples to syntaxes: RDF/XML, RSS 1.0,
Atom 1.0, N-Triples, Adobe XMP, Turtle and GraphViz DOT.

%package devel
Summary: Libraries, includes etc to develop with Raptor RDF parser library
Group: Development/Libraries
Requires: raptor = %{version}-%{release}

%description devel
Libraries, includes etc to develop with Raptor RDF parser and
serializer library.

%prep
%setup -q
%patch0 -p1 -b .multilib
%patch100 -p1 -b .curl

# Fix encoding
iconv -f ISO-8859-1 -t UTF8 NEWS > NEWS.tmp
touch -r NEWS NEWS.tmp
mv -f NEWS.tmp NEWS

# 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
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT

make install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la

# include %{_bindir}/rapper in raptor2 
rm -f  $RPM_BUILD_ROOT%{_bindir}/rapper
rm -fv $RPM_BUILD_ROOT%{_mandir}/man1/rapper.1*


%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-2.0.txt LICENSE.html
%doc LICENSE.txt  NEWS NEWS.html NOTICE README README.html RELEASE.html
%doc *.html
#{_bindir}/rapper
%{_libdir}/libraptor*.so.*
#{_mandir}/man1/rapper.1*

%files devel
%defattr(-, root, root)
%{_bindir}/raptor-config
%{_libdir}/libraptor*.so
%{_libdir}/pkgconfig/raptor.pc
%{_includedir}/*
%{_mandir}/man1/raptor-config.1*
%{_mandir}/man3/libraptor.3*
%doc %{_datadir}/gtk-doc/html/raptor/*

%changelog
* Thu Aug 18 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.4.21-3
- omit rapper, include in raptor2 instead
- upstream patch to fix build against newer libcurl

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

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

* Thu Aug 25 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.4.19-1
- new upstream release

* Sat Apr 04 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4.18-2
- rebuild with openldap-2.4.11
- add BR: openldap-devel

* Mon Mar 23 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 1.4.18-1
- new upstream release

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

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

* Fri Oct 11 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.4.16-0vl1
- new upstream release
- add BuildPrereq: expat-devel

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

* Fri Jan 5 2007  Dave Beckett <dave@dajobe.org>
- Document Turtle and DOT serializers

* Wed Feb 15 2006  Dave Beckett <dave@dajobe.org>
- Add libxslt and libxslt-devel for GRDDL

* Wed Dec 20 2005  Dave Beckett <dave@dajobe.org>
- Update description of parsers and serializers.

* Wed Nov 9 2005  Dave Beckett <dave@dajobe.org>
- Add gtk-doc documentation

* Wed 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 and %{_make}

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

* Tue May 11 2004 Dave Beckett <Dave.Beckett@bristol.ac.uk>
- Added RELEASE.html

* Thu Apr 17 2003 Dave Beckett <Dave.Beckett@bristol.ac.uk>
- Added pkgconfig raptor.pc, raptor-config
- Requires curl

* Mon Jan 13 2003 Dave Beckett <Dave.Beckett@bristol.ac.uk>
- rdfdump now rapper

* Fri Dec 20 2002 Dave Beckett <Dave.Beckett@bristol.ac.uk>
- Updated to have two RPMs for raptor and raptor-devel.  Depend on
  libxml2 as XML parser.
