libggz-crypto stable port information

Package: libggz-crypto
Version: 0.0.11
Revision: 17
Description: GGZ Gaming Zone base lib, with crypto
License: LGPL
Maintainer: Dave Vasilevsky

BuildDependsOnly: true
BuildDepends: <<
libgcrypt (>= 1.2.4-2),
gnutls28,
libgpg-error
<<
Depends: %N-shlibs (= %v-%r)
Conflicts: libggz
Replaces: libggz

CustomMirror: <<
primary: http://ftp.ggzgamingzone.org/pub/
eur-be: http://ftp.belnet.be/packages/ggzgamingzone/
eur-dk: http://mirrors.sunsite.dk/ggzgamingzone/
eur-de: http://ftp.de.ggzgamingzone.org/pub/
eur-uk: http://uk.ggzgamingzone.org/pub/
eur-fr: http://ftp.fr.ggzgamingzone.org/pub/
<<
Source: mirror:custom:ggz/%v/libggz-%v.tar.gz
Source-MD5: 6a3cac71b3b444c7b46dc27d166402e4

SetCPPFLAGS: -fsigned-char
ConfigureParams: --mandir=%p/share/man --enable-debug-gdb --with-tls=GnuTLS --with-gcrypt --with-gnutls-libraries=%p/lib/gnutls28
PatchFile: %{Ni}.patch
PatchFile-MD5: b5eadf097524c4006fe62f736884af83
InstallScript: <<
#!/bin/sh -ev
make install DESTDIR=%d
perl -i -pe \
's,^dependency_libs.*$,dependency_libs=\x27 -L%p/lib -lpthread\x27,' \
%i/lib/libggz.la
<<

DocFiles: AUTHORS ChangeLog COPYING INSTALL NEWS README README.GGZ QuickStart.GGZ

Homepage: http://www.ggzgamingzone.org/
DescDetail: <<
This is the GGZ base library libggz, used by the GGZ Gaming Zone server
(ggzd), the ggzcore library and other components.
<<

SplitOff: <<
Depends: <<
libgcrypt-shlibs (>= 1.2.4-2),
gnutls28-shlibs,
libgpg-error-shlibs
<<
Conflicts: libggz-shlibs
Replaces: libggz-shlibs

Package: %N-shlibs
Files: lib/*.*.dylib
Shlibs: %p/lib/libggz.3.dylib 4.0.0 %n (>= 0.0.10-1)
DocFiles: AUTHORS ChangeLog COPYING INSTALL NEWS README README.GGZ QuickStart.GGZ
<<
DescPackaging: <<
Strip out crypto-related dependencies from .la so that using
libggz-crypto vs libggz (non-crypto) don't propagate different
lib linking.

Remove LZO option from gnutls (per other distros' libggz
packaging) because libgnutls removed this method from their
newer versions).

Uses hand-coded detection of libgnutls, so have to use its own
method of passing libdir instead of pkg-config. Sheesh!
<<

libggz-crypto stable port .patch

diff -Naur lib-old/src/Makefile.in lib-new/src/Makefile.in
--- lib-old/src/Makefile.in 2005-05-21 09:36:03.000000000 -0400
+++ lib-new/src/Makefile.in 2005-06-19 12:50:08.000000000 -0400
@@ -220,7 +220,7 @@
lib_LTLIBRARIES = libggz.la
include_HEADERS = ggz.h ggz_common.h
libggz_la_LIBADD = @LDADD@ $(top_builddir)/src/security/libggzsecurity.la
-libggz_la_LDFLAGS = -version-info 3:1:1
+libggz_la_LDFLAGS = -version-info 3:1:0
libggz_la_SOURCES = conf.c \
easysock.c \
ggz.h \
diff -Naur lib-old/src/easysock.c lib-new/src/easysock.c
--- lib-old/src/easysock.c 2005-05-14 15:51:48.000000000 -0400
+++ lib-new/src/easysock.c 2005-06-19 19:08:04.000000000 -0400
@@ -64,6 +64,7 @@
#include
#include
#include
+#include

#include "ggz.h"

@@ -150,6 +151,31 @@
return 0;
}

+int ggz_accept(const int sock) {
+ int newsock = accept(sock, NULL, NULL);
+ if (newsock < 0) {
+ if (_err_func)
+ (*_err_func) (strerror(errno), GGZ_IO_CREATE, sock, GGZ_DATA_NONE);
+ switch (errno) {
+ case EWOULDBLOCK:
+ case ECONNABORTED:
+ case EINTR:
+ return -1;
+ default:
+ return 2;
+ }
+ } else {
+ int flags;
+ flags = fcntl(newsock, F_GETFL, 0);
+ if (flags != -1)
+ flags = fcntl(newsock, F_SETFL, flags & ~O_NONBLOCK);
+ if (flags == -1 && _err_func)
+ (*_err_func) (strerror(errno), GGZ_IO_CREATE, sock, GGZ_DATA_NONE);
+
+ return newsock;
+ }
+}
+

static int es_bind(const char *host, int port)
{
diff -Naur lib-old/src/ggz.h lib-new/src/ggz.h
--- lib-old/src/ggz.h 2005-05-21 06:19:22.000000000 -0400
+++ lib-new/src/ggz.h 2005-06-19 17:24:13.000000000 -0400
@@ -1311,6 +1311,18 @@
GGZ_SOCK_CLIENT /**< Connect to a particular port of a server. */
} GGZSockType;

+/** @brief Accept a socket connection.
+ *
+ * This function accepts a new socket connection, on an existing socket,
+ * returning the new socket connection. It ensures that the new socket is
+ * blocking.
+ *
+ * @param sock The existing socket on which to accept a connection.
+ * @return File descriptor on success, -1 on an error where the call may be
+ * retried, -2 on other error
+ */
+int ggz_accept(const int sock);
+
/** @brief Make a socket connection.
*
* This function makes a TCP socket connection.
diff -Naur libggz-0.0.11.orig/src/security/ggz_tls_gnutls.c libggz-0.0.11/src/security/ggz_tls_gnutls.c
--- libggz-0.0.11.orig/src/security/ggz_tls_gnutls.c 2005-05-02 14:03:11.000000000 -0400
+++ libggz-0.0.11/src/security/ggz_tls_gnutls.c 2012-03-25 22:47:33.000000000 -0400
@@ -56,7 +56,7 @@
const int mac_priority[] = {GNUTLS_MAC_NULL, GNUTLS_MAC_MD5, GNUTLS_MAC_SHA, 0};
const int kx_priority[] = {GNUTLS_KX_ANON_DH, GNUTLS_KX_DHE_DSS, GNUTLS_KX_DHE_RSA, 0};
const int protocol_priority[] = {GNUTLS_TLS1, GNUTLS_SSL3, 0};
-const int compression_priority[] = {GNUTLS_COMP_NULL, GNUTLS_COMP_ZLIB, GNUTLS_COMP_LZO, 0};
+const int compression_priority[] = {GNUTLS_COMP_NULL, GNUTLS_COMP_ZLIB, 0};

void ggz_tls_init(const char *certfile, const char *keyfile, const char *password)
{

libggz-crypto _unstable_ port .patch