[packages/cryptlib] - do not use sed to process makefile, it was a no-op - fix building on x32

baggins baggins at pld-linux.org
Tue Dec 22 09:18:33 CET 2015


commit cc59b9791b44f807701396b2aa16fc3164190740
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Tue Dec 22 09:17:57 2015 +0100

    - do not use sed to process makefile, it was a no-op
    - fix building on x32

 cryptlib.spec  | 16 ++++++++++++++--
 optflags.patch | 15 +++++++++++++++
 x32.patch      | 20 ++++++++++++++++++++
 3 files changed, 49 insertions(+), 2 deletions(-)
---
diff --git a/cryptlib.spec b/cryptlib.spec
index 997d0e6..53fa8d9 100644
--- a/cryptlib.spec
+++ b/cryptlib.spec
@@ -13,6 +13,8 @@ Source0:	ftp://ftp.franken.de/pub/crypt/cryptlib/cl%{_ver}.zip
 # Source0-md5:	afdb94894f7f798702703f4a95a2e7ac
 Patch0:		%{name}-rdtsc.patch
 Patch1:		%{name}-soname.patch
+Patch2:		optflags.patch
+Patch3:		x32.patch
 URL:		http://www.cs.auckland.ac.nz/~pgut001/cryptlib/
 BuildRequires:	rpmbuild(macros) >= 1.710
 BuildRequires:	python-devel >= 1:2.5
@@ -85,14 +87,24 @@ Wiązania języka Python do biblioteki cryptlib.
 unzip -q -L -a %{SOURCE0}
 %patch0 -p1
 %patch1 -p1
-
-sed -i -e 's/ -O3 / %{rpmcflags} /' makefile
+%patch2 -p1
+%patch3 -p1
 
 %build
 %{__make} \
+%ifarch x32
+	OPTFLAGS="%{rpmcflags} -DOPENSSL_NO_ASM" \
+%else
+	OPTFLAGS="%{rpmcflags}" \
+%endif
 	CC="%{__cc}"
 
 %{__make} shared \
+%ifarch x32
+	OPTFLAGS="%{rpmcflags} -DOPENSSL_NO_ASM" \
+%else
+	OPTFLAGS="%{rpmcflags}" \
+%endif
 	CC="%{__cc}"
 
 ln -sf libcl.so.%{libver} libcl.so
diff --git a/optflags.patch b/optflags.patch
new file mode 100644
index 0000000..03f1933
--- /dev/null
+++ b/optflags.patch
@@ -0,0 +1,15 @@
+--- cryptlib-3.3.3/makefile.orig	2009-07-21 01:02:22.000000000 +0200
++++ cryptlib-3.3.3/makefile	2015-12-22 09:14:14.998537699 +0100
+@@ -1754,10 +1755,10 @@
+ Linux:
+ 	@if uname -m | grep "i[3,4,5,6]86" > /dev/null; then \
+ 		./tools/buildasm.sh $(AS) $(OBJPATH) ; \
+-		make $(DEFINES) EXTRAOBJS="$(ASMOBJS)" CFLAGS="$(CFLAGS) -DUSE_ASM \
++		make $(DEFINES) EXTRAOBJS="$(ASMOBJS)" CFLAGS="$(CFLAGS) $(OPTFLAGS) \
+ 			-fomit-frame-pointer -D_REENTRANT" ; \
+ 	else \
+-		make $(DEFINES) CFLAGS="$(CFLAGS) -fomit-frame-pointer -D_REENTRANT" ; \
++		make $(DEFINES) CFLAGS="$(CFLAGS) $(OPTFLAGS) -fomit-frame-pointer -D_REENTRANT" ; \
+ 	fi
+ 
+ # Mac OS X: BSD variant.  Optimisation level is set via the ccopts.sh script.
diff --git a/x32.patch b/x32.patch
new file mode 100644
index 0000000..d680e9e
--- /dev/null
+++ b/x32.patch
@@ -0,0 +1,20 @@
+--- cryptlib-3.3.3/crypt/osconfig.h~	2009-05-07 02:07:36.000000000 +0200
++++ cryptlib-3.3.3/crypt/osconfig.h	2015-12-22 09:12:29.940840903 +0100
+@@ -101,7 +101,7 @@
+ #if defined( __FreeBSD__ ) || defined( __bsdi__ ) || \
+ 	defined( __OpenBSD__ ) || defined( __NetBSD__ ) || \
+ 	defined( __linux__ )
+-  #if defined( __x86_64__ ) || defined( __amd64__ )
++  #if (defined( __x86_64__ ) || defined( __amd64__ )) && !defined(__ILP32__)
+ 	/* 64-bit x86 has both 'long' and 'long long' as 64 bits.  In addition
+ 	   we use DES_INT since int's are 64-bit.  We have to check for the
+ 	   64-bit x86 variants before the generic ones because they're a
+@@ -115,7 +115,7 @@
+ 	#define DES_RISC1
+ 	#define DES_UNROLL
+ 	#define RC4_INDEX
+-  #elif defined( __i386__ )
++  #elif defined( __i386__ ) || ((defined( __x86_64__ ) || defined( __amd64__ )) && defined(__ILP32__))
+ 	#define L_ENDIAN
+ 	#define BN_LLONG
+ 	#define DES_PTR
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/cryptlib.git/commitdiff/cc59b9791b44f807701396b2aa16fc3164190740



More information about the pld-cvs-commit mailing list