From 3b521f3d0849042feec47c60476bb358c1ada538 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Aug 26 2010 19:50:02 +0000 Subject: Another attempt for the build of 0.2.2 on Fedora (fixed encondig tests from upstream included). Still failing with a bug. --- diff --git a/.gitignore b/.gitignore index 425ac5c..5207db1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ pyexiv2-0.1.3.tar.bz2 +/pyexiv2-0.2.2.tar.bz2 diff --git a/pyexiv2.spec b/pyexiv2.spec index 4f1afa6..5edf8ac 100644 --- a/pyexiv2.spec +++ b/pyexiv2.spec @@ -2,25 +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.1.3 -Release: 11%{?dist} +Version: 0.2.2 +Release: 1%{?dist} Summary: Python binding to exiv2 Group: Development/Languages License: GPLv2+ URL: http://tilloy.net/dev/pyexiv2/ -Source0: http://tilloy.net/dev/pyexiv2/releases/pyexiv2-%{version}.tar.bz2 -# next patch should be removed when -# https://bugs.launchpad.net/pyexiv2/+bug/249513 -# is fixed -Patch0: pyexiv2-multilib.patch -# the same for bug -# https://bugs.launchpad.net/pyexiv2/+bug/249835 -Patch1: pyexiv2-packager.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - -# see http://bazaar.launchpad.net/%7Eosomon/pyexiv2/0.1.x/diff/101 -Patch2: 101_100.diff +Source0: http://launchpad.net/pyexiv2/0.2.x/%{version}/+download/pyexiv2-%{version}.tar.bz2 +Patch0: upstream-lp_bug_624283-Skip-unicode-unit-tests-for-unsupported-encodings.patch BuildRequires: python-devel exiv2-devel boost-devel scons @@ -32,12 +22,7 @@ embedded in image files (JPEG, TIFF, ...). %prep %setup -q -%patch0 -p1 -b .multilib -%patch1 -p1 -b .packager -%if 0%{?fedora} > 12 -# if building against exiv2-0.19 -%patch2 -p0 -b .exiv2_019 -%endif +%patch0 -p1 -b .fixTests %build # Remove CFLAGS=... for noarch packages (unneeded) @@ -57,17 +42,20 @@ scons DESTDIR=$RPM_BUILD_ROOT install rm -rf $RPM_BUILD_ROOT %check -pushd unittest +pushd test PYTHONPATH=$RPM_BUILD_ROOT%{python_sitearch} ./TestsRunner.py popd %files %defattr(-,root,root,-) -%doc README ChangeLog COPYING doc/ +%doc README COPYING NEWS doc/ %{python_sitearch}/* %changelog +* Wed Aug 25 2010 Matěj Cepl - 0.2.2-1 +- New upstream package, switch to 0.2.* version + * Sat Aug 7 2010 Peter Lemenkov - 0.1.3-11 - Rebuilt for new boost - Small cosmetic changes - whitespace cleanups diff --git a/sources b/sources index 4ff62ce..717a61b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -dfc28a6f5f098f88926e8e1de6b925c0 pyexiv2-0.1.3.tar.bz2 +3c1aab78bbd44cc3581a0645b0ee56ee pyexiv2-0.2.2.tar.bz2 diff --git a/upstream-lp_bug_624283-Skip-unicode-unit-tests-for-unsupported-encodings.patch b/upstream-lp_bug_624283-Skip-unicode-unit-tests-for-unsupported-encodings.patch new file mode 100644 index 0000000..8fdf540 --- /dev/null +++ b/upstream-lp_bug_624283-Skip-unicode-unit-tests-for-unsupported-encodings.patch @@ -0,0 +1,55 @@ +From c5a46aea313d3130a2bf00d0c1db3066ab496116 Mon Sep 17 00:00:00 2001 +From: Olivier Tilloy +Date: Thu, 26 Aug 2010 19:27:26 +0200 +Subject: [PATCH 3/3] Skip unicode unit tests for unsupported encodings. + +--- + test/encoding.py | 16 +++++++++++++--- + 1 files changed, 13 insertions(+), 3 deletions(-) + +diff --git a/test/encoding.py b/test/encoding.py +index d3f96d9..9cc251f 100644 +--- a/test/encoding.py ++++ b/test/encoding.py +@@ -28,6 +28,7 @@ import unittest + import os + import sys + import binascii ++import locale + from tempfile import gettempdir + + from pyexiv2.metadata import ImageMetadata +@@ -65,6 +66,12 @@ class TestEncodings(unittest.TestCase): + def setUp(self): + self._cwd = os.getcwd() + os.chdir(gettempdir()) ++ try: ++ locale.setlocale(locale.LC_ALL, '') ++ except locale.Error: ++ self.encoding = None ++ else: ++ lc, self.encoding = locale.getlocale() + + def tearDown(self): + os.chdir(self._cwd) +@@ -88,11 +95,14 @@ class TestEncodings(unittest.TestCase): + self._test_filename('test.jpg') + + def test_ascii_unicode(self): +- self._test_filename(u'test.jpg') ++ if self.encoding is not None: ++ self._test_filename(u'test.jpg') + + def test_nonascii_unicode(self): +- self._test_filename(u'tést.jpg') ++ if self.encoding is not None: ++ self._test_filename(u'tést.jpg') + + def test_nonascii_unicode_escaped(self): +- self._test_filename(u't\xe9st.jpg') ++ if self.encoding is not None: ++ self._test_filename(u't\xe9st.jpg') + +-- +1.7.2.2 +