%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Name: pyexiv2
Version: 0.3.2
Release: 4%{?_dist_release}
Summary: Python binding to exiv2
Summary(ja): exiv2 の Python バインディング

Group: Development/Languages
License: GPLv2+
URL: http://tilloy.net/dev/pyexiv2/
Source0: http://launchpad.net/pyexiv2/0.3.x/%{version}/+download/pyexiv2-%{version}.tar.bz2
Patch0: http://tilloy.net/dev/pyexiv2-0.3.2-exiv2-0.18.2.patch

BuildRequires:  exiv2-devel
BuildRequires:  libboost-devel
BuildRequires:  libboost-python
BuildRequires:  python-devel
BuildRequires:  pytz
BuildRequires:  scons

%description
pyexiv2 is a python binding to exiv2, the C++ library for manipulation
of EXIF and IPTC image metadata. It is a python module that allows your
python scripts to read and write metadata (EXIF, IPTC, thumbnail)
embedded in image files (JPEG, TIFF, ...).

%prep
%setup -q
%patch0 -p0 -b .exiv2-0182

%build
export CXXFLAGS="%{optflags}"
export LDFLAGS="%{optflags}"
scons

%install
#%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
export CXXFLAGS="%{optflags}"
export LDFLAGS="%{optflags}"
scons DESTDIR=$RPM_BUILD_ROOT install

%check
pushd test
PYTHONPATH=$RPM_BUILD_ROOT%{python_sitearch}  ./TestsRunner.py
popd

%files
%defattr(-,root,root,-)
%doc README COPYING NEWS doc/
%{python_sitearch}/*


%changelog
* Wed Dec 11 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.3.2-4
- rebuild with exiv2-0.24

* Sun Dec 08 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.3.2-3
- rebuild with libboost-1.54.0

* Sun Jul 29 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.3.2-2
- rebuild with exiv2-0.23

* Tue Jun 26 2012 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.3.2-1
- initial build for VineSeed

* Mon Jan 9 2012 Matěj Cepl <mcepl@redhat.com> 0.3.2-2
- Applying upstream patch for 0.18.2 compatbility (#753322)

* Fri Dec 23 2011 Peter Robinson <pbrobinson@fedoraproject.org> - 0.3.2-1
- Update to 0.3.2 and rebuild for new boost, drop upstreamed patch

* Wed Dec 14 2011 Matěj Cepl <mcepl@redhat.com> 0.3.1-2
- Make the package building with exiv 0.18.2 on EL-6 (#753322)

* Fri Nov 11 2011 'Matěj Cepl <mcepl@redhat.com>' - 0.3.1-1
- Add pytz to the BuildRequires (so that more tests are run).

* Fri Oct 14 2011 Rex Dieter <rdieter@fedoraproject.org> - 0.3.0-6
- rebuild (exiv2)

* Sat Jul 30 2011 Matěj Cepl <mcepl@redhat.com> - 0.3.0-5
- Rebuilt against new libraries.

* Wed Apr 13 2011 Matěj Cepl <mcepl@redhat.com> - 0.3.0-4
- Rebuilt for new boost.

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sun Feb 06 2011 Thomas Spura <tomspur@fedoraproject.org> - 0.3.0-2
- rebuild for new boost

* Sun Jan 02 2011 Rex Dieter <rdieter@fedoraproject.org> -  0.3.0-1
- pyexiv2-0.3.0

* Mon Oct 25 2010 Matěj Cepl <mcepl@redhat.com> - 0.2.2-2
- Fixing unit tests.

* Wed Aug 25 2010 Matěj Cepl <mcepl@redhat.com> - 0.2.2-1
- New upstream package, switch to 0.2.* version

* Sat Aug  7 2010 Peter Lemenkov <lemenkov@gmail.com> - 0.1.3-11
- Rebuilt for new boost
- Small cosmetic changes - whitespace cleanups

* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 0.1.3-10
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Mon May 31 2010 Rex Dieter <rdieter@fedoraproject.org> - 0.1.3-9
- rebuild (exiv2)

* Sat Jan 16 2010 Rex Dieter <rdieter@fedoraproject.org> - 0.1.3-8
- rebuild (boost)

* Fri Jan 15 2010 Rex Dieter <rdieter@fedoraproject.org> - 0.1.3-7
- %%check: use unittests

* Fri Jan 15 2010 Rex Dieter <rdieter@fedoraproject.org> - 0.1.3-6
- pyexiv2 FTBFS against exiv2-0.19 (#552281)

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Jun 08 2009 Matěj Cepl <mcepl@redhat.com> - 0.1.3-4
-rebuild for new boot library

* Thu Apr 23 2009 Matěj Cepl <mcepl@redhat.com> - 0.1.3-3
- executable library doesn't make sense

* Sat Apr 18 2009 Matěj Cepl <mcepl@redhat.com> - 0.1.3-2
- Rebuild after exiv2 was fixed.

* Thu Apr 16 2009 Matěj Cepl <mcepl@redhat.com> - 0.1.3-1
- New upstream release (closes bug 494419)

* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.2-9.1.20090109bzr107
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Fri Jan 09 2009 Matej Cepl <mcepl@redhat.com> 0.1.2-8.1.20090109bzr107
- New snapshot from upstream pyexiv2-0.2 branch in order to be compatible
  with the current package of exiv2.

* Thu Dec 18 2008 Rex Dieter <rdieter@fedoraproject.org> - 0.1.2-6
- respin (eviv2)

* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.1.2-5
- Rebuild for Python 2.6

* Thu Sep 11 2008 Jesse Keating <jkeating@redhat.com> - 0.1.2-4
- Rebuild for deps

* Fri Jul 18 2008 Matěj Cepl <mcepl@redhat.com> 0.1.2-3
- Fix building system.
- Approved for Fedora

* Fri Jul 18 2008 Matěj Cepl <mcepl@redhat.com> 0.1.2-2
- Dan's patch to fix compilation flags.

* Thu Jul 17 2008 Matěj Cepl <mcepl@redhat.com> 0.1.2-1
- initial build
