diff --git a/.gitignore b/.gitignore index 451ac79..cb56601 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ pyexiv2-0.1.3.tar.bz2 /pyexiv2-0.3.1.tar.bz2 /pyexiv2-0.3.1 /x86_64 +/pyexiv2-0.3.2.tar.bz2 +/pyexiv2-0.3.2 diff --git a/exiv-0-18-2.patch b/exiv-0-18-2.patch index 34da36d..89b28e1 100644 --- a/exiv-0-18-2.patch +++ b/exiv-0-18-2.patch @@ -1,6 +1,6 @@ -diff -up pyexiv2-0.3.1/src/exiv2wrapper.cpp.exiv0182 pyexiv2-0.3.1/src/exiv2wrapper.cpp ---- pyexiv2-0.3.1/src/exiv2wrapper.cpp.exiv0182 2011-10-23 18:44:56.000000000 +0200 -+++ pyexiv2-0.3.1/src/exiv2wrapper.cpp 2011-12-14 19:26:19.533659344 +0100 +diff -up pyexiv2-0.3.2/src/exiv2wrapper.cpp.exiv2-0182 pyexiv2-0.3.2/src/exiv2wrapper.cpp +--- pyexiv2-0.3.2/src/exiv2wrapper.cpp.exiv2-0182 2011-10-24 19:06:02.000000000 +0200 ++++ pyexiv2-0.3.2/src/exiv2wrapper.cpp 2011-12-15 10:22:01.755433460 +0100 @@ -521,15 +521,7 @@ void Image::setExifThumbnailFromData(con const std::string Image::getIptcCharset() const { @@ -18,10 +18,82 @@ diff -up pyexiv2-0.3.1/src/exiv2wrapper.cpp.exiv0182 pyexiv2-0.3.1/src/exiv2wrap } -diff -up pyexiv2-0.3.1/test/metadata.py.exiv0182 pyexiv2-0.3.1/test/metadata.py ---- pyexiv2-0.3.1/test/metadata.py.exiv0182 2011-10-23 18:44:56.000000000 +0200 -+++ pyexiv2-0.3.1/test/metadata.py 2011-12-14 19:26:32.371784500 +0100 -@@ -562,7 +562,7 @@ class TestImageMetadata(unittest.TestCas +diff -up pyexiv2-0.3.2/test/exif.py.exiv2-0182 pyexiv2-0.3.2/test/exif.py +--- pyexiv2-0.3.2/test/exif.py.exiv2-0182 2011-10-24 19:06:02.000000000 +0200 ++++ pyexiv2-0.3.2/test/exif.py 2011-12-15 10:22:01.756433320 +0100 +@@ -190,30 +190,32 @@ class TestExifTag(unittest.TestCase): + self.failUnlessRaises(ExifValueError, tag._convert_to_string, 'invalid') + self.failUnlessRaises(ExifValueError, tag._convert_to_string, 3.14) + +- def test_convert_to_python_sshort(self): +- # Valid values +- tag = ExifTag('Exif.Image.TimeZoneOffset') +- self.assertEqual(tag.type, 'SShort') +- self.assertEqual(tag._convert_to_python('8'), 8) +- self.assertEqual(tag._convert_to_python('+5'), 5) +- self.assertEqual(tag._convert_to_python('-6'), -6) +- +- # Invalid values +- self.failUnlessRaises(ExifValueError, tag._convert_to_python, 'abc') +- self.failUnlessRaises(ExifValueError, tag._convert_to_python, '5,64') +- self.failUnlessRaises(ExifValueError, tag._convert_to_python, '47.0001') +- self.failUnlessRaises(ExifValueError, tag._convert_to_python, '1E3') +- +- def test_convert_to_string_sshort(self): +- # Valid values +- tag = ExifTag('Exif.Image.TimeZoneOffset') +- self.assertEqual(tag.type, 'SShort') +- self.assertEqual(tag._convert_to_string(12), '12') +- self.assertEqual(tag._convert_to_string(-3), '-3') +- +- # Invalid values +- self.failUnlessRaises(ExifValueError, tag._convert_to_string, 'invalid') +- self.failUnlessRaises(ExifValueError, tag._convert_to_string, 3.14) ++# EPEL packaging: Exif.Image.TimeZoneOffset has not been supported by 0.18.2 ++# http://dev.exiv2.org/issues/show/0000651 ++# def test_convert_to_python_sshort(self): ++# # Valid values ++# tag = ExifTag('Exif.Image.TimeZoneOffset') ++# self.assertEqual(tag.type, 'SShort') ++# self.assertEqual(tag._convert_to_python('8'), 8) ++# self.assertEqual(tag._convert_to_python('+5'), 5) ++# self.assertEqual(tag._convert_to_python('-6'), -6) ++# ++# # Invalid values ++# self.failUnlessRaises(ExifValueError, tag._convert_to_python, 'abc') ++# self.failUnlessRaises(ExifValueError, tag._convert_to_python, '5,64') ++# self.failUnlessRaises(ExifValueError, tag._convert_to_python, '47.0001') ++# self.failUnlessRaises(ExifValueError, tag._convert_to_python, '1E3') ++# ++# def test_convert_to_string_sshort(self): ++# # Valid values ++# tag = ExifTag('Exif.Image.TimeZoneOffset') ++# self.assertEqual(tag.type, 'SShort') ++# self.assertEqual(tag._convert_to_string(12), '12') ++# self.assertEqual(tag._convert_to_string(-3), '-3') ++# ++# # Invalid values ++# self.failUnlessRaises(ExifValueError, tag._convert_to_string, 'invalid') ++# self.failUnlessRaises(ExifValueError, tag._convert_to_string, 3.14) + + def test_convert_to_python_long(self): + # Valid values +diff -up pyexiv2-0.3.2/test/metadata.py.exiv2-0182 pyexiv2-0.3.2/test/metadata.py +--- pyexiv2-0.3.2/test/metadata.py.exiv2-0182 2011-10-24 19:06:02.000000000 +0200 ++++ pyexiv2-0.3.2/test/metadata.py 2011-12-15 10:22:01.756433320 +0100 +@@ -35,8 +35,11 @@ import os + import tempfile + import time + import unittest ++import logging + from testutils import EMPTY_JPG_DATA + ++logging.basicConfig(format='%(levelname)s:%(funcName)s:%(message)s', ++ level=logging.DEBUG) + + class TestImageMetadata(unittest.TestCase): + +@@ -562,7 +565,7 @@ class TestImageMetadata(unittest.TestCas self.metadata.iptc_keys + \ self.metadata.xmp_keys for key in keys: @@ -30,7 +102,7 @@ diff -up pyexiv2-0.3.1/test/metadata.py.exiv0182 pyexiv2-0.3.1/test/metadata.py def test_nonexistent_tag_family(self): self.metadata.read() -@@ -574,7 +574,7 @@ class TestImageMetadata(unittest.TestCas +@@ -574,7 +577,7 @@ class TestImageMetadata(unittest.TestCas ########################## # Test the image comment # ########################## @@ -39,7 +111,14 @@ diff -up pyexiv2-0.3.1/test/metadata.py.exiv0182 pyexiv2-0.3.1/test/metadata.py def test_get_comment(self): self.metadata.read() self.failUnlessEqual(self.metadata.comment, 'Hello World!') -@@ -643,10 +643,10 @@ class TestImageMetadata(unittest.TestCas +@@ -640,13 +643,17 @@ class TestImageMetadata(unittest.TestCas + self.clean.read() + + self.assertEqual(len(self.clean), 0) ++ logging.debug("self.clean = %s", dir(self.clean)) ++ logging.debug("self.clean = %s", self.clean.iptc_keys) ++ logging.debug("self.clean = %s", self.clean.exif_keys) ++ logging.debug("self.clean = %s", self.clean.xmp_keys) self.assertTrue('Exif.Image.DateTimeOriginal' not in self.clean) key = 'Exif.Image.DateTimeOriginal' @@ -54,7 +133,7 @@ diff -up pyexiv2-0.3.1/test/metadata.py.exiv0182 pyexiv2-0.3.1/test/metadata.py self.clean[key] = tag_date self.assertEqual(len(self.clean), 1) -@@ -655,11 +655,11 @@ class TestImageMetadata(unittest.TestCas +@@ -655,11 +662,11 @@ class TestImageMetadata(unittest.TestCas self.assertEqual(self.clean.get('Exif.Image.DateTime', tag_date), tag_date) key = 'Exif.Photo.UserComment' @@ -70,7 +149,7 @@ diff -up pyexiv2-0.3.1/test/metadata.py.exiv0182 pyexiv2-0.3.1/test/metadata.py key = 'Xmp.dc.subject' tag = XmpTag(key, ['subject', 'values']) self.clean[key] = tag -@@ -785,24 +785,24 @@ class TestImageMetadata(unittest.TestCas +@@ -785,24 +792,24 @@ class TestImageMetadata(unittest.TestCas # Test the IPTC charset # ######################### @@ -113,7 +192,7 @@ diff -up pyexiv2-0.3.1/test/metadata.py.exiv0182 pyexiv2-0.3.1/test/metadata.py def test_set_invalid_iptc_charset(self): self.metadata.read() -@@ -821,27 +821,27 @@ class TestImageMetadata(unittest.TestCas +@@ -821,27 +828,27 @@ class TestImageMetadata(unittest.TestCas self.assertRaises(ValueError, self.metadata.__setattr__, 'iptc_charset', value) @@ -164,3 +243,17 @@ diff -up pyexiv2-0.3.1/test/metadata.py.exiv0182 pyexiv2-0.3.1/test/metadata.py +# self.assertEqual(self.metadata.iptc_charset, 'ascii') +# self.assert_(key not in self.metadata.iptc_keys) +diff -up pyexiv2-0.3.2/test/pickling.py.exiv2-0182 pyexiv2-0.3.2/test/pickling.py +--- pyexiv2-0.3.2/test/pickling.py.exiv2-0182 2011-10-24 19:06:02.000000000 +0200 ++++ pyexiv2-0.3.2/test/pickling.py 2011-12-15 10:32:06.210311586 +0100 +@@ -46,7 +46,9 @@ class TestPicklingTags(unittest.TestCase + tags.append(ExifTag('Exif.Pentax.Temperature', '14')) + tags.append(ExifTag('Exif.Photo.UserComment', 'foo bar baz')) + tags.append(ExifTag('Exif.Image.BitsPerSample', 8)) +- tags.append(ExifTag('Exif.Image.TimeZoneOffset', 7)) ++# EPEL packaging: Exif.Image.TimeZoneOffset has not been supported by 0.18.2 ++# http://dev.exiv2.org/issues/show/0000651 ++# tags.append(ExifTag('Exif.Image.TimeZoneOffset', 7)) + tags.append(ExifTag('Exif.Image.ImageWidth', 7492)) + tags.append(ExifTag('Exif.OlympusCs.ManometerReading', 29)) + tags.append(ExifTag('Exif.Image.XResolution', make_fraction(7, 3))) diff --git a/pyexiv2.spec b/pyexiv2.spec index 718699f..c351994 100644 --- a/pyexiv2.spec +++ b/pyexiv2.spec @@ -2,19 +2,15 @@ %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Name: pyexiv2 -Version: 0.3.1 -Release: 2%{?dist} +Version: 0.3.2 +Release: 1%{?dist} Summary: Python binding to exiv2 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 -# Upstream patch from https://bugs.launchpad.net/pyexiv2/+bug/880659 -Patch0: pyexiv2-python26-compatible.patch -%if 0%{?rhel} > 0 && 0%{?rhel} <= 7 -Patch1: exiv-0-18-2.patch -%endif +Patch0: exiv-0-18-2.patch BuildRequires: python-devel exiv2-devel boost-devel scons pytz %description @@ -25,10 +21,7 @@ embedded in image files (JPEG, TIFF, ...). %prep %setup -q -%patch0 -p1 -b .python26 -%if 0%{?rhel} > 0 && 0%{?rhel} <= 7 -%patch1 -p1 -b .exiv0182 -%endif +%patch0 -p1 -b .exiv2-0182 %build # Remove CFLAGS=... for noarch packages (unneeded)