diff --git a/.libkdcraw.metadata b/.libkdcraw.metadata new file mode 100644 index 0000000..85e0afb --- /dev/null +++ b/.libkdcraw.metadata @@ -0,0 +1 @@ +fc124bb21db24dea02233e26f852628e10dd11d4 SOURCES/libkdcraw-4.10.5.tar.xz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/libkdcraw-4.10.0-libjpeg-turbo.patch b/SOURCES/libkdcraw-4.10.0-libjpeg-turbo.patch new file mode 100644 index 0000000..7cd2777 --- /dev/null +++ b/SOURCES/libkdcraw-4.10.0-libjpeg-turbo.patch @@ -0,0 +1,132 @@ +diff -Nur libkdcraw-4.10.0/libraw/CMakeLists.txt libkdcraw-4.10.0-libjpeg-turbo/libraw/CMakeLists.txt +--- libkdcraw-4.10.0/libraw/CMakeLists.txt 2013-01-23 23:00:43.000000000 +0100 ++++ libkdcraw-4.10.0-libjpeg-turbo/libraw/CMakeLists.txt 2013-03-09 23:58:25.000000000 +0100 +@@ -88,29 +88,26 @@ + + FIND_PACKAGE(JPEG) + IF(JPEG_FOUND) +- # check version of libjpeg +- # inspired from digikam/CMakeLists.txt +- SET(_jpeglib_version_source "#include \n#include\n#include \n int main()\n {\n #if (JPEG_LIB_VERSION >= 80) \n #error JPEG_LIB_VERSION >= 80 found \n #endif \n }\n") +- SET(_jpeglib_version_source_file ${CMAKE_BINARY_DIR}/CMakeTmp/cmake_jpeglib_version_check.cpp) +- FILE(WRITE "${_jpeglib_version_source_file}" "${_jpeglib_version_source}") +- SET(_jpeglib_version_include_dirs "-DINCLUDE_DIRECTORIES:STRING=${JPEG_INCLUDE_DIR}") ++ INCLUDE(CheckSymbolExists) + +- TRY_COMPILE(_jpeglib_version_compile_result ${CMAKE_BINARY_DIR} ${_jpeglib_version_source_file} +- CMAKE_FLAGS "${_jpeglib_version_include_dirs}" +- COMPILE_OUTPUT_VARIABLE _jpeglib_version_compile_output_var +- ) +- IF(_jpeglib_version_compile_result) +- MESSAGE(STATUS "Identified libjpeg version less than 80 (too low)") +- SET(JPEG_FOUND FALSE) +- ENDIF() ++ # check for the jpeg_mem_src function ++ SET(OLD_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") ++ LIST(APPEND CMAKE_REQUIRED_INCLUDES "${JPEG_INCLUDE_DIR}") ++ SET(OLD_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") ++ LIST(APPEND CMAKE_REQUIRED_LIBRARIES "${JPEG_LIBRARY}") ++ CHECK_SYMBOL_EXISTS(jpeg_mem_src "stddef.h;stdio.h;jpeglib.h" HAVE_JPEG_MEM_SRC) ++ SET(CMAKE_REQUIRED_INCLUDES "${OLD_CMAKE_REQUIRED_INCLUDES}") ++ SET(CMAKE_REQUIRED_LIBRARIES "${OLD_CMAKE_REQUIRED_LIBRARIES}") + ENDIF(JPEG_FOUND) + +-MACRO_LOG_FEATURE(JPEG_FOUND "libjpeg" "JPEG image format support" "http://www.ijg.org" FALSE "80" "needed for the LibRaw DNG lossy codec") ++MACRO_LOG_FEATURE(JPEG_FOUND "libjpeg" "JPEG image format support" "http://www.ijg.org" FALSE "" "needed for the LibRaw DNG lossy codec") + + # Flag to use libjpeg with LibRaw DNG lossy codec + IF(JPEG_FOUND) + ADD_DEFINITIONS(-DUSE_JPEG) +- ADD_DEFINITIONS(-DUSE_JPEG8) ++ IF(HAVE_JPEG_MEM_SRC) ++ ADD_DEFINITIONS(-DUSE_JPEG8) ++ ENDIF(HAVE_JPEG_MEM_SRC) + INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR}) + ENDIF() + +diff -Nur libkdcraw-4.10.0/libraw/RawSpeed/DngDecoderSlices.cpp libkdcraw-4.10.0-libjpeg-turbo/libraw/RawSpeed/DngDecoderSlices.cpp +--- libkdcraw-4.10.0/libraw/RawSpeed/DngDecoderSlices.cpp 2013-01-23 23:00:43.000000000 +0100 ++++ libkdcraw-4.10.0-libjpeg-turbo/libraw/RawSpeed/DngDecoderSlices.cpp 2013-03-09 23:48:29.000000000 +0100 +@@ -88,7 +88,7 @@ + + } + +-#if JPEG_LIB_VERSION < 80 ++#ifndef USE_JPEG8 + /* Read JPEG image from a memory segment */ + + static void init_source (j_decompress_ptr cinfo) {} +diff -Nur libkdcraw-4.10.0/libraw/RawSpeed/rawspeed.jpeg-version.patch libkdcraw-4.10.0-libjpeg-turbo/libraw/RawSpeed/rawspeed.jpeg-version.patch +--- libkdcraw-4.10.0/libraw/RawSpeed/rawspeed.jpeg-version.patch 1970-01-01 01:00:00.000000000 +0100 ++++ libkdcraw-4.10.0-libjpeg-turbo/libraw/RawSpeed/rawspeed.jpeg-version.patch 2013-03-09 23:48:29.000000000 +0100 +@@ -0,0 +1,13 @@ ++diff --git a/RawSpeed/DngDecoderSlices.cpp b/RawSpeed/DngDecoderSlices.cpp ++index 28a137e..617b4b3 100644 ++--- a/RawSpeed/DngDecoderSlices.cpp +++++ b/RawSpeed/DngDecoderSlices.cpp ++@@ -88,7 +88,7 @@ void DngDecoderSlices::startDecoding() { ++ ++ } ++ ++-#if JPEG_LIB_VERSION < 80 +++#ifndef USE_JPEG8 ++ /* Read JPEG image from a memory segment */ ++ ++ static void init_source (j_decompress_ptr cinfo) {} +diff -Nur libkdcraw-4.10.0/libraw/src/libraw_datastream.cpp libkdcraw-4.10.0-libjpeg-turbo/libraw/src/libraw_datastream.cpp +--- libkdcraw-4.10.0/libraw/src/libraw_datastream.cpp 2013-01-23 23:00:44.000000000 +0100 ++++ libkdcraw-4.10.0-libjpeg-turbo/libraw/src/libraw_datastream.cpp 2013-03-10 00:22:15.000000000 +0100 +@@ -443,9 +443,52 @@ + #endif + } + ++#if !defined(NO_JPEG) && !defined(USE_JPEG8) ++/* Read JPEG image from a memory segment ++ (from libraw/RawSpeed/DngDecoderSlices.cpp, LGPLv2+) */ ++ ++static void init_source (j_decompress_ptr cinfo) {} ++static boolean fill_input_buffer (j_decompress_ptr cinfo) ++{ ++ struct jpeg_source_mgr* src = (struct jpeg_source_mgr*) cinfo->src; ++ return !!src->bytes_in_buffer; ++} ++static void skip_input_data (j_decompress_ptr cinfo, long num_bytes) ++{ ++ struct jpeg_source_mgr* src = (struct jpeg_source_mgr*) cinfo->src; ++ ++ if (num_bytes > (int)src->bytes_in_buffer) ++ throw LIBRAW_EXCEPTION_IO_EOF; ++ if (num_bytes > 0) { ++ src->next_input_byte += (size_t) num_bytes; ++ src->bytes_in_buffer -= (size_t) num_bytes; ++ } ++} ++static void term_source (j_decompress_ptr cinfo) {} ++static void jpeg_mem_src (j_decompress_ptr cinfo, unsigned char* buffer, long nbytes) ++{ ++ struct jpeg_source_mgr* src; ++ ++ if (cinfo->src == NULL) { /* first time for this JPEG object? */ ++ cinfo->src = (struct jpeg_source_mgr *) ++ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, ++ sizeof(struct jpeg_source_mgr)); ++ } ++ ++ src = (struct jpeg_source_mgr*) cinfo->src; ++ src->init_source = init_source; ++ src->fill_input_buffer = fill_input_buffer; ++ src->skip_input_data = skip_input_data; ++ src->resync_to_restart = jpeg_resync_to_restart; /* use default method */ ++ src->term_source = term_source; ++ src->bytes_in_buffer = nbytes; ++ src->next_input_byte = (JOCTET*)buffer; ++} ++#endif ++ + int LibRaw_buffer_datastream::jpeg_src(void *jpegdata) + { +-#if defined(NO_JPEG) || !defined (USE_JPEG8) ++#if defined(NO_JPEG) + return -1; + #else + j_decompress_ptr cinfo = (j_decompress_ptr) jpegdata; diff --git a/SOURCES/libkdcraw-4.10.5-CVE-2013-2126.patch b/SOURCES/libkdcraw-4.10.5-CVE-2013-2126.patch new file mode 100644 index 0000000..221da0a --- /dev/null +++ b/SOURCES/libkdcraw-4.10.5-CVE-2013-2126.patch @@ -0,0 +1,24 @@ +diff -up libkdcraw-4.10.5/libraw/src/libraw_cxx.cpp.CVE-2013-2126 libkdcraw-4.10.5/libraw/src/libraw_cxx.cpp +--- libkdcraw-4.10.5/libraw/src/libraw_cxx.cpp.CVE-2013-2126 2013-07-15 14:39:22.000000000 +0200 ++++ libkdcraw-4.10.5/libraw/src/libraw_cxx.cpp 2013-07-15 14:45:31.000000000 +0200 +@@ -1055,8 +1055,8 @@ int LibRaw::unpack(void) + S.iheight= S.height; + IO.shrink = 0; + // allocate image as temporary buffer, size +- imgdata.rawdata.raw_alloc = calloc(S.iwidth*S.iheight,sizeof(*imgdata.image)); +- imgdata.image = (ushort (*)[4]) imgdata.rawdata.raw_alloc; ++ imgdata.rawdata.raw_alloc = 0; ++ imgdata.image = (ushort (*)[4]) calloc(S.iwidth*S.iheight,sizeof(*imgdata.image)); + } + ID.input->seek(libraw_internal_data.unpacker_data.data_offset, SEEK_SET); + (this->*load_raw)(); +@@ -1073,8 +1073,8 @@ int LibRaw::unpack(void) + // recover saved + if( decoder_info.decoder_flags & LIBRAW_DECODER_LEGACY) + { ++ imgdata.rawdata.raw_alloc = imgdata.rawdata.color_image = imgdata.image; + imgdata.image = 0; +- imgdata.rawdata.color_image = (ushort (*)[4]) imgdata.rawdata.raw_alloc; + } + + // recover image sizes diff --git a/SPECS/libkdcraw.spec b/SPECS/libkdcraw.spec new file mode 100644 index 0000000..b49cec8 --- /dev/null +++ b/SPECS/libkdcraw.spec @@ -0,0 +1,269 @@ +Name: libkdcraw +Summary: A C++ interface around LibRaw library +Version: 4.10.5 +Release: 2%{?dist} + +# libkdcraw is GPLv2+, +# LibRaw(bundled) is LGPLv2 +# demosaic-pack GPLv2+ GPLv3+ (addons to libraw) +License: GPLv2+ and LGPLv2 and GPLv3+ +URL: https://projects.kde.org/projects/kde/kdegraphics/libs/libkdcraw +%global revision %(echo %{version} | cut -d. -f3) +%if %{revision} >= 50 +%global stable unstable +%else +%global stable stable +%endif +Source0: http://download.kde.org/%{stable}/%{version}/src/%{name}-%{version}.tar.xz +# fix libjpeg detection for libjpeg-turbo, hopefully upstreamable +# (the hack to add jpeg_mem_src from RawSpeed to LibRaw might not be though) +Patch50: libkdcraw-4.10.0-libjpeg-turbo.patch +# upstream patches +Patch100: libkdcraw-4.10.5-CVE-2013-2126.patch +BuildRequires: kdelibs4-devel +%if 0%{?fedora} > 17 +# libjpeg-turbo-1.2.90+ provides jpeg_mem_src +%define libjpeg_ver 1.2.90 +%endif +BuildRequires: libjpeg-turbo-devel%{?libjpeg_ver: >= %{libjpeg_ver}} +BuildRequires: pkgconfig(lcms2) +BuildRequires: pkgconfig(jasper) +BuildRequires: pkgconfig(libxml-2.0) + +Requires: kdelibs4%{?_isa} >= %{_kde4_version} +%{?libjpeg_ver:Requires: libjpeg-turbo%{?_isa} >= %{libjpeg_ver}} + +# when split occurred +Conflicts: kdegraphics-libs < 7:4.6.95-10 + +# upstream plans to unbundle when libraw-1.0 is released +# see also http://mail.kde.org/pipermail/digikam-devel/2010-March/041682.html +Provides: bundled(LibRaw) +# deomosaic-pack addons to libraw +Provides: bundled(LibRaw-demosaic-pack-GPL2) +Provides: bundled(LibRaw-demosaic-pack-GPL3) + +%description +Libkdcraw is a C++ interface around LibRaw library used to decode RAW +picture files. More information about LibRaw can be found at +http://www.libraw.org. + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: kdelibs4-devel +%description devel +%{summary}. + + +%prep +%setup -q +%patch50 -p1 -b .libjpeg-turbo + +# upstream patches +%patch100 -p1 -b .CVE-2013-2126 + +# copy/rename a few things for easier inclusion as %%doc +cp -a libraw/README README.libraw +cp -a libraw/COPYRIGHT COPYRIGHT.libraw + + +%build +mkdir -p %{_target_platform} +pushd %{_target_platform} +%{cmake_kde4} -DENABLE_LCMS2=ON -DENABLE_RAWSPEED=ON .. +popd + +make %{?_smp_mflags} -C %{_target_platform} + + +%install +rm -rf %{buildroot} + +make install/fast DESTDIR=%{buildroot} -C %{_target_platform} + + +%check +export PKG_CONFIG_PATH=%{buildroot}%{_datadir}/pkgconfig:%{buildroot}%{_libdir}/pkgconfig +pkg-config --modversion libkdcraw +make -C %{_target_platform}/test + + +%post +/sbin/ldconfig +touch --no-create %{_kde4_iconsdir}/hicolor &> /dev/null || : + + +%posttrans +gtk-update-icon-cache %{_kde4_iconsdir}/hicolor &> /dev/null || : + +%postun +/sbin/ldconfig +if [ $1 -eq 0 ] ; then +touch --no-create %{_kde4_iconsdir}/hicolor &> /dev/null || : +gtk-update-icon-cache %{_kde4_iconsdir}/hicolor &> /dev/null || : +fi + + +%files +%doc AUTHORS ChangeLog COPYING NEWS README TODO +%doc COPYRIGHT.libraw README.libraw libraw/README.demosaic-packs libraw/LICENSE.LGPL +%{_kde4_libdir}/libkdcraw.so.22* +%{_kde4_appsdir}/libkdcraw/ +%{_kde4_iconsdir}/hicolor/*/*/* + +%files devel +%{_kde4_libdir}/libkdcraw.so +%{_kde4_libdir}/pkgconfig/libkdcraw.pc +%{_kde4_includedir}/libkdcraw/ + + +%changelog +* Mon Jul 15 2013 Than Ngo - 4.10.5-2 +- bz#970713, CVE-2013-2126, double-free flaw when handling + damaged full-color in Foveon and sRAW files + +* Sun Jun 30 2013 Than Ngo - 4.10.5-1 +- 4.10.5 + +* Sat Jun 01 2013 Rex Dieter - 4.10.4-1 +- 4.10.4 + +* Mon May 06 2013 Than Ngo - 4.10.3-1 +- 4.10.3 + +* Sun Mar 31 2013 Rex Dieter - 4.10.2-1 +- 4.10.2 + +* Sat Mar 09 2013 Kevin Kofler - 4.10.1-1.1 +- make libjpeg support work on Fedora 17 + +* Sat Mar 02 2013 Rex Dieter - 4.10.1-1 +- 4.10.1 + +* Fri Feb 08 2013 Rex Dieter 4.10.0-3 +- Requires: libjpeg-turbo >= 1.2.90 + +* Wed Feb 06 2013 Kevin Kofler - 4.10.0-2 +- BR libjpeg-turbo-devel >= 1.2.90, fix libjpeg detection for libjpeg-turbo + +* Thu Jan 31 2013 Rex Dieter - 4.10.0-1 +- 4.10.0 + +* Sat Jan 19 2013 Rex Dieter - 4.9.98-1 +- 4.9.98 + +* Fri Jan 04 2013 Rex Dieter - 4.9.97-1 +- 4.9.97 + +* Wed Dec 19 2012 Rex Dieter - 4.9.95-1 +- 4.9.95 + +* Mon Dec 03 2012 Rex Dieter 4.9.90-1 +- 4.9.90 (4.10 beta2) + +* Tue Nov 20 2012 Rex Dieter 4.9.80-1 +- 4.9.80 + +* Thu Nov 8 2012 Alexey Kurov - 4.9.60-1 +- libkdcraw update from digikam-3.0.0-beta3 + +* Wed Oct 24 2012 Alexey Kurov - 4.9.50-3 +- rebuild for libjpeg8 + +* Sat Oct 13 2012 Alexey Kurov - 4.9.50-2 +- BR: pkgconfig(jasper) pkgconfig(libxml-2.0) + +* Sat Oct 13 2012 Alexey Kurov - 4.9.50-1 +- libkdcraw update from digikam-3.0.0-beta2 +- enable build against lcms2 +- enable RawSpeed libraw codec + +* Fri Sep 28 2012 Rex Dieter - 4.9.2-1 +- 4.9.2 + +* Mon Sep 03 2012 Than Ngo - 4.9.1-1 +- 4.9.1 + +* Thu Jul 26 2012 Lukas Tinkl - 4.9.0-1 +- 4.9.0 + +* Thu Jul 19 2012 Fedora Release Engineering - 4.8.97-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed Jul 11 2012 Rex Dieter - 4.8.97-1 +- 4.8.97 + +* Wed Jun 27 2012 Jaroslav Reznik - 4.8.95-1 +- 4.8.95 + +* Sat Jun 09 2012 Rex Dieter - 4.8.90-1 +- 4.8.90 + +* Sat May 26 2012 Jaroslav Reznik - 4.8.80-1 +- 4.8.80 +- bump soname version to 21* + +* Mon Apr 30 2012 Jaroslav Reznik - 4.8.3-1 +- 4.8.3 + +* Fri Mar 30 2012 Jaroslav Reznik - 4.8.2-1 +- 4.8.2 + +* Mon Mar 05 2012 Jaroslav Reznik - 4.8.1-1 +- 4.8.1 + +* Tue Feb 28 2012 Fedora Release Engineering - 4.8.0-2 +- Rebuilt for c++ ABI breakage + +* Sun Jan 22 2012 Rex Dieter - 4.8.0-1 +- 4.8.0 + +* Wed Jan 04 2012 Radek Novacek - 4.7.97-1 +- 4.7.97 + +* Wed Dec 21 2011 Radek Novacek - 4.7.95-1 +- 4.7.95 + +* Sun Dec 04 2011 Rex Dieter - 4.7.90-1 +- 4.7.90 + +* Fri Nov 25 2011 Jaroslav Reznik 4.7.80-1 +- 4.7.80 (beta 1) + +* Sat Oct 29 2011 Rex Dieter 4.7.3-1 +- 4.7.3 + +* Tue Oct 04 2011 Rex Dieter 4.7.2-1 +- 4.7.2 + +* Wed Sep 07 2011 Than Ngo - 4.7.1-1 +- 4.7.1 + +* Tue Jul 26 2011 Jaroslav Reznik 4.7.0-1 +- 4.7.0 + +* Mon Jul 11 2011 Rex Dieter 4.6.95-1 +- 4.6.95 + +* Mon Jul 11 2011 Rex Dieter 4.6.90-5 +- License: GPLv2+ and LGPLv2 and GPLv3+ +- Provides: bundled(LibRaw) + +* Sun Jul 10 2011 Rex Dieter 4.6.90-4 +- fix URL +- fix scriptlets + +* Sun Jul 10 2011 Rex Dieter 4.6.90-3 +- License: GPLv2+ +- %%doc: +ChangeLog NEWS +- add %%check section + +* Wed Jul 06 2011 Rex Dieter 4.6.90-2 +- fix Source0 URL +- Conflicts: kdegraphics < 7:4.6.90-10 + +* Tue Jul 05 2011 Rex Dieter 4.6.90-1 +- first try + +