summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2012-02-04 09:13:59 +0100
committerRemi Collet <fedora@famillecollet.com>2012-02-04 09:13:59 +0100
commit382118baf6b037764e0bc4fdb17ee6089c93f4af (patch)
tree39c7eba72216d98e00825b0dca523f570e978769
parent77746f2ac32095e84cd3bcb95c282cbb5d7aed53 (diff)
libzip: improves multiarch headers (ex from MySQL)
-rw-r--r--libzip.spec14
-rw-r--r--zipconf.h26
2 files changed, 37 insertions, 3 deletions
diff --git a/libzip.spec b/libzip.spec
index 01873f5..4cbe3c5 100644
--- a/libzip.spec
+++ b/libzip.spec
@@ -1,12 +1,14 @@
Name: libzip2
Version: 0.10
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: C library for reading, creating, and modifying zip archives
Group: Applications/File
License: BSD
URL: http://www.nih.at/libzip/index.html
Source0: http://www.nih.at/libzip/libzip-%{version}.tar.bz2
+# to handle multiarch heder, ex from mysql-devel package
+Source1: zipconf.h
Patch0: libzip-0.10-php.patch
@@ -62,6 +64,10 @@ rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p'
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
+# Handle multiarch headers
+mv $RPM_BUILD_ROOT%{_libdir}/libzip/include/zipconf.h \
+ $RPM_BUILD_ROOT%{_includedir}/zipconf_$(uname -i).h
+install -pm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_includedir}/zipconf.h
%clean
rm -rf $RPM_BUILD_ROOT
@@ -86,14 +92,16 @@ rm -rf $RPM_BUILD_ROOT
%files devel
%defattr(-,root,root,-)
-%{_includedir}/zip.h
+%{_includedir}/zip*.h
%{_libdir}/libzip.so
-%{_libdir}/libzip/include/zipconf.h
%{_libdir}/pkgconfig/libzip.pc
%{_mandir}/man3/*zip*
%changelog
+* Sat Feb 04 2012 Remi Collet <Fedora@FamilleCollet.com> 0.10-2
+- improves multiarch headers (ex from MySQL)
+
* Sun Mar 20 2011 Remi Collet <Fedora@FamilleCollet.com> 0.10-1
- update to 0.10
- rename to libzip2 and split libs in sub package
diff --git a/zipconf.h b/zipconf.h
new file mode 100644
index 0000000..89a6da1
--- /dev/null
+++ b/zipconf.h
@@ -0,0 +1,26 @@
+/*
+ * Kluge to support multilib installation of both 32 and 64-bit RPMS:
+ * we need to arrange that header files that appear in both RPMs are
+ * identical. Hence, this file is architecture-independent and calls
+ * in an arch-dependent file that will appear in just one RPM.
+ *
+ * To avoid breaking arches not explicitly supported by Fedora, we
+ * use this indirection file *only* on known multilib arches.
+ */
+#if defined(__x86_64__)
+#include "zipconf_x86_64.h"
+#elif defined(__i386__)
+#include "zipconf_i386.h"
+#elif defined(__ppc64__) || defined(__powerpc64__)
+#include "zipconf_ppc64.h"
+#elif defined(__ppc__) || defined(__powerpc__)
+#include "zipconf_ppc.h"
+#elif defined(__s390x__)
+#include "zipconf_s390x.h"
+#elif defined(__s390__)
+#include "zipconf_s390.h"
+#elif defined(__sparc__) && defined(__arch64__)
+#include "zipconf_sparc64.h"
+#elif defined(__sparc__)
+#include "zipconf_sparc.h"
+#endif