]> git.pld-linux.org Git - packages/cryptlib.git/commitdiff
- do not use sed to process makefile, it was a no-op
authorJan Rękorajski <baggins@pld-linux.org>
Tue, 22 Dec 2015 08:17:57 +0000 (09:17 +0100)
committerJan Rękorajski <baggins@pld-linux.org>
Tue, 22 Dec 2015 08:17:57 +0000 (09:17 +0100)
- fix building on x32

cryptlib.spec
optflags.patch [new file with mode: 0644]
x32.patch [new file with mode: 0644]

index 997d0e67f3d27513bc9ea1225792e212834e4e30..53fa8d9cfc81ce0597f389d98761f483bc399458 100644 (file)
@@ -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 (file)
index 0000000..03f1933
--- /dev/null
@@ -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 (file)
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
This page took 0.083821 seconds and 4 git commands to generate.