avatar
abondrov has added 8cdc912590
Add patch to fix build againt exiv2 0.27+
view file @ 8cdc912590
... ... --- /dev/null
... ... +++ b/libextractor-1.8-exiv2-0.27.patch
... ... @@ -0,0 +1,127 @@
1
From bbe21db4bf8face03adf0efd2eb18540582cb5ba Mon Sep 17 00:00:00 2001
2
From: Andreas Sturmlechner <andreas.sturmlechner@gmail.com>
3
Date: Sun, 30 Dec 2018 00:46:57 +0100
4
Subject: [PATCH] Fix build with exiv2-0.27
5
6
---
7
 src/plugins/exiv2_extractor.cc | 35 +++++++++++++++++++++++++++-------
8
 1 file changed, 28 insertions(+), 7 deletions(-)
9
10
diff --git a/src/plugins/exiv2_extractor.cc b/src/plugins/exiv2_extractor.cc
11
index 8741d40..ef402a8 100644
12
--- a/src/plugins/exiv2_extractor.cc
13
+++ b/src/plugins/exiv2_extractor.cc
14
@@ -27,10 +27,7 @@
15
 #include <cassert>
16
 #include <cstring>
17
 #include <math.h>
18
-#include <exiv2/exif.hpp>
19
-#include <exiv2/error.hpp>
20
-#include <exiv2/image.hpp>
21
-#include <exiv2/futils.hpp>
22
+#include <exiv2/exiv2.hpp>
23
 
24
 /**
25
  * Enable debugging to get error messages.
26
@@ -180,7 +177,7 @@ public:
27
    *
28
    * @return -1 on error
29
    */
30
-#if EXIV2_VERSION >= EXIV2_MAKE_VERSION(0,26,0)
31
+#if EXIV2_TEST_VERSION(0,26,0)
32
   virtual size_t size (void) const;
33
 #else
34
   virtual long int size (void) const;
35
@@ -316,7 +313,11 @@ ExtractorIO::getb ()
36
   const unsigned char *r;
37
 
38
   if (1 != ec->read (ec->cls, &data, 1))
39
+#if EXIV2_TEST_VERSION(0,27,0)
40
+    throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
41
+#else
42
     throw Exiv2::BasicError<char> (42 /* error code */);
43
+#endif
44
   r = (const unsigned char *) data;
45
   return *r;
46
 }
47
@@ -371,7 +372,11 @@ ExtractorIO::putb (Exiv2::byte data)
48
 void
49
 ExtractorIO::transfer (Exiv2::BasicIo& src)
50
 {
51
+#if EXIV2_TEST_VERSION(0,27,0)
52
+    throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
53
+#else
54
   throw Exiv2::BasicError<char> (42 /* error code */);
55
+#endif
56
 }
57
 
58
 
59
@@ -416,7 +421,11 @@ ExtractorIO::seek (long offset,
60
 Exiv2::byte *
61
 ExtractorIO::mmap (bool isWritable)
62
 {
63
+#if EXIV2_TEST_VERSION(0,27,0)
64
+    throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
65
+#else
66
   throw Exiv2::BasicError<char> (42 /* error code */);
67
+#endif
68
 }
69
 
70
 
71
@@ -449,7 +458,7 @@ ExtractorIO::tell (void) const
72
  *
73
  * @return -1 on error
74
  */
75
-#if EXIV2_VERSION >= EXIV2_MAKE_VERSION(0,26,0)
76
+#if EXIV2_TEST_VERSION(0,26,0)
77
 size_t
78
 #else
79
 long int
80
@@ -504,7 +513,11 @@ ExtractorIO::eof () const
81
 std::string
82
 ExtractorIO::path () const
83
 {
84
+#if EXIV2_TEST_VERSION(0,27,0)
85
+    throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
86
+#else
87
   throw Exiv2::BasicError<char> (42 /* error code */);
88
+#endif
89
 }
90
 
91
 
92
@@ -517,7 +530,11 @@ ExtractorIO::path () const
93
 std::wstring
94
 ExtractorIO::wpath () const
95
 {
96
+#if EXIV2_TEST_VERSION(0,27,0)
97
+    throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
98
+#else
99
   throw Exiv2::BasicError<char> (42 /* error code */);
100
+#endif
101
 }
102
 #endif
103
 
104
@@ -531,7 +548,11 @@ Exiv2::BasicIo::AutoPtr
105
 ExtractorIO::temporary () const
106
 {
107
   fprintf (stderr, "throwing temporary error\n");
108
+#if EXIV2_TEST_VERSION(0,27,0)
109
+    throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed);
110
+#else
111
   throw Exiv2::BasicError<char> (42 /* error code */);
112
+#endif
113
 }
114
 
115
 
116
@@ -697,7 +718,7 @@ EXTRACTOR_exiv2_extract_method (struct EXTRACTOR_ExtractContext *ec)
117
 {
118
   try
119
     {
120
-#if EXIV2_MAKE_VERSION(0,23,0) <= EXIV2_VERSION
121
+#if !EXIV2_TEST_VERSION(0,24,0)
122
       Exiv2::LogMsg::setLevel (Exiv2::LogMsg::mute);
123
 #endif
124
       std::auto_ptr<Exiv2::BasicIo> eio(new ExtractorIO (ec));
125
-- 
126
2.20.1
127
view file @ 8cdc912590
... ... --- a/libextractor.spec
... ... +++ b/libextractor.spec
... ... @@ -14,6 +14,7 @@ Url: http://www.gnunet.org/libextractor/
14 14
Source0:	http://ftpmirror.gnu.org/libextractor/%{name}-%{version}.tar.gz
15 15
Patch0:		libextractor-1.3-rpm5.patch
16 16
Patch1:		7cc63b001ceaf81143795321379c835486d0c92e.patch
17
Patch2:		libextractor-1.8-exiv2-0.27.patch
17 18
BuildRequires:	bzip2-devel
18 19
BuildRequires:	gettext-devel
19 20
BuildRequires:	libtool-devel
... ... @@ -47,11 +48,11 @@ various additional MIME types are detected.
48 48
49 49
#----------------------------------------------------------------------------
50 50
51
%package -n	%{libname}
51
%package -n %{libname}
52 52
Summary:	Libextractor library used to extract meta-data from files 
53 53
Group:		System/Libraries
54 54
55
%description -n	%{libname}
55
%description -n %{libname}
56 56
libextractor is a library used to extract meta-data from files of arbitrary 
57 57
type. It is designed to use helper-libraries to perform the actual extraction, 
58 58
and to be trivially extendable by linking against external extractors for 
... ... @@ -83,13 +84,13 @@ Common function library of libextractor.
84 84
85 85
#----------------------------------------------------------------------------
86 86
87
%package -n	%{devname}
87
%package -n %{devname}
88 88
Summary:	Libextractor library headers and development libraries
89 89
Group:		Development/Other
90 90
Requires:	%{libname} = %{EVRD}
91 91
Requires:	%{libcommon} = %{EVRD}
92 92
93
%description -n	%{devname}
93
%description -n %{devname}
94 94
Development files and headers for libextractor.
95 95
96 96
%files -n %{devname}
... ... @@ -105,6 +106,7 @@ Development files and headers for libextractor.
106 106
%setup -q
107 107
%patch0 -p1 -b .rpm5~
108 108
%patch1 -p1 -b .CVE-2017-17440~
109
%patch2 -p1
109 110
110 111
%build
111 112
autoreconf -fi

Comments