From ed46e908363484cad4403d6828aec342b4b82c10 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sat, 23 Apr 2005 15:25:26 +0000 Subject: [PATCH] SILC Map distribution added. --- Makefile.ad | 3 ++- apps/Makefile.ad | 8 ++++++-- apps/silcmap/Makefile.am | 2 +- apps/silcmap/silcmap_client.c | 8 +++++--- apps/silcmap/silcmap_command.c | 2 +- apps/silcmap/silcmap_html.c | 7 ++++--- configure.ad | 11 +++++++++++ distdir/silcmap | 19 +++++++++++++++++++ 8 files changed, 49 insertions(+), 11 deletions(-) create mode 100644 distdir/silcmap diff --git a/Makefile.ad b/Makefile.ad index e76466de..b34fc50d 100644 --- a/Makefile.ad +++ b/Makefile.ad @@ -61,6 +61,7 @@ install-dirs: -mkdir -p $(modulesdir) -mkdir -p $(docdir) +#ifdef SILC_DIST_DOC doc-install: -$(INSTALL_DATA) $(srcdir)/doc/CodingStyle $(docdir)/ -$(INSTALL_DATA) $(srcdir)/doc/FAQ $(docdir)/ @@ -71,6 +72,7 @@ doc-install: -$(INSTALL_DATA) $(srcdir)/README* $(docdir)/ -$(INSTALL_DATA) $(srcdir)/INSTALL $(docdir)/ -$(INSTALL_DATA) $(srcdir)/TODO $(docdir)/ +#endif SILC_DIST_DOC #ifdef SILC_DIST_SIM sim-install: @@ -161,5 +163,4 @@ install-data-hook: \ #endif SILC_DIST_SIM include $(top_srcdir)/Makefile.defines.in - #endif SILC_DIST_SILC diff --git a/apps/Makefile.ad b/apps/Makefile.ad index 0a01a55f..87bc7ca4 100644 --- a/apps/Makefile.ad +++ b/apps/Makefile.ad @@ -17,7 +17,11 @@ AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign -SUBDIRS = \ +SUBDIRS = \ #ifdef SILC_DIST_AUTODIST - autodist + autodist \ #endif SILC_DIST_AUTODIST +#ifdef SILC_DIST_SILCMAP + silcmap +#endif SILC_DIST_SILCMAP + diff --git a/apps/silcmap/Makefile.am b/apps/silcmap/Makefile.am index bca9cb37..7e55cd81 100644 --- a/apps/silcmap/Makefile.am +++ b/apps/silcmap/Makefile.am @@ -29,6 +29,6 @@ silcmap_SOURCES = \ LIBS = $(SILC_COMMON_LIBS) -lsilcclient -lsilc -lm LDADD = -EXTRA_DIST = *.h +EXTRA_DIST = *.h silcmap.conf example.server.com_706.pub default.fnt include $(top_srcdir)/Makefile.defines.in diff --git a/apps/silcmap/silcmap_client.c b/apps/silcmap/silcmap_client.c index 3eec5110..651bd564 100644 --- a/apps/silcmap/silcmap_client.c +++ b/apps/silcmap/silcmap_client.c @@ -305,7 +305,8 @@ static void silc_channel_message(SilcClient client, SilcClientConnection conn, SilcClientEntry sender, SilcChannelEntry channel, SilcMessagePayload payload, - SilcMessageFlags flags, const unsigned char *message, + SilcChannelPrivateKey key, SilcMessageFlags flags, + const unsigned char *message, SilcUInt32 message_len) { @@ -407,7 +408,7 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, SilcUInt32 stats_len = va_arg(va, SilcUInt32); SilcBufferStruct buf; - SILC_LOG_DEBUG(("STATS command reply")); + SILC_LOG_DEBUG(("STATS command reply from %s", conn->sock->hostname)); /* Get statistics structure */ silc_buffer_set(&buf, stats, stats_len); @@ -445,6 +446,7 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, break; default: + SILC_LOG_DEBUG(("Unsupported command reply")); break; }; @@ -479,7 +481,7 @@ silc_connected(SilcClient client, SilcClientConnection conn, silc_schedule_task_del_by_context(client->schedule, mapconn); - if (status == SILC_CLIENT_CONN_ERROR) { + if (status != SILC_CLIENT_CONN_SUCCESS) { fprintf(stderr, "Could not connect to server %s\n", conn->remote_host ? conn->remote_host : ""); silc_client_close_connection(client, conn); diff --git a/apps/silcmap/silcmap_command.c b/apps/silcmap/silcmap_command.c index fe0f8225..4b663ace 100644 --- a/apps/silcmap/silcmap_command.c +++ b/apps/silcmap/silcmap_command.c @@ -975,7 +975,7 @@ bool silc_map_commands_parse(SilcMap map, const char *filename) if (ret && ret != SILC_CONFIG_ESILENT) { fprintf(stderr, "Error parsing commands: %s, line %d\n", - silc_config_strerror(ret), silc_config_get_line(file)); + silc_config_strerror(ret), (int)silc_config_get_line(file)); retval = FALSE; } diff --git a/apps/silcmap/silcmap_html.c b/apps/silcmap/silcmap_html.c index aef23d9f..cb3c475c 100644 --- a/apps/silcmap/silcmap_html.c +++ b/apps/silcmap/silcmap_html.c @@ -153,7 +153,8 @@ bool silc_map_writehtml(SilcMap map, SilcMapConnection mapconn) fprintf(fp, "
\n"); begin = 0; - while (silc_gets(line, sizeof(line) - 1, pdd, pk_len + 1, &begin) != EOF) + while ((begin = silc_gets(line, sizeof(line) - 1, pdd, pk_len + 1, + begin)) != EOF) fprintf(fp, "%s
\n", line); fprintf(fp, "

\n"); @@ -287,8 +288,8 @@ bool silc_map_writehtml(SilcMap map, SilcMapConnection mapconn) fprintf(fp, "
\n"); begin = 0; - while (silc_gets(line, sizeof(line) - 1, mapconn->data.motd, - strlen(mapconn->data.motd), &begin) != EOF) + while ((begin = silc_gets(line, sizeof(line) - 1, mapconn->data.motd, + strlen(mapconn->data.motd), begin)) != EOF) fprintf(fp, "%s
\n", line); fprintf(fp, "
\n"); } diff --git a/configure.ad b/configure.ad index b7affd6f..c019c698 100644 --- a/configure.ad +++ b/configure.ad @@ -343,7 +343,11 @@ AC_SUBST(FIX_SHA1) #ifdef SILC_DIST_AUTODIST AC_PREFIX_DEFAULT(/usr/local) #else !SILC_DIST_AUTODIST +#ifdef SILC_DIST_SILCMAP +AC_PREFIX_DEFAULT(/usr/local) +#else !SILC_DIST_SILCMAP AC_PREFIX_DEFAULT(/usr/local/silc) +#endif SILC_DIST_SILCMAP #endif SILC_DIST_AUTODIST if test "x$prefix" != xNONE; then silc_prefix="$prefix" @@ -473,8 +477,13 @@ if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then else # pkg-config check +#ifdef SILC_DIST_SILCMAP + PKG_CHECK_MODULES(SILC, silc, compile_libs=false) + PKG_CHECK_MODULES(SILCCLIENT, silcclient, compile_libs=false) +#else !SILC_DIST_SILCMAP PKG_CHECK_MODULES(SILC, silc, compile_libs=false, compile_libs=true) PKG_CHECK_MODULES(SILCCLIENT, silcclient, compile_libs=false, compile_libs=true) +#endif SILC_DIST_SILCMAP if test x$compile_libs = xfalse; then LIBS="$LIBS $SILC_LIBS" @@ -1164,7 +1173,9 @@ echo " bin directory .................: $s_bindir" echo " sbin directory ................: $s_sbindir" echo " etc directory .................: $ETCDIR" echo " man directory .................: $s_mandir" +#ifdef SILC_DIST_DOC echo " doc directory .................: $DOCDIR" +#endif SILC_DIST_DOC #ifdef SILC_DIST_CLIENT echo " help directory ................: $HELPDIR" #endif SILC_DIST_CLIENT diff --git a/distdir/silcmap b/distdir/silcmap new file mode 100644 index 00000000..e11dbafa --- /dev/null +++ b/distdir/silcmap @@ -0,0 +1,19 @@ +name Map +package silc-map +bug-report silc-devel@lists.silcnet.org + +inherit common +define SILC_DIST_SILCMAP +define SILC_DIST_CLIENTLIB +define SILC_DIST_APPS +undef SILC_DIST_LIB +undef SILC_DIST_DOC +undef SILC_DIST_SIM +undef SILC_DIST_MATH +undef SILC_DIST_MPI + +include apps/silcmap/README README +exclude README.* CHANGES TODO CREDITS INS + +post-process-dist-hook distdir/post-process-dist +post-dist-hook distdir/post-dist -- 2.24.0