[libmcrypto] Initial commit (see review request in rhbz #626699)
Peter Lemenkov
peter at fedoraproject.org
Mon Oct 11 18:40:31 UTC 2010
commit dff78f672d00a876d94bbabc0367ab92a78edfdb
Author: Peter Lemenkov <lemenkov at gmail.com>
Date: Mon Oct 11 22:40:31 2010 +0400
Initial commit (see review request in rhbz #626699)
Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
.gitignore | 1 +
...0001-Fix-building-with-gnutls-and-new-GCC.patch | 39 ++++++++++
...02-Compile-OpenSSL-module-with-newest-GCC.patch | 38 ++++++++++
libmcrypto-0003-Compile-with-OpenSSL-1.0.patch | 54 ++++++++++++++
libmcrypto.spec | 77 ++++++++++++++++++++
sources | 1 +
6 files changed, 210 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..40a6956 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/libmcrypto-0.8.0.tar.bz2
diff --git a/libmcrypto-0001-Fix-building-with-gnutls-and-new-GCC.patch b/libmcrypto-0001-Fix-building-with-gnutls-and-new-GCC.patch
new file mode 100644
index 0000000..e88d2f7
--- /dev/null
+++ b/libmcrypto-0001-Fix-building-with-gnutls-and-new-GCC.patch
@@ -0,0 +1,39 @@
+From af20c682e56659d478cd54c7479f642d983aa9b4 Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Mon, 23 Aug 2010 23:33:53 +0400
+Subject: [PATCH 1/3] Fix building with gnutls and new GCC
+
+Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+---
+ source/gnutls/TlsSocket.cxx | 2 ++
+ source/gnutls/cert.cxx | 1 +
+ 2 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/source/gnutls/TlsSocket.cxx b/source/gnutls/TlsSocket.cxx
+index 18f379b..06e1a71 100644
+--- a/source/gnutls/TlsSocket.cxx
++++ b/source/gnutls/TlsSocket.cxx
+@@ -31,6 +31,8 @@
+ #include <libmcrypto/gnutls/TlsSocket.h>
+ #include <libmcrypto/TlsException.h>
+
++#include <cstdio>
++
+ using namespace std;
+
+ /************************************************************************/
+diff --git a/source/gnutls/cert.cxx b/source/gnutls/cert.cxx
+index 9bc8832..2a04e69 100644
+--- a/source/gnutls/cert.cxx
++++ b/source/gnutls/cert.cxx
+@@ -33,6 +33,7 @@
+ #include <sys/mman.h>
+
+ #include<iostream>
++#include<cstdio>
+
+ using namespace std;
+
+--
+1.7.2.1
+
diff --git a/libmcrypto-0002-Compile-OpenSSL-module-with-newest-GCC.patch b/libmcrypto-0002-Compile-OpenSSL-module-with-newest-GCC.patch
new file mode 100644
index 0000000..61c4bd4
--- /dev/null
+++ b/libmcrypto-0002-Compile-OpenSSL-module-with-newest-GCC.patch
@@ -0,0 +1,38 @@
+From fed9ac30a34c64c790127fdd195c6c74b25651a6 Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Tue, 24 Aug 2010 10:08:26 +0400
+Subject: [PATCH 2/3] Compile OpenSSL module with newest GCC
+
+Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+---
+ source/openssl/cert.cxx | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/source/openssl/cert.cxx b/source/openssl/cert.cxx
+index 05b4fa0..8e6c868 100644
+--- a/source/openssl/cert.cxx
++++ b/source/openssl/cert.cxx
+@@ -488,9 +488,9 @@ vector<string> OsslCertificate::getAltName( SubjectAltName type ){
+ return output;
+ }
+
+- int altNamesCount = sk_GENERAL_NAME_num( altNames );
++ int altNamesCount = sk_GENERAL_NAMES_num( altNames );
+ for( int i=0; i < altNamesCount; i++ ){
+- GENERAL_NAME * name = sk_GENERAL_NAME_value( altNames, i );
++ GENERAL_NAME * name = (GENERAL_NAME *)sk_GENERAL_NAMES_value( altNames, i );
+
+ if( name->type == genType ){
+ ASN1_IA5STRING * ia5 = NULL;
+@@ -512,7 +512,7 @@ vector<string> OsslCertificate::getAltName( SubjectAltName type ){
+
+ }
+
+- GENERAL_NAMES_free( altNames );
++ sk_GENERAL_NAMES_free( altNames );
+ altNames = NULL;
+
+ return output;
+--
+1.7.2.1
+
diff --git a/libmcrypto-0003-Compile-with-OpenSSL-1.0.patch b/libmcrypto-0003-Compile-with-OpenSSL-1.0.patch
new file mode 100644
index 0000000..bee3422
--- /dev/null
+++ b/libmcrypto-0003-Compile-with-OpenSSL-1.0.patch
@@ -0,0 +1,54 @@
+From ed8b73389536bb9717b3637816104d91f610c132 Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Tue, 24 Aug 2010 10:09:10 +0400
+Subject: [PATCH 3/3] Compile with OpenSSL 1.0
+
+Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+---
+ source/openssl/DtlsSocket.cxx | 2 +-
+ source/openssl/TlsServerSocket.cxx | 2 +-
+ source/openssl/TlsSocket.cxx | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/source/openssl/DtlsSocket.cxx b/source/openssl/DtlsSocket.cxx
+index 30e5f65..30f635d 100644
+--- a/source/openssl/DtlsSocket.cxx
++++ b/source/openssl/DtlsSocket.cxx
+@@ -438,7 +438,7 @@ bool OdtlsSocket::initDtlsSocket( void * &ctx,
+ SSL_library_init();
+ SSL_load_error_strings();
+
+- SSL_METHOD *method = DTLSv1_method();
++ const SSL_METHOD *method = DTLSv1_method();
+ ssl_ctx = SSL_CTX_new( method );
+ if (!ssl_ctx) {
+ printf("SSL_CTX_new failed\n");
+diff --git a/source/openssl/TlsServerSocket.cxx b/source/openssl/TlsServerSocket.cxx
+index e51370a..ec72e6b 100644
+--- a/source/openssl/TlsServerSocket.cxx
++++ b/source/openssl/TlsServerSocket.cxx
+@@ -89,7 +89,7 @@ void OsslServerSocket::init( MRef<ServerSocket*> sock,
+ type = MSOCKET_TYPE_TLS;
+ this->cert_db = cert_db_;
+ this->sock = sock;
+- SSL_METHOD * meth;
++ const SSL_METHOD * meth;
+ const unsigned char * sid_ctx = (const unsigned char *)"Minisip TLS";
+
+ SSL_load_error_strings();
+diff --git a/source/openssl/TlsSocket.cxx b/source/openssl/TlsSocket.cxx
+index f7f3adb..06de8cb 100644
+--- a/source/openssl/TlsSocket.cxx
++++ b/source/openssl/TlsSocket.cxx
+@@ -121,7 +121,7 @@ void OsslSocket::OsslSocket_init( MRef<StreamSocket*> ssock, void * &ssl_ctx_,
+ type = MSOCKET_TYPE_TLS;
+ const unsigned char * sid_ctx = (const unsigned char *)"Minisip TLS";
+ SSLeay_add_ssl_algorithms();
+- SSL_METHOD *meth = SSLv23_client_method();
++ const SSL_METHOD *meth = SSLv23_client_method();
+ this->ssl_ctx = (SSL_CTX *)ssl_ctx_;
+ this->cert_db = cert_db_;
+ peerPort = ssock->getPeerPort();
+--
+1.7.2.1
+
diff --git a/libmcrypto.spec b/libmcrypto.spec
new file mode 100644
index 0000000..6015e44
--- /dev/null
+++ b/libmcrypto.spec
@@ -0,0 +1,77 @@
+Summary: A C++ library providing various cryptography related utilities
+Name: libmcrypto
+Version: 0.8.0
+Release: 0.1.20100629svn3775%{?dist}
+License: LGPLv2+
+URL: http://www.minisip.org/
+Group: System Environment/Libraries
+# svn export -r 3775 svn://svn.minisip.org/minisip/trunk/libmcrypto libmcrypto-0.8.0
+# tar cjf libmcrypto-0.8.0.tar.bz2 libmcrypto-0.8.0/
+Source0: %{name}-%{version}.tar.bz2
+Patch1: libmcrypto-0001-Fix-building-with-gnutls-and-new-GCC.patch
+Patch2: libmcrypto-0002-Compile-OpenSSL-module-with-newest-GCC.patch
+Patch3: libmcrypto-0003-Compile-with-OpenSSL-1.0.patch
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: libtool
+BuildRequires: libmutil-devel >= 0.8.0
+BuildRequires: libmnetutil-devel >= 0.8.0
+BuildRequires: openssl-devel >= 0.9.6
+BuildRequires: gnutls-devel
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+%description
+Libmcrypto is a library providing C++ cryptography related utilities.
+It is used by the Minisip project.
+
+%package devel
+Summary: Development files for the libmcrypto library
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: automake
+Requires: pkgconfig
+
+
+%description devel
+Development files for the libmcrypto library
+
+%prep
+%setup -q
+%patch1 -p1 -b .gnutls
+%patch2 -p1 -b .gcc4
+%patch3 -p1 -b .openssl10
+
+%build
+sh ./bootstrap
+%configure --disable-static
+make %{?_smp_mflags}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT install
+rm -rf $RPM_BUILD_ROOT%{_libdir}/*.la
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+
+%files
+%defattr(-,root,root,-)
+%doc AUTHORS README COPYING.LIB
+%{_libdir}/*.so.*
+
+%files devel
+%defattr(-,root,root)
+%{_libdir}/*.so
+%{_libdir}/pkgconfig/%{name}.pc
+%{_includedir}/*
+%{_datadir}/aclocal/*.m4
+
+
+%changelog
+* Mon Aug 23 2010 Peter Lemenkov <lemenkov at gmail.com> - 0.8.0-0.1.20100629svn3775
+- Initial package for Fedora
diff --git a/sources b/sources
index e69de29..4b37859 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+cf48f3a539901d86a91b167cf8cdcdfc libmcrypto-0.8.0.tar.bz2
More information about the scm-commits
mailing list