From a09887ec781c0f93b51dfa14eee276d91150cf76191c150bf4880bc18a1b1a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= Date: Wed, 1 Aug 2012 15:23:21 +0000 Subject: [PATCH] Accepting request 129499 from home:elvigia:branches:multimedia:libs - Use openssl for crypto, we have too many duplicated implementations of common digest algos - Autotools fixes. OBS-URL: https://build.opensuse.org/request/show/129499 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/libdvdread?expand=0&rev=12 --- libdvdread-no-internal-crypto.patch | 133 ++++++++++++++++++++++++++++ libdvdread.changes | 7 ++ libdvdread.spec | 17 ++-- 3 files changed, 149 insertions(+), 8 deletions(-) create mode 100644 libdvdread-no-internal-crypto.patch diff --git a/libdvdread-no-internal-crypto.patch b/libdvdread-no-internal-crypto.patch new file mode 100644 index 0000000..fff5292 --- /dev/null +++ b/libdvdread-no-internal-crypto.patch @@ -0,0 +1,133 @@ +--- src/dvd_reader.c.orig ++++ src/dvd_reader.c +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + + /* misc win32 helpers */ + #ifdef WIN32 +@@ -68,7 +69,6 @@ static inline int _private_gettimeofday( + #include "dvdread/dvd_udf.h" + #include "dvd_input.h" + #include "dvdread/dvd_reader.h" +-#include "md5.h" + + #define DEFAULT_UDF_CACHE_LEVEL 1 + +@@ -1326,7 +1326,7 @@ ssize_t DVDFileSize( dvd_file_t *dvd_fil + + int DVDDiscID( dvd_reader_t *dvd, unsigned char *discid ) + { +- struct md5_ctx ctx; ++ EVP_MD_CTX *ctx; + int title; + int nr_of_files = 0; + +@@ -1336,7 +1336,9 @@ int DVDDiscID( dvd_reader_t *dvd, unsign + + /* Go through the first 10 IFO:s, in order, + * and md5sum them, i.e VIDEO_TS.IFO and VTS_0?_0.IFO */ +- md5_init_ctx( &ctx ); ++ ctx = EVP_MD_CTX_create(); ++ EVP_DigestInit_ex(ctx, EVP_md5(), NULL); ++ + for( title = 0; title < 10; title++ ) { + dvd_file_t *dvd_file = DVDOpenFile( dvd, title, DVD_READ_INFO_FILE ); + if( dvd_file != NULL ) { +@@ -1360,15 +1362,14 @@ int DVDDiscID( dvd_reader_t *dvd, unsign + free( buffer_base ); + return -1; + } +- +- md5_process_bytes( buffer, file_size, &ctx ); +- ++ EVP_DigestUpdate(ctx, buffer, file_size); + DVDCloseFile( dvd_file ); + free( buffer_base ); + nr_of_files++; + } + } +- md5_finish_ctx( &ctx, discid ); ++ EVP_DigestFinal_ex(ctx, discid, NULL); ++ EVP_MD_CTX_destroy(ctx); + if(!nr_of_files) + return -1; + +--- src/Makefile.am.orig ++++ src/Makefile.am +@@ -2,17 +2,17 @@ include $(top_srcdir)/misc/Makefile.comm + + includedir = ${prefix}/include/dvdread + +-AM_CPPFLAGS = -I$(top_srcdir)/src ++AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/src + + lib_LTLIBRARIES = libdvdread.la + + libdvdread_la_SOURCES = dvd_reader.c nav_read.c ifo_read.c \ +- dvd_input.c dvd_udf.c md5.c nav_print.c ifo_print.c bitreader.c \ +- bswap.h dvd_input.h dvdread_internal.h dvd_udf.h md5.h bitreader.h ++ dvd_input.c dvd_udf.c nav_print.c ifo_print.c bitreader.c \ ++ bswap.h dvd_input.h dvdread_internal.h dvd_udf.h bitreader.h + +-libdvdread_la_LIBADD = $(DYNAMIC_LD_LIBS) ++libdvdread_la_LIBADD = $(DYNAMIC_LD_LIBS) $(OPENSSL_LIBS) + +-libdvdread_la_LDFLAGS = -version-info $(DVDREAD_LT_CURRENT):$(DVDREAD_LT_REVISION):$(DVDREAD_LT_AGE) \ ++libdvdread_la_LDFLAGS = -no-undefined -version-info $(DVDREAD_LT_CURRENT):$(DVDREAD_LT_REVISION):$(DVDREAD_LT_AGE) \ + -export-symbols-regex "(^dvd.*|^nav.*|^ifo.*|^DVD.*|^UDF.*)" + + include_HEADERS = dvdread/dvd_reader.h dvdread/nav_read.h dvdread/ifo_read.h \ +--- configure.ac.orig ++++ configure.ac +@@ -82,10 +82,9 @@ dnl ------------------------------------ + dnl Checks for programs. + dnl -------------------------------------------------------------- + dnl Save CFLAGS, AC_ISC_POSIX set some unwanted default CFLAGS +-saved_CFLAGS="$CFLAGS" +-AC_ISC_POSIX +-CFLAGS="$saved_CFLAGS" +-AC_PROG_CC ++AC_PROG_CC_STDC ++AC_USE_SYSTEM_EXTENSIONS ++AC_SYS_LARGEFILE + AC_PROG_MAKE_SET + AC_PROG_INSTALL + AC_PROG_LN_S +@@ -95,17 +94,7 @@ dnl Libtool + dnl -------------------------------------------------------------- + dnl LT_PREREQ only available in libtool-2.2+ + dnl LT_PREREQ([1.4.0]) +-AC_LIBTOOL_DLOPEN +-AC_DISABLE_STATIC +-AC_PROG_LIBTOOL +-AC_SUBST(LIBTOOL_DEPS) +-if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then +- STATIC="-static" +-else +- STATIC= +-fi +-AC_SUBST(STATIC) +- ++LT_INIT([disable-static pic-only]) + dnl -------------------------------------------------------------- + dnl Checks for header files. + dnl -------------------------------------------------------------- +@@ -158,14 +147,11 @@ case $host in + ;; + esac + ++PKG_CHECK_MODULES(OPENSSL, openssl) + dnl --------------------------------------------- + dnl cflags + dnl --------------------------------------------- + dnl Common cflags for all platforms +-CFLAGS="-O3 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE $CFLAGS" +-DEBUG_CFLAGS="-g -DDEBUG $CFLAGS" +- +-AC_SUBST(DEBUG_CFLAGS) + + dnl --------------------------------------------- + dnl Check for doxygen (dynamic documentation generator) diff --git a/libdvdread.changes b/libdvdread.changes index f28e34b..c984fe7 100644 --- a/libdvdread.changes +++ b/libdvdread.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Jul 31 19:08:23 UTC 2012 - crrodriguez@opensuse.org + +- Use openssl for crypto, we have too many duplicated + implementations of common digest algos +- Autotools fixes. + ------------------------------------------------------------------- Sat Dec 3 23:04:01 UTC 2011 - pascal.bleser@opensuse.org diff --git a/libdvdread.spec b/libdvdread.spec index 01323c5..520d674 100644 --- a/libdvdread.spec +++ b/libdvdread.spec @@ -1,7 +1,7 @@ # # spec file for package libdvdread # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,27 +16,27 @@ # - Name: libdvdread Summary: Library for Reading DVD Video Images -Url: http://www.mplayerhq.hu/ -License: GPLv2+ +License: GPL-2.0+ Group: Productivity/Multimedia/Other +Url: http://www.mplayerhq.hu/ Version: 4.2.0 Release: 0 Source0: http://dvdnav.mplayerhq.hu/releases/libdvdread-%{version}.tar.bz2 Source1: baselibs.conf Patch1: libdvdread-strict-aliasing.patch +Patch2: libdvdread-no-internal-crypto.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: pkg-config BuildRequires: libtool +BuildRequires: pkg-config +BuildRequires: pkgconfig(openssl) %description This package contains shared libraries for accessing DVD images (this package does not contain DeCSS algorithms). %package -n libdvdread4 -License: GPLv2+ Summary: Library for Reading DVD Video Images Group: Productivity/Multimedia/Other Provides: %{name} = %{version} @@ -47,10 +47,10 @@ This package contains shared libraries for accessing DVD images (this package does not contain DeCSS algorithms). %package devel -License: GPLv2+ Summary: Development Environment for libdvdread Group: Development/Libraries/C and C++ -Requires: libdvdread4 = %{version} glibc-devel +Requires: glibc-devel +Requires: libdvdread4 = %{version} %description devel This package contains the include-files and static libraries for @@ -59,6 +59,7 @@ libdvdread. %prep %setup -q %patch1 +%patch2 %build autoreconf -f -i -v