wok-current rev 5479
Up: ruby, ruby-dev (1.9.1-p378) - Added openssl 1.0 patch.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Thu May 06 01:54:19 2010 +0000 (2010-05-06) |
parents | b81679ca0820 |
children | 9b42152e4818 |
files | ruby-dev/receipt ruby/receipt ruby/stuff/openssl-1.0.patch |
line diff
1.1 --- a/ruby-dev/receipt Thu May 06 01:07:40 2010 +0000 1.2 +++ b/ruby-dev/receipt Thu May 06 01:54:19 2010 +0000 1.3 @@ -1,7 +1,7 @@ 1.4 # SliTaz package receipt. 1.5 1.6 PACKAGE="ruby-dev" 1.7 -VERSION="1.9.1-p376" 1.8 +VERSION="1.9.1-p378" 1.9 CATEGORY="development" 1.10 SHORT_DESC="Devel file for Ruby (to compile ruby-modules)." 1.11 MAINTAINER="pankso@slitaz.org" 1.12 @@ -11,8 +11,8 @@ 1.13 # Rules to gen a SliTaz package suitable for Tazpkg. 1.14 genpkg_rules() 1.15 { 1.16 - mkdir -p $fs/usr/lib/ruby/1.8/i486-linux 1.17 + mkdir -p $fs/usr/lib/ruby/1.9.1/i486-linux 1.18 cp -a $_pkg/usr/lib/*.a $fs/usr/lib 1.19 - cp -a $_pkg/usr/lib/ruby/1.8/i486-linux/*.h \ 1.20 - $fs/usr/lib/ruby/1.8/i486-linux 1.21 + cp -a $_pkg/usr/lib/ruby/1.9.1/i486-linux/*.h \ 1.22 + $fs/usr/lib/ruby/1.9.1/i486-linux 1.23 }
2.1 --- a/ruby/receipt Thu May 06 01:07:40 2010 +0000 2.2 +++ b/ruby/receipt Thu May 06 01:54:19 2010 +0000 2.3 @@ -15,6 +15,7 @@ 2.4 compile_rules() 2.5 { 2.6 cd $src 2.7 + patch -p1 < ../stuff/openssl-1.0.patch || return 1 2.8 ./configure \ 2.9 --prefix=/usr \ 2.10 --infodir=/usr/share/info \ 2.11 @@ -32,5 +33,5 @@ 2.12 cp -a $_pkg/usr/bin $fs/usr 2.13 2.14 # Remove devel files --> ruby-dev 2.15 - rm $fs/usr/lib/ruby/1.9/i486-linux/*.h 2.16 + rm $fs/usr/lib/ruby/1.9.1/i486-linux/*.h 2.17 }
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/ruby/stuff/openssl-1.0.patch Thu May 06 01:54:19 2010 +0000 3.3 @@ -0,0 +1,176 @@ 3.4 +diff -Nura ruby-1.9.1-p378.orig/ext/openssl/ossl.c ruby-1.9.1-p378/ext/openssl/ossl.c 3.5 +--- ruby-1.9.1-p378.orig/ext/openssl/ossl.c 2009-01-15 16:39:30.000000000 +0100 3.6 ++++ ruby-1.9.1-p378/ext/openssl/ossl.c 2010-04-01 07:41:19.397603813 +0200 3.7 +@@ -92,7 +92,7 @@ 3.8 + 3.9 + #define OSSL_IMPL_SK2ARY(name, type) \ 3.10 + VALUE \ 3.11 +-ossl_##name##_sk2ary(STACK *sk) \ 3.12 ++ossl_##name##_sk2ary(STACK_OF(type) *sk) \ 3.13 + { \ 3.14 + type *t; \ 3.15 + int i, num; \ 3.16 +@@ -102,7 +102,7 @@ 3.17 + OSSL_Debug("empty sk!"); \ 3.18 + return Qnil; \ 3.19 + } \ 3.20 +- num = sk_num(sk); \ 3.21 ++ num = sk_##type##_num(sk); \ 3.22 + if (num < 0) { \ 3.23 + OSSL_Debug("items in sk < -1???"); \ 3.24 + return rb_ary_new(); \ 3.25 +@@ -110,7 +110,7 @@ 3.26 + ary = rb_ary_new2(num); \ 3.27 + \ 3.28 + for (i=0; i<num; i++) { \ 3.29 +- t = (type *)sk_value(sk, i); \ 3.30 ++ t = sk_##type##_value(sk, i); \ 3.31 + rb_ary_push(ary, ossl_##name##_new(t)); \ 3.32 + } \ 3.33 + return ary; \ 3.34 +diff -Nura ruby-1.9.1-p378.orig/ext/openssl/ossl_pkcs7.c ruby-1.9.1-p378/ext/openssl/ossl_pkcs7.c 3.35 +--- ruby-1.9.1-p378.orig/ext/openssl/ossl_pkcs7.c 2008-07-22 17:34:23.000000000 +0200 3.36 ++++ ruby-1.9.1-p378/ext/openssl/ossl_pkcs7.c 2010-04-01 07:41:19.415105324 +0200 3.37 +@@ -572,12 +572,11 @@ 3.38 + return self; 3.39 + } 3.40 + 3.41 +-static STACK * 3.42 +-pkcs7_get_certs_or_crls(VALUE self, int want_certs) 3.43 ++static STACK_OF(X509) * 3.44 ++pkcs7_get_certs(VALUE self) 3.45 + { 3.46 + PKCS7 *pkcs7; 3.47 + STACK_OF(X509) *certs; 3.48 +- STACK_OF(X509_CRL) *crls; 3.49 + int i; 3.50 + 3.51 + GetPKCS7(self, pkcs7); 3.52 +@@ -585,17 +584,38 @@ 3.53 + switch(i){ 3.54 + case NID_pkcs7_signed: 3.55 + certs = pkcs7->d.sign->cert; 3.56 +- crls = pkcs7->d.sign->crl; 3.57 + break; 3.58 + case NID_pkcs7_signedAndEnveloped: 3.59 + certs = pkcs7->d.signed_and_enveloped->cert; 3.60 ++ break; 3.61 ++ default: 3.62 ++ certs = NULL; 3.63 ++ } 3.64 ++ 3.65 ++ return certs; 3.66 ++} 3.67 ++ 3.68 ++static STACK_OF(X509_CRL) * 3.69 ++pkcs7_get_crls(VALUE self) 3.70 ++{ 3.71 ++ PKCS7 *pkcs7; 3.72 ++ STACK_OF(X509_CRL) *crls; 3.73 ++ int i; 3.74 ++ 3.75 ++ GetPKCS7(self, pkcs7); 3.76 ++ i = OBJ_obj2nid(pkcs7->type); 3.77 ++ switch(i){ 3.78 ++ case NID_pkcs7_signed: 3.79 ++ crls = pkcs7->d.sign->crl; 3.80 ++ break; 3.81 ++ case NID_pkcs7_signedAndEnveloped: 3.82 + crls = pkcs7->d.signed_and_enveloped->crl; 3.83 + break; 3.84 + default: 3.85 +- certs = crls = NULL; 3.86 ++ crls = NULL; 3.87 + } 3.88 + 3.89 +- return want_certs ? certs : crls; 3.90 ++ return crls; 3.91 + } 3.92 + 3.93 + static VALUE 3.94 +@@ -610,7 +630,7 @@ 3.95 + STACK_OF(X509) *certs; 3.96 + X509 *cert; 3.97 + 3.98 +- certs = pkcs7_get_certs_or_crls(self, 1); 3.99 ++ certs = pkcs7_get_certs(self); 3.100 + while((cert = sk_X509_pop(certs))) X509_free(cert); 3.101 + rb_block_call(ary, rb_intern("each"), 0, 0, ossl_pkcs7_set_certs_i, self); 3.102 + 3.103 +@@ -620,7 +640,7 @@ 3.104 + static VALUE 3.105 + ossl_pkcs7_get_certificates(VALUE self) 3.106 + { 3.107 +- return ossl_x509_sk2ary(pkcs7_get_certs_or_crls(self, 1)); 3.108 ++ return ossl_x509_sk2ary(pkcs7_get_certs(self)); 3.109 + } 3.110 + 3.111 + static VALUE 3.112 +@@ -650,7 +670,7 @@ 3.113 + STACK_OF(X509_CRL) *crls; 3.114 + X509_CRL *crl; 3.115 + 3.116 +- crls = pkcs7_get_certs_or_crls(self, 0); 3.117 ++ crls = pkcs7_get_crls(self); 3.118 + while((crl = sk_X509_CRL_pop(crls))) X509_CRL_free(crl); 3.119 + rb_block_call(ary, rb_intern("each"), 0, 0, ossl_pkcs7_set_crls_i, self); 3.120 + 3.121 +@@ -660,7 +680,7 @@ 3.122 + static VALUE 3.123 + ossl_pkcs7_get_crls(VALUE self) 3.124 + { 3.125 +- return ossl_x509crl_sk2ary(pkcs7_get_certs_or_crls(self, 0)); 3.126 ++ return ossl_x509crl_sk2ary(pkcs7_get_crls(self)); 3.127 + } 3.128 + 3.129 + static VALUE 3.130 +diff -Nura ruby-1.9.1-p378.orig/ext/openssl/ossl_ssl.c ruby-1.9.1-p378/ext/openssl/ossl_ssl.c 3.131 +--- ruby-1.9.1-p378.orig/ext/openssl/ossl_ssl.c 2009-04-19 15:32:18.000000000 +0200 3.132 ++++ ruby-1.9.1-p378/ext/openssl/ossl_ssl.c 2010-04-01 07:41:19.450937427 +0200 3.133 +@@ -88,12 +88,18 @@ 3.134 + 3.135 + ID ID_callback_state; 3.136 + 3.137 ++#if OPENSSL_VERSION_NUMBER >= 0x10000000L 3.138 ++#define OSSL_MORE_CONST const 3.139 ++#define STACK _STACK 3.140 ++#else 3.141 ++#define OSSL_MORE_CONST 3.142 ++#endif 3.143 + /* 3.144 + * SSLContext class 3.145 + */ 3.146 + struct { 3.147 + const char *name; 3.148 +- SSL_METHOD *(*func)(void); 3.149 ++ OSSL_MORE_CONST SSL_METHOD *(*func)(void); 3.150 + } ossl_ssl_method_tab[] = { 3.151 + #define OSSL_SSL_METHOD_ENTRY(name) { #name, name##_method } 3.152 + OSSL_SSL_METHOD_ENTRY(TLSv1), 3.153 +@@ -142,7 +148,7 @@ 3.154 + static VALUE 3.155 + ossl_sslctx_set_ssl_version(VALUE self, VALUE ssl_method) 3.156 + { 3.157 +- SSL_METHOD *method = NULL; 3.158 ++ OSSL_MORE_CONST SSL_METHOD *method = NULL; 3.159 + const char *s; 3.160 + int i; 3.161 + 3.162 +@@ -585,7 +591,7 @@ 3.163 + } 3.164 + 3.165 + static VALUE 3.166 +-ossl_ssl_cipher_to_ary(SSL_CIPHER *cipher) 3.167 ++ossl_ssl_cipher_to_ary(OSSL_MORE_CONST SSL_CIPHER *cipher) 3.168 + { 3.169 + VALUE ary; 3.170 + int bits, alg_bits; 3.171 +@@ -1213,7 +1219,7 @@ 3.172 + ossl_ssl_get_cipher(VALUE self) 3.173 + { 3.174 + SSL *ssl; 3.175 +- SSL_CIPHER *cipher; 3.176 ++ OSSL_MORE_CONST SSL_CIPHER *cipher; 3.177 + 3.178 + Data_Get_Struct(self, SSL, ssl); 3.179 + if (!ssl) {