[packages/ggz-grubby] - new - silc patch contains updates for SILC 1.1 API - link patch fixes linking - libdir patch kills

qboosh qboosh at pld-linux.org
Fri Feb 1 18:05:11 CET 2013


commit 5c1c6879b0b33e2a0657de18ca1693fad2f7bfd7
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Feb 1 18:05:58 2013 +0100

    - new
    - silc patch contains updates for SILC 1.1 API
    - link patch fixes linking
    - libdir patch kills hardcoded */lib usage
    - ruby patch contains updates for Ruby 1.9 embedding API

 ggz-grubby-libdir.patch |  80 ++++++++++++
 ggz-grubby-link.patch   |  63 ++++++++++
 ggz-grubby-ruby.patch   |  63 ++++++++++
 ggz-grubby-silc.patch   | 328 ++++++++++++++++++++++++++++++++++++++++++++++++
 ggz-grubby.spec         |  94 ++++++++++++++
 5 files changed, 628 insertions(+)
---
diff --git a/ggz-grubby.spec b/ggz-grubby.spec
new file mode 100644
index 0000000..6e12b11
--- /dev/null
+++ b/ggz-grubby.spec
@@ -0,0 +1,94 @@
+#
+# Conditional build:
+%bcond_without	silc	# SILC support
+#
+Summary:	Grubby - GGZ chat bot
+Summary(pl.UTF-8):	Grubby - bot dla chatu GGZ
+Name:		ggz-grubby
+Version:	0.0.14.1
+Release:	1
+License:	GPL v2+
+Group:		X11/Applications/Games
+Source0:	http://mirrors.dotsrc.org/ggzgamingzone/ggz/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	32f8a5992ce4c9d6fde19512ea0eee5c
+Patch0:		%{name}-silc.patch
+Patch1:		%{name}-link.patch
+Patch2:		%{name}-libdir.patch
+Patch3:		%{name}-ruby.patch
+URL:		http://www.ggzgamingzone.org/
+BuildRequires:	autoconf >= 2.50
+BuildRequires:	automake
+BuildRequires:	ggz-client-libs-devel >= 0.0.14
+BuildRequires:	libggz-devel >= 0.0.14
+BuildRequires:	libtool
+BuildRequires:	perl-devel >= 1:5.6.0
+# not ready
+#BuildRequires:	php-devel >= 4
+BuildRequires:	pkgconfig
+BuildRequires:	python-devel >= 2.2
+BuildRequires:	ruby-devel >= 1.9
+%{?with_silc:BuildRequires:	silc-toolkit-devel >= 1.1}
+BuildRequires:	tcl-devel >= 8.5
+Requires:	ggz-client-libs-devel >= 0.0.14
+Requires:	libggz-devel >= 0.0.14
+%{?with_silc:Requires:	silc-toolkit >= 1.1}
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+This package contains grubby, the almighty chatbot. It's a single
+binary, but it is very flexible and extensible by plugins and scripts.
+
+%description -l pl.UTF-8
+Ten pakiet zawiera program grubby - wszechmocnego bota dla czatu GGZ.
+Jest to pojedyncza binarka, ale jest bardzo elastyczna i rozszerzalna
+poprzez wtyczki i skrypty.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+
+%build
+%{__libtoolize}
+%{__aclocal} -I m4 -I m4/ggz
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/grubby/*modules/*.{la,a}
+
+%find_lang grubby
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files -f grubby.lang
+%defattr(644,root,root,755)
+%doc AUTHORS ChangeLog NEWS README README.GGZ TODO
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ggz.modules
+%attr(755,root,root) %{_bindir}/grubby
+%attr(755,root,root) %{_bindir}/grubby-config
+%attr(755,root,root) %{_libdir}/ggz/guru-chess
+%attr(755,root,root) %{_libdir}/ggz/guru-ttt
+%dir %{_libdir}/grubby
+%dir %{_libdir}/grubby/coremodules
+%attr(755,root,root) %{_libdir}/grubby/coremodules/libguru_*.so
+%dir %{_libdir}/grubby/modules
+%attr(755,root,root) %{_libdir}/grubby/modules/libgurumod_*.so
+%dir %{_datadir}/grubby
+%attr(755,root,root) %{_datadir}/grubby/*.pl
+%attr(755,root,root) %{_datadir}/grubby/*.rb
+%{_mandir}/man1/grubby-config.1*
+%{_mandir}/man6/grubby.6*
+%lang(de) %{_mandir}/de/man1/grubby-config.1*
+%lang(de) %{_mandir}/de/man6/grubby.6*
diff --git a/ggz-grubby-libdir.patch b/ggz-grubby-libdir.patch
new file mode 100644
index 0000000..ec9e7ed
--- /dev/null
+++ b/ggz-grubby-libdir.patch
@@ -0,0 +1,80 @@
+--- ggz-grubby-0.0.14.1/configure.ac.orig	2013-02-01 15:08:02.704455518 +0100
++++ ggz-grubby-0.0.14.1/configure.ac	2013-02-01 16:44:15.784335188 +0100
+@@ -61,15 +61,11 @@
+ 	echo -n "Extra check: perl... "
+ 
+ 	inc=`perl -MConfig -e 'print "$Config{archlibexp}/CORE"' 2>/dev/null`
+-	incs="$inc /usr/lib/perl/5.8.0/CORE /usr/lib/perl/5.6.1/CORE /usr/lib/perl/5.6.0/CORE"
++	incs="$inc"
+ 	AC_GGZ_FIND_FILE("perl.h", $incs, perl_incdir)
+ 	perl_includes="$perl_incdir"
+ 
+-	libs="/usr/local/lib /usr/lib"
+-	AC_GGZ_FIND_FILE("libperl.so", $libs, perl_libdir)
+-	perl_libraries="$perl_libdir"
+-
+-	if test "x$perl_includes" = "xNO" || test "x$perl_libraries" = "xNO"; then
++	if test "x$perl_includes" = "xNO" ; then
+ 		AC_MSG_RESULT(no.)
+ 		perl_includes=""
+ 		perl_libraries=""
+@@ -124,18 +120,15 @@
+ 	echo -n "Extra check: python... "
+ 
+ 	usever=""
+-	for ver in 2.2 2.3 2.4; do
++	for ver in 2.2 2.3 2.4 2.5 2.6 2.7; do
+ 		incs="/usr/local/include/python$ver /usr/include/python$ver"
+ 		AC_GGZ_FIND_FILE("Python.h", $incs, python_incdir)
+ 
+-		libs="/usr/local/lib /usr/lib"
+-		AC_GGZ_FIND_FILE(libpython$ver.so, $libs, python_libdir)
+-
+-		if test "x$python_incdir" = "xNO" || test "x$python_libdir" = "xNO"; then
++		if test "x$python_incdir" = "xNO" ; then
+ 			this_is_not_the_right_version=1
+ 		else
+-			python_includes="-I $python_incdir"
+-			python_libraries="-L $python_libdir -lpython$ver"
++			python_includes="-I$python_incdir"
++			python_libraries="-lpython$ver"
+ 			usever=$ver
+ 			enable_python=yes
+ 		fi
+@@ -154,23 +147,19 @@
+ if test "$enable_tcl" = yes; then
+ 	echo -n "Extra check: tcl... "
+ 
+-	incs="/usr/include/tcl8.4"
++	incs="/usr/include"
+ 	AC_GGZ_FIND_FILE("tcl.h", $incs, tcl_incdir)
+ 	tcl_includes="$tcl_incdir"
+ 
+-	libs="/usr/lib"
+-	AC_GGZ_FIND_FILE("libtcl8.4.so", $libs, tcl_libdir)
+-	tcl_libraries="$tcl_libdir"
+-
+-	if test "x$tcl_includes" = "xNO" || test "x$tcl_libraries" = "xNO"; then
++	if test "x$tcl_includes" = "xNO" ; then
+ 		AC_MSG_RESULT(no.)
+ 		tcl_includes=""
+ 		tcl_libraries=""
+ 		enable_tcl=no
+ 	else
+ 		AC_MSG_RESULT(ok.)
+-		tcl_includes="-I $tcl_includes"
+-		tcl_libraries="-L $tcl_libraries -ltcl8.4"
++		tcl_includes=
++		tcl_libraries="-ltcl"
+ 		AC_SUBST(tcl_includes)
+ 		AC_SUBST(tcl_libraries)
+ 		AC_DEFINE([EMBED_TCL], 1, [Define to use embedded Tcl])
+@@ -238,7 +227,7 @@
+ dnl ============
+ 
+ grubbydir="${prefix}/share/grubby"
+-grubbymoddir="${prefix}/lib/grubby"
++grubbymoddir="${libdir}/grubby"
+ 
+ AC_DEFINE_UNQUOTED([GRUBBYDIR], "${grubbydir}", [Grubby's directory])
+ 
diff --git a/ggz-grubby-link.patch b/ggz-grubby-link.patch
new file mode 100644
index 0000000..39f99c0
--- /dev/null
+++ b/ggz-grubby-link.patch
@@ -0,0 +1,63 @@
+--- ggz-grubby-0.0.14.1/grubby/src/Makefile.am.orig	2008-02-14 18:36:57.000000000 +0100
++++ ggz-grubby-0.0.14.1/grubby/src/Makefile.am	2013-01-31 21:23:51.259119715 +0100
+@@ -1,7 +1,7 @@
+ bin_PROGRAMS = grubby
+ 
+ grubby_SOURCES = guru.c main.c module.c
+-grubby_LDADD = $(LIB_GGZCORE) $(LIB_GETTEXT) $(LIB_DL)
++grubby_LDADD = $(LIB_GGZCORE) $(LIB_GGZ) $(LIB_GETTEXT) $(LIB_DL)
+ grubby_LDFLAGS = $(GGZCORE_LDFLAGS)
+ 
+ grubbydir = $(libdir)/grubby/coremodules
+@@ -17,13 +17,15 @@
+ endif
+ 
+ libguru_netggz_la_SOURCES = net.c
+-libguru_netggz_la_LIBADD = $(LIB_GGZCORE)
++libguru_netggz_la_LIBADD = $(LIB_GGZCORE) $(LIB_GGZ)
+ libguru_netggz_la_LDFLAGS = -module -avoid-version $(GGZCORE_LDFLAGS)
+ 
+ libguru_netconsole_la_SOURCES = netconsole.c
++libguru_netconsole_la_LIBADD = $(LIB_GGZ)
+ libguru_netconsole_la_LDFLAGS = -module -avoid-version
+ 
+ libguru_netirc_la_SOURCES = netirc.c
++libguru_netirc_la_LIBADD = $(LIB_GGZ)
+ libguru_netirc_la_LDFLAGS = -module -avoid-version
+ 
+ if GRUBBY_SILC
+@@ -33,6 +35,7 @@
+ endif
+ 
+ libguru_i18n_la_SOURCES = i18n.c
++libguru_i18n_la_LIBADD = $(LIB_GGZ)
+ libguru_i18n_la_LDFLAGS = -module -avoid-version
+ 
+ libguru_player_la_SOURCES = player.c
+--- ggz-grubby-0.0.14.1/grubby/modules/Makefile.am.orig	2008-01-05 20:02:42.000000000 +0100
++++ ggz-grubby-0.0.14.1/grubby/modules/Makefile.am	2013-02-01 17:52:55.327582659 +0100
+@@ -32,7 +32,7 @@
+ #libgurumod_banner_la_LDFLAGS = -module -avoid-version
+ 
+ libgurumod_embed_la_SOURCES = embed.c
+-libgurumod_embed_la_LIBADD = $(ruby_libraries) $(perl_libraries) $(python_libraries) $(tcl_libraries) $(php_libraries)
++libgurumod_embed_la_LIBADD = $(LIB_GGZ) $(ruby_libraries) $(perl_libraries) $(python_libraries) $(tcl_libraries) $(php_libraries)
+ libgurumod_embed_la_LDFLAGS = -module -avoid-version
+ 
+ libgurumod_exec_la_SOURCES = exec.c
+@@ -43,6 +43,7 @@
+ libgurumod_extra_la_LDFLAGS = -module -avoid-version
+ 
+ libgurumod_game_la_SOURCES = game.c
++libgurumod_game_la_LIBADD = $(LIB_GGZ)
+ libgurumod_game_la_LDFLAGS = -module -avoid-version
+ 
+ libgurumod_learning_la_SOURCES = learning.c
+@@ -55,6 +56,7 @@
+ libgurumod_programming_la_LDFLAGS = -module -avoid-version
+ 
+ libgurumod_self_la_SOURCES = self.c
++libgurumod_self_la_LIBADD = $(LIB_GGZ)
+ libgurumod_self_la_LDFLAGS = -module -avoid-version
+ 
+ libgurumod_simplereturn_la_SOURCES = simplereturn.c
diff --git a/ggz-grubby-ruby.patch b/ggz-grubby-ruby.patch
new file mode 100644
index 0000000..ec01493
--- /dev/null
+++ b/ggz-grubby-ruby.patch
@@ -0,0 +1,63 @@
+--- ggz-grubby-0.0.14.1/configure.ac.orig	2013-02-01 16:57:23.840985429 +0100
++++ ggz-grubby-0.0.14.1/configure.ac	2013-02-01 17:00:14.267648544 +0100
+@@ -85,7 +85,9 @@
+ if test "$enable_ruby" = yes; then
+ 	echo -n "Extra check: ruby... "
+ 
+-	incs=`ruby -r rbconfig -e 'printf("%s", Config::CONFIG@<:@"archdir"@:>@)' 2>/dev/null`
++	inc1=`ruby -r rbconfig -e 'printf("%s", Config::CONFIG@<:@"rubyhdrdir"@:>@)' 2>/dev/null`
++	inc2=`ruby -r rbconfig -e 'printf("%s/%s", Config::CONFIG@<:@"rubyhdrdir"@:>@, Config::CONFIG@<:@"arch"@:>@)' 2>/dev/null`
++	incs="$inc1 $inc2"
+ 	libs=`ruby -r rbconfig -e 'printf("%s", Config::CONFIG@<:@"libdir"@:>@)' 2>/dev/null`
+ 	rver=`ruby -r rbconfig -e 'printf("%s", Config::CONFIG@<:@"ruby_install_name"@:>@)' 2>/dev/null`
+ 
+@@ -107,8 +109,8 @@
+ 		ruby_libraries=""
+ 		enable_ruby=no
+ 	else
+-		ruby_includes="-I $ruby_includes"
+-		ruby_libraries="-L $ruby_libraries -l$rver"
++		ruby_includes="-I$inc1 -I$inc2"
++		ruby_libraries="-L$ruby_libraries -l$rver"
+ 		AC_MSG_RESULT(ok.)
+ 		AC_SUBST(ruby_includes)
+ 		AC_SUBST(ruby_libraries)
+--- ggz-grubby-0.0.14.1/grubby/modules/embed.c.orig	2008-01-05 20:02:42.000000000 +0100
++++ ggz-grubby-0.0.14.1/grubby/modules/embed.c	2013-02-01 17:50:05.344252870 +0100
+@@ -183,20 +183,21 @@
+ #ifdef EMBED_RUBY
+ 			if(type == TYPE_RUBY)
+ 			{
++				void *rbnode;
+ 				answer = rb_ary_new();
+ 				rb_define_variable("$answer", &answer);
+ 				rb_ary_push(answer, rb_str_new2(message->message));
+ 				/*rb_global_variable(&answer);*/
+ 
+ 				ruby_script("grubby-embedded");
+-				rb_load_file(script);
++				rbnode = rb_load_file(script);
+ 
+ 				switch(fork())
+ 				{
+ 					case -1:
+ 						return NULL;
+ 					case 0:
+-						ruby_run();
++						ruby_run_node(rbnode);
+ 						exit(0);
+ 						break;
+ 					default:
+@@ -205,10 +206,10 @@
+ 
+ 				if(!NIL_P(answer))
+ 				{
+-					if(RARRAY(answer)->len > 0)
++					if(RARRAY_LEN(answer) > 0)
+ 					{
+ 						tmp = rb_ary_pop(answer);
+-						message->message = STR2CSTR(tmp);
++						message->message = StringValuePtr(tmp);
+ 						return message;
+ 					}
+ 				}
diff --git a/ggz-grubby-silc.patch b/ggz-grubby-silc.patch
new file mode 100644
index 0000000..4d4b5b8
--- /dev/null
+++ b/ggz-grubby-silc.patch
@@ -0,0 +1,328 @@
+--- ggz-grubby-0.0.14.1/grubby/src/netsilc.c	2013-01-31 15:56:42.079528848 +0100
++++ grubby/grubby/src/netsilc.c	2013-01-31 19:04:55.052626802 +0100
+@@ -7,8 +7,16 @@
+ *
+ ********************************************************************/
+ 
++/* Definition to switch between 1.0 and 1.1 API of SILC */
++/*#define SILC_COMPAT 1*/
++#undef SILC_COMPAT
++
+ #include "net.h"
++#ifdef SILC_COMPAT
+ #include <silcincludes.h>
++#else
++#include <silc.h>
++#endif
+ #include <silcclient.h>
+ 
+ /* Prototypes */
+@@ -19,11 +27,19 @@
+ static void silc_private_message(SilcClient client, SilcClientConnection conn, SilcClientEntry sender,
+ 	SilcMessagePayload payload, SilcMessageFlags flags, const unsigned char *message, SilcUInt32 message_len);
+ static void silc_notify(SilcClient client, SilcClientConnection conn, SilcNotifyType type, ...);
++
++#ifdef SILC_COMPAT
+ static void silc_connected(SilcClient client, SilcClientConnection conn, SilcClientConnectionStatus status);
+ static void silc_disconnected(SilcClient client, SilcClientConnection conn, SilcStatus status, const char *message);
+ static void silc_failure(SilcClient client, SilcClientConnection conn, SilcProtocol protocol, void *failure);
++#else
++static void silc_connected(SilcClient client, SilcClientConnection conn, SilcClientConnectionStatus status,
++	SilcStatus error, const char *message, void *context);
++static void silc_running(SilcClient client, void *application);
++#endif
+ 
+ /* Unused prototypes */
++#ifdef SILC_COMPAT
+ static void no_silc_command(SilcClient client, SilcClientConnection conn, SilcClientCommandContext cmd_context,
+ 	bool success, SilcCommand command, SilcStatus status);
+ static void no_silc_command_reply(SilcClient client, SilcClientConnection conn, SilcCommandPayload cmd_payload,
+@@ -32,14 +48,30 @@
+ 	SilcGetAuthMeth completion, void *context);
+ static void no_silc_verify_public_key(SilcClient client, SilcClientConnection conn, SilcSocketType conn_type,
+ 	unsigned char *pk, SilcUInt32 pk_len, SilcSKEPKType pk_type, SilcVerifyPublicKey completion, void *context);
+-static void no_silc_ask_passphrase(SilcClient client, SilcClientConnection conn, SilcAskPassphrase completion,
+-	void *context);
+ static bool no_silc_key_agreement(SilcClient client, SilcClientConnection conn, SilcClientEntry client_entry,
+ 	const char *hostname, SilcUInt16 port, SilcKeyAgreementCallback *completion, void **context);
++#else
++static void no_silc_command_reply(SilcClient client, SilcClientConnection conn, SilcCommand command,
++	SilcStatus status, SilcStatus error, va_list ap);
++static void no_silc_command(SilcClient client, SilcClientConnection conn,
++	bool success, SilcCommand command, SilcStatus status, SilcUInt32 argc, unsigned char **argv);
++static void no_silc_get_auth_method(SilcClient client, SilcClientConnection conn, char *hostname, SilcUInt16 port,
++	SilcAuthMethod method, SilcGetAuthMeth completion, void *context);
++static void no_silc_verify_public_key(SilcClient client, SilcClientConnection conn, SilcConnectionType conn_type,
++	SilcPublicKey public_key, SilcVerifyPublicKey completion, void *context);
++static void no_silc_key_agreement(SilcClient client, SilcClientConnection conn, SilcClientEntry client_entry,
++	const char *hostname, SilcUInt16 protocol, SilcUInt16 port);
++#endif
++
++static void no_silc_ask_passphrase(SilcClient client, SilcClientConnection conn, SilcAskPassphrase completion,
++	void *context);
+ static void no_silc_ftp(SilcClient client, SilcClientConnection conn, SilcClientEntry client_entry,
+ 	SilcUInt32 session_id, const char *hostname, SilcUInt16 port);
++
++#ifdef SILC_COMPAT
+ static void no_silc_detach(SilcClient client, SilcClientConnection conn, const unsigned char *detach_data,
+ 	SilcUInt32 detach_data_len);
++#endif
+ 
+ /* Globals */
+ int status = NET_NOOP;
+@@ -52,7 +84,9 @@
+ 
+ static SilcClient client;
+ static SilcClientConnection connection;
++#ifdef SILC_COMPAT
+ static SilcPKCS pkcs;
++#endif
+ static SilcPublicKey pubkey;
+ static SilcPrivateKey privkey;
+ static SilcChannelEntry lastchannel;
+@@ -65,15 +99,21 @@
+ 	silc_notify,
+ 	no_silc_command,
+ 	no_silc_command_reply,
++#ifdef SILC_COMPAT
+ 	silc_connected,
+ 	silc_disconnected,
++#endif
+ 	no_silc_get_auth_method,
+ 	no_silc_verify_public_key,
+ 	no_silc_ask_passphrase,
++#ifdef SILC_COMPAT
+ 	silc_failure,
++#endif
+ 	no_silc_key_agreement,
+ 	no_silc_ftp,
++#ifdef SILC_COMPAT
+ 	no_silc_detach
++#endif
+ };
+ 
+ /* Set up the logfile or close it again */
+@@ -106,7 +146,7 @@
+ 	/* Add dummy field on dummy messages */
+ 	if((message) && (type == GURU_PRIVMSG))
+ 	{
+-		sprintf(realmessage, "%s %s", guruname, message);
++		snprintf(realmessage, sizeof(realmessage), "%s %s", guruname, message);
+ 		message = realmessage;
+ 	}
+ 
+@@ -209,7 +249,11 @@
+ 	fprintf(stderr, "(SILC) >> silc_hmac_register_default returns %i\n", ret);
+ 	if(!ret) status = NET_ERROR;
+ 
++#ifdef SILC_COMPAT
+ 	ret = silc_create_key_pair(NULL, 0, NULL, NULL, NULL, NULL, &pkcs, &pubkey, &privkey, FALSE);
++#else
++	ret = silc_create_key_pair(NULL, 0, NULL, NULL, NULL, NULL, &pubkey, &privkey, FALSE);
++#endif
+ 	fprintf(stderr, "(SILC) >> silc_create_key_pair returns %i\n", ret);
+ 	if(!ret) status = NET_ERROR;
+ 
+@@ -217,15 +261,31 @@
+ 	fprintf(stderr, "(SILC) >> silc_pkcs_alloc returns %i\n", ret);
+ 	if(!ret) status = NET_ERROR;*/
+ 
++#ifdef SILC_COMPAT
+ 	client->pkcs = pkcs;
+ 	client->public_key = pubkey;
+ 	client->private_key = privkey;
++#endif
+ 
++#ifdef SILC_COMPAT
+ 	ret = silc_client_init(client);
++#else
++	ret = silc_client_init(client, client->username, client->hostname, client->realname, silc_running, NULL);
++#endif
+ 	fprintf(stderr, "(SILC) >> silc_client_init returns %i\n", ret);
+ 	if(!ret) status = NET_ERROR;
+ 
++#ifdef SILC_INIT
+ 	silc_client_connect_to_server(client, NULL, 706, strdup(host), NULL);
++#else
++	ret = silc_load_key_pair(NULL, NULL, NULL, &pubkey, &privkey);
++	fprintf(stderr, "(SILC) >> silc_load_key_pair returns %i\n", ret);
++	if(!ret) status = NET_ERROR;
++
++	silc_client_run(client);
++
++	silc_client_free(client);
++#endif
+ 
+ 	/*status = NET_GOTREADY;*/
+ }
+@@ -278,13 +338,23 @@
+ 		{
+ 			case GURU_CHAT:
+ 				printf("> %s\n", token);
++#ifdef SILC_COMPAT
+ 				silc_client_send_channel_message(client, connection,
+ 					lastchannel, NULL, 0, (unsigned char*)token, strlen(token), TRUE);
++#else
++				silc_client_send_channel_message(client, connection,
++					lastchannel, NULL, 0, NULL, (unsigned char*)token, strlen(token));
++#endif
+ 				break;
+ 			case GURU_PRIVMSG:
+ 				printf("-> %s: %s\n", output->player, token);
++#ifdef SILC_COMPAT
+ 				silc_client_send_channel_message(client, connection,
+ 					lastchannel, NULL, 0, (unsigned char*)token, strlen(token), TRUE);
++#else
++				silc_client_send_channel_message(client, connection,
++					lastchannel, NULL, 0, NULL, (unsigned char*)token, strlen(token));
++#endif
+ 				break;
+ 			case GURU_ADMIN:
+ 				printf(">> %s\n", token);
+@@ -393,7 +463,12 @@
+ 	va_end(ap);
+ }
+ 
++#ifdef SILC_COMPAT
+ static void silc_connected(SilcClient client, SilcClientConnection conn, SilcClientConnectionStatus status)
++#else
++static void silc_connected(SilcClient client, SilcClientConnection conn, SilcClientConnectionStatus status,
++	SilcStatus error, const char *message, void *context)
++#endif
+ {
+ 	char *statusstr;
+ 
+@@ -421,6 +496,7 @@
+ 	/*status = NET_LOGIN;*/
+ }
+ 
++#ifdef SILC_COMPAT
+ static void silc_disconnected(SilcClient client, SilcClientConnection conn, SilcStatus status, const char *message)
+ {
+ 	fprintf(stderr, "(SILC) disconnected\n");
+@@ -434,21 +510,37 @@
+ 
+ 	status = NET_ERROR;
+ }
++#endif
+ 
++#ifdef SILC_COMPAT
+ static void no_silc_command(SilcClient client, SilcClientConnection conn, SilcClientCommandContext cmd_context,
+ 	bool success, SilcCommand command, SilcStatus status)
++#else
++static void no_silc_command(SilcClient client, SilcClientConnection conn,
++	bool success, SilcCommand command, SilcStatus status, SilcUInt32 argc, unsigned char **argv)
++#endif
+ {
+ 	fprintf(stderr, "(SILC) (NO) command\n");
+ }
+ 
++#ifdef SILC_COMPAT
+ static void no_silc_command_reply(SilcClient client, SilcClientConnection conn, SilcCommandPayload cmd_payload,
+ 	bool success, SilcCommand command, SilcStatus status, ...)
++#else
++static void no_silc_command_reply(SilcClient client, SilcClientConnection conn, SilcCommand command,
++	SilcStatus status, SilcStatus error, va_list ap)
++#endif
+ {
+ 	fprintf(stderr, "(SILC) (NO) command reply\n");
+ }
+ 
++#ifdef SILC_COMPAT
+ static void no_silc_get_auth_method(SilcClient client, SilcClientConnection conn, char *hostname, SilcUInt16 port,
+ 	SilcGetAuthMeth completion, void *context)
++#else
++static void no_silc_get_auth_method(SilcClient client, SilcClientConnection conn, char *hostname, SilcUInt16 port,
++	SilcAuthMethod method, SilcGetAuthMeth completion, void *context)
++#endif
+ {
+ 	/*InternalGetAuthMethod internal;*/
+ 
+@@ -463,12 +555,21 @@
+ 
+ 	silc_client_request_authentication_method(client, conn,
+ 		silc_get_auth_method_callback, internal);*/
+-	
++
++#ifdef SILC_COMPAT
+ 	(completion)(TRUE, SILC_AUTH_NONE, NULL, 0, context);
++#else
++	(completion)(SILC_AUTH_NONE, NULL, 0, context);
++#endif
+ }
+ 
++#ifdef SILC_COMPAT
+ static void no_silc_verify_public_key(SilcClient client, SilcClientConnection conn, SilcSocketType conn_type,
+ 	unsigned char *pk, SilcUInt32 pk_len, SilcSKEPKType pk_type, SilcVerifyPublicKey completion, void *context)
++#else
++static void no_silc_verify_public_key(SilcClient client, SilcClientConnection conn, SilcConnectionType conn_type,
++	SilcPublicKey public_key, SilcVerifyPublicKey completion, void *context)
++#endif
+ {
+ 	fprintf(stderr, "(SILC) (NO) verify public key\n");
+ 
+@@ -481,12 +582,15 @@
+ 	fprintf(stderr, "(SILC) (NO) ask passphrase\n");
+ }
+ 
++#ifdef SILC_COMPAT
+ static bool no_silc_key_agreement(SilcClient client, SilcClientConnection conn, SilcClientEntry client_entry,
+ 	const char *hostname, SilcUInt16 port, SilcKeyAgreementCallback *completion, void **context)
++#else
++static void no_silc_key_agreement(SilcClient client, SilcClientConnection conn, SilcClientEntry client_entry,
++	const char *hostname, SilcUInt16 protocol, SilcUInt16 port)
++#endif
+ {
+ 	fprintf(stderr, "(SILC) (NO) key agreement\n");
+-
+-	return TRUE;
+ }
+ 
+ static void no_silc_ftp(SilcClient client, SilcClientConnection conn, SilcClientEntry client_entry,
+@@ -495,9 +599,19 @@
+ 	fprintf(stderr, "(SILC) (NO) ftp\n");
+ }
+ 
++#ifdef SILC_COMPAT
+ static void no_silc_detach(SilcClient client, SilcClientConnection conn, const unsigned char *detach_data,
+ 	SilcUInt32 detach_data_len)
+ {
+ 	fprintf(stderr, "(SILC) (NO) detach\n");
+ }
++#endif
++
++#ifndef SILC_COMPAT
++static void silc_running(SilcClient client, void *application)
++{
++	silc_client_connect_to_server(client, NULL, pubkey, privkey,
++		client->hostname, 706, silc_connected, NULL);
++}
++#endif
+ 
+--- ggz-grubby-0.0.14.1/configure.ac.orig	2008-02-14 19:22:07.000000000 +0100
++++ ggz-grubby-0.0.14.1/configure.ac	2013-02-01 15:00:31.881131582 +0100
+@@ -213,22 +213,18 @@
+ 	echo -n "Extra check: SILC... "
+ 
+ 	incs="/usr/include/silc"
+-	libs="/usr/lib"
+ 
+ 	AC_GGZ_FIND_FILE("silcclient.h", $incs, silc_incdir)
+ 	silc_includes="$silc_incdir"
+ 
+-	AC_GGZ_FIND_FILE("libsilcclient.so", $libs, silc_libdir)
+-	silc_libraries="$silc_libdir"
+-
+ 	if test "x$silc_includes" = "xNO" || test "x$silc_libraries" = "xNO"; then
+ 		AC_MSG_RESULT(no.)
+ 		silc_includes=""
+ 		silc_libraries=""
+ 		enable_silc=no
+ 	else
+-		SILC_INCLUDES="-I $silc_includes"
+-		SILC_LDFLAGS="-L $silc_libraries"
++		SILC_INCLUDES="-I$silc_includes"
++		SILC_LDFLAGS=
+         LIB_SILC="-lsilcclient -lsilc"
+ 		AC_MSG_RESULT(ok.)
+ 		AC_SUBST(SILC_INCLUDES)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ggz-grubby.git/commitdiff/5c1c6879b0b33e2a0657de18ca1693fad2f7bfd7



More information about the pld-cvs-commit mailing list