From 139b51df96527520cea9cb8c887b69366dca6fdb Mon Sep 17 00:00:00 2001 From: Matthias Saou Date: Mon, 22 Dec 2008 09:24:20 +0000 Subject: [PATCH] Patch _config.h to make it identical for 32bit and 64bit archs (#343521). --- zziplib-0.13.49-multilib.patch | 39 ++++++++++++++++++++++++++++++++++ zziplib.spec | 14 ++++++++++-- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 zziplib-0.13.49-multilib.patch diff --git a/zziplib-0.13.49-multilib.patch b/zziplib-0.13.49-multilib.patch new file mode 100644 index 0000000..7020c66 --- /dev/null +++ b/zziplib-0.13.49-multilib.patch @@ -0,0 +1,39 @@ +diff -Naupr zziplib-0.13.49.orig/zzip/_config.h zziplib-0.13.49/zzip/_config.h +--- zziplib-0.13.49.orig/zzip/_config.h 2007-03-18 12:59:51.000000000 +0100 ++++ zziplib-0.13.49/zzip/_config.h 2008-12-22 10:02:32.351372027 +0100 +@@ -130,9 +130,11 @@ + + /* whether the system defaults to 32bit off_t but can do 64bit when requested + */ ++#if __WORDSIZE == 32 + #ifndef ZZIP_LARGEFILE_SENSITIVE + #define ZZIP_LARGEFILE_SENSITIVE 1 + #endif ++#endif + + /* Name of package */ + #ifndef ZZIP_PACKAGE +@@ -171,7 +173,11 @@ + + /* The number of bytes in type long */ + #ifndef ZZIP_SIZEOF_LONG ++#if __WORDSIZE == 32 + #define ZZIP_SIZEOF_LONG 4 ++#elif __WORDSIZE == 64 ++#define ZZIP_SIZEOF_LONG 8 ++#endif + #endif + + /* The number of bytes in type short */ +@@ -194,9 +200,11 @@ + /* #undef WORDS_BIGENDIAN */ + + /* Number of bits in a file offset, on hosts where this is settable. */ ++#if __WORDSIZE == 32 + #ifndef ZZIP__FILE_OFFSET_BITS + #define ZZIP__FILE_OFFSET_BITS 64 + #endif ++#endif + + /* Define for large files, on AIX-style hosts. */ + /* #undef _LARGE_FILES */ diff --git a/zziplib.spec b/zziplib.spec index 024b276..05bf0ac 100644 --- a/zziplib.spec +++ b/zziplib.spec @@ -1,12 +1,13 @@ Summary: Lightweight library to easily extract data from zip files Name: zziplib Version: 0.13.49 -Release: 5%{?dist} +Release: 6%{?dist} License: LGPLv2+ or MPLv1.1 Group: Applications/Archiving URL: http://zziplib.sourceforge.net/ Source: http://dl.sf.net/zziplib/zziplib-%{version}.tar.bz2 Patch0: zziplib-0.13.49-open.patch +Patch1: zziplib-0.13.49-multilib.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: zlib-devel, zip, python, SDL-devel, xmlto, pkgconfig BuildRequires: autoconf, automake @@ -53,6 +54,9 @@ zziplib library. %prep %setup -q %patch0 -p1 +%patch1 -p1 +# Save the common patched _config.h file to overwrite the generated one +%{__cp} -a zzip/_config.h _config.h %build @@ -70,6 +74,9 @@ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' */libtool %install %{__rm} -rf %{buildroot} %{__make} install DESTDIR=%{buildroot} +# Overwrite the platform specific _config.h with our own modified common one +%{__rm} -f %{buildroot}%{_includedir}/zzip/_config.h +%{__install} -p -m 0644 _config.h %{buildroot}%{_includedir}/zzip/_config.h %clean @@ -103,7 +110,10 @@ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' */libtool %changelog -* Tue Feb 19 2008 Fedora Release Engineering - 0.13.49-5 +* Mon Dec 22 2008 Matthias Saou 0.13.49-6 +- Patch _config.h to make it identical for 32bit and 64bit archs (#343521). + +* Tue Feb 19 2008 Fedora Release Engineering - Autorebuild for GCC 4.3 * Wed Aug 8 2007 Matthias Saou 0.13.49-4