From: Chris Z. <be...@us...> - 2002-09-18 19:09:53
|
Update of /cvsroot/fink/experimental/beren12/finkinfo/net In directory usw-pr-cvs1:/tmp/cvs-serv20692 Added Files: gift-0.10.0-20020916-1.info gift-0.10.0-20020916-1.patch Log Message: new build --- NEW FILE: gift-0.10.0-20020916-1.info --- Package: gift Version: 0.10.0-20020916 Revision: 1 Source: http://homepage.mac.com/beren/%n-%v.tar.gz Source-MD5: f7566a3c6e763539a1062de0fb7ec381 Depends: dlcompat, libvorbis0-shlibs BuildDepends: dlcompat, automake, autoconf25, libtool14, libvorbis0 Recommends: giftcurs Patch: %f.patch NoSetLDFLAGS: true SetLIBS: -L%p/lib -ldl #SetCPPFLAGS: -Ddlsym=dlsym_prepend_underscore ConfigureParams: --mandir='${prefix}/share/man' --with-zlib=/usr --disable-libdl CompileScript: << find . -name CVS -type d -print0 | xargs -0 rm -r -- ./autogen.macosx.sh %c patch < ltmain.patch ./configure %c make << InstallScript: << make install DESTDIR=%d mkdir -p %i/etc cp -r etc %i/etc/giFT mkdir -p %i/share/man/man1 cp giFT.1 %i/share/man/man1 mkdir -p %i/share/man/man5 cp gift.conf.5 %i/share/man/man5 cp OpenFT.conf.5 %i/share/man/man5 << DocFiles: doc/* AUTHORS COPYING ChangeLog NEWS README README.dev TODO Description: GNU Internet File Transfer project DescDetail: << giFT is a `recursive' acronym for `giFT: Internet File Transfer'. The giFT project is actually a collection of several components together: the giFT daemon (which acts as bridge to the actual file sharing protocols), OpenFT (a p2p network designed to exploit all the functionality giFT supports), and a user interface front-end. Note that giFT is alpha software (but it works!), and is still very much under development! You should update *often*. << DescUsage: << Make sure you run giFT-setup before using giFT. I usually open a termnial window and run giFT, and then in another window run giFT-shell or giFTcurs. man giFT, OpenFT.conf and gift.conf. They are your friends sample config files are in %p/etc/giFT this entire dir can be copied to ~/.giFT please do not beg for help on #gift. They *will* flame you if the information you seek is in the docs. You have been warned. You can ask me for help in #fink, my nick is cirdan. Just private msg me. giFT -d detaches giFT from the term. Share! (there is no meta-info or resource forks. Files with resource forks must be encoded somehow: .bin .sit .dmg, etc.) :-) << DescPort: << Fixes an rmdir call because of kernel bug in 10.1 There is limited mata information support in this version, and it does not handle resource forks. << License: GPL Maintainer: Chris Zubrzycki <be...@us...> Homepage: http://gift.sourceforge.net/ --- NEW FILE: gift-0.10.0-20020916-1.patch --- diff -ruN gift-0.10.0-20020916/OpenFT/openft.c gift-0.10.0-20020916.new/OpenFT/openft.c --- gift-0.10.0-20020916/OpenFT/openft.c Mon Sep 16 23:41:52 2002 +++ gift-0.10.0-20020916.new/OpenFT/openft.c Mon Sep 16 23:43:38 2002 @@ -231,7 +231,7 @@ share_comp_write (); /* delete any host shares left over from previous search node sessions */ - file_rmdir (gift_conf_path ("OpenFT/db/")); + file_rmdir (gift_conf_path ("OpenFT/db")); /* OpenFT, here we come :) */ node_maintain_links (NULL); diff -ruN gift-0.10.0-20020916/OpenFT/openft.c~ gift-0.10.0-20020916.new/OpenFT/openft.c~ --- gift-0.10.0-20020916/OpenFT/openft.c~ Wed Dec 31 19:00:00 1969 +++ gift-0.10.0-20020916.new/OpenFT/openft.c~ Mon Sep 16 23:41:52 2002 @@ -0,0 +1,240 @@ +/* + * openft.c + * + * Copyright (C) 2001-2002 giFT project (gift.sourceforge.net) + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + */ + +/* hack hack hack */ +#define __OPENFT_C__ + +#include <signal.h> + +#include "openft.h" + +#include "netorg.h" + +#include "share_comp.h" +#include "search.h" +#include "daemon.h" + +#include "xfer.h" +#include "html.h" + +#include "file.h" +#include "parse.h" + +#include "md5.h" + +/*****************************************************************************/ + +#define MAINTAIN_LINKS_TIMER (2 * MINUTES) + +/*****************************************************************************/ + +int openft_shutdown = FALSE; /* boolean that is set when OpenFT is + * shutting itself down */ + +/*****************************************************************************/ + +Config *openft_conf = NULL; /* ~/.giFT/gift.conf */ + +Connection *ft_self = NULL; /* current class information */ +Connection *http_bind = NULL; + +Protocol *openft_proto = NULL; /* OpenFT protocol plugin pointer */ + +static unsigned long ft_maint = 0; /* timer for connection maintenance */ + +/*****************************************************************************/ + +/* handle share actions for giFT */ +static void ft_daemon_share (FileShare *file, ProtocolCommand command, + void *data) +{ + switch (command) + { + case PROTOCOL_SHARE_ADD: ft_share_local_add (file); break; + case PROTOCOL_SHARE_REMOVE: ft_share_local_remove (file); break; + case PROTOCOL_SHARE_FLUSH: ft_share_local_flush (); break; + case PROTOCOL_SHARE_SYNC: ft_share_local_sync (); break; + default: break; + } +} + +/*****************************************************************************/ + +static Connection *cleanup_conn (Connection *c, Node *node, void *data) +{ + node_disconnect (c); + +#if 0 + openft_share_remove_by_host (node->ip, TRUE); +#endif + + return NULL; +} + +/* shutdown */ +static void ft_daemon_destroy (Protocol *p) +{ + TRACE_FUNC (); + + hash_algo_unregister (p, "MD5"); + + /* boolean used by node_disconnect to disable certain behavior */ + openft_shutdown = TRUE; + + /* write nodes cache */ + node_update_cache (); + + /* disconnect */ + conn_clear ((ConnForeachFunc) cleanup_conn); + + /* cleanup */ + config_free (openft_conf); + + timer_remove (ft_maint); + + net_close (http_bind->fd); + net_close (ft_self->fd); + + node_free (http_bind); + node_free (ft_self); + + /* get rid of our protocol specific data */ + ft_share_local_cleanup (); +} + +/*****************************************************************************/ + +static Connection *http_start (unsigned short port) +{ + Connection *c; + + TRACE (("http_port = %hu", port)); + + c = connection_new (openft_proto); + c->fd = net_bind (port, FALSE); + + input_add (openft_proto, c, INPUT_READ, + (InputCallback) http_server_incoming, FALSE); + + node_conn_set (ft_self, 0, -1, port); + + return c; +} + +static Connection *ft_start (unsigned short klass, unsigned short port) +{ + Connection *c; + + /* firewalled users can not go beyond the user class */ + if (port == 0) + klass = NODE_USER; + +#ifndef USE_LIBDB + if (klass & NODE_SEARCH) + { + GIFT_WARN (("dropping NODE_SEARCH status due to lacking libdb " + "support")); + } + + klass &= ~NODE_SEARCH; +#endif /* !USE_LIBDB */ + + TRACE (("class = %hu, port = %hu", klass, port)); + + c = node_new (net_bind (port, FALSE)); + + input_add (openft_proto, c, INPUT_READ, + (InputCallback) ft_handle_incoming, FALSE); + + node_state_set (c, NODE_CONNECTED); + node_class_set (c, klass); + node_conn_set (c, 0, port, -1); + + if (!(NODE (c)->cap)) + NODE (c)->cap = dataset_new (DATASET_LIST); + + return c; +} + +static unsigned char *openft_hash_md5 (char *path, char *type, int *len) +{ + if (len) + *len = 16; + + return md5_digest (path, 0); +} + +/*****************************************************************************/ + +/* + * OpenFT was parsed out of /path/to/libOpenFT.so + */ +int OpenFT_init (Protocol *p) +{ + int klass; + int port; + int http_port; + + TRACE_FUNC (); + + hash_algo_register (p, "MD5", (HashAlgorithm) openft_hash_md5); + + openft_proto = p; + + /* set support */ + dataset_insert (&p->support, "range-get", 10, I_PTR (TRUE)); + dataset_insert (&p->support, "chat-user", 10, I_PTR (FALSE)); + dataset_insert (&p->support, "chat-group", 11, I_PTR (FALSE)); + + /* setup the symbols for the daemon to call */ + p->callback = ft_daemon_callback; + p->destroy = ft_daemon_destroy; + p->download = (ProtocolCallback) ft_daemon_download; /* xfer.c */ + p->upload = (ProtocolCallback) ft_daemon_upload; /* xfer.c */ + p->source_cmp = ft_daemon_source_cmp; /* xfer.c */ + p->share = (ProtocolCallback) ft_daemon_share; + + /* setup the configuration table */ + openft_conf = gift_config_new ("OpenFT"); + port = config_get_int (openft_conf, "main/port=1215"); + http_port = config_get_int (openft_conf, "main/http_port=1216"); + klass = config_get_int (openft_conf, "main/class=1"); + + /* startup the listening sockets */ + ft_self = ft_start (klass, port); + http_bind = http_start (http_port); + + /* add the capabilities */ +#ifdef USE_ZLIB + dataset_insert (&NODE (ft_self)->cap, "ZLIB", 5, STRDUP ("ZLIB")); +#endif /* USE_ZLIB */ + dataset_insert (&NODE (ft_self)->cap, "MD5-FULL", 9, STRDUP ("MD5-FULL")); + + /* setup the connection maintenance timer (2 minute intervals) */ + ft_maint = timer_add (MAINTAIN_LINKS_TIMER, + (TimerCallback) node_maintain_links, NULL); + + /* make sure ~/.giFT/OpenFT/shares.gz is up to date */ + share_comp_write (); + + /* delete any host shares left over from previous search node sessions */ + file_rmdir (gift_conf_path ("OpenFT/db/")); + + /* OpenFT, here we come :) */ + node_maintain_links (NULL); + + return TRUE; +} diff -ruN gift-0.10.0-20020916/autogen.macosx.sh gift-0.10.0-20020916.new/autogen.macosx.sh --- gift-0.10.0-20020916/autogen.macosx.sh Sat Aug 10 17:07:33 2002 +++ gift-0.10.0-20020916.new/autogen.macosx.sh Mon Sep 16 23:43:38 2002 @@ -3,8 +3,6 @@ srcdir=`dirname $0` PKG_NAME="giFT" -export LDFLAGS="-ldl -L/sw/lib -lltdl -L../OpenFT/.libs" - DIE=0 (autoconf --version) < /dev/null > /dev/null 2>&1 || { @@ -50,25 +48,6 @@ exit 1 fi -if test -z "$*"; then - echo "I am going to run \`configure' with the default arguments." - echo "If you wish to pass any other to it, please specify them on the" - echo \`$0\'" command line." - echo - 1="ppc" - 2="--disable-libdl" - 3="--with-zlib=/sw" - echo "Default is:" - echo "./configure $*" - echo -else - echo "**Warning**: To compile giFT on Mac OS X you must specify" - echo "\"ppc\" as the host and "--disable-libdl" as parameters" - echo "for configure. Otherwise giFT will not compile." - echo - echo "Parameters are:" - echo "./configure $*" -fi case $CC in xlc ) diff -ruN gift-0.10.0-20020916/configure.ac gift-0.10.0-20020916.new/configure.ac --- gift-0.10.0-20020916/configure.ac Mon Sep 16 23:41:50 2002 +++ gift-0.10.0-20020916.new/configure.ac Tue Sep 17 00:27:02 2002 @@ -291,7 +291,7 @@ if test x$use_libdb = xyes then for dbname in db-4 db4 db-4.0 db; do - AC_CHECK_LIB($dbname, db_create_4000, + AC_CHECK_LIB($dbname, db_create, [ LIBDB_CFLAGS= LIBDB_LIBS="-l$dbname" AC_SUBST(LIBDB_CFLAGS) @@ -309,7 +309,7 @@ dnl Check for the presence of ZLIB libraries and headers dnl ########################################################################### -ZLIB_VER=1.1.4 +ZLIB_VER=1.1.3 dnl Default to compiler & linker defaults for files & libraries. OPT_ZLIB= diff -ruN gift-0.10.0-20020916/ltmain.patch gift-0.10.0-20020916.new/ltmain.patch --- gift-0.10.0-20020916/ltmain.patch Wed Dec 31 19:00:00 1969 +++ gift-0.10.0-20020916.new/ltmain.patch Mon Sep 16 23:43:38 2002 @@ -0,0 +1,62 @@ +--- ltmain.sh.orig 2002-06-22 21:27:18.000000000 -0400 ++++ ltmain.sh 2002-06-22 21:27:52.000000000 -0400 +@@ -1739,7 +1739,7 @@ + + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" +- need_relink=yes ++ need_relink=no + fi + + if test -n "$old_archive_from_expsyms_cmds"; then +@@ -1884,7 +1884,11 @@ + add="-l$name" + else + # We cannot seem to hardcode it, guess we'll fake it. +- add_dir="-L$libdir" ++ if test "X$installed" = Xyes; then ++ add_dir="-L$libdir" ++ else ++ add_dir="-L$DESTDIR$libdir" ++ fi + add="-l$name" + fi + +@@ -4146,12 +4150,21 @@ + esac + + # Add the libdir to current_libdirs if it is the destination. ++ DESTDIR= + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else ++ case "$destdir" in ++ *"$libdir") ++ DESTDIR=`$echo "$destdir" | sed -e 's!'"$libdir"'$!!'` ++ if test "X$destdir" != "X$DESTDIR$libdir"; then ++ DESTDIR= ++ fi ++ ;; ++ esac + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; +@@ -4165,6 +4178,7 @@ + + if test -n "$relink_command"; then + $echo "$modename: warning: relinking \`$file'" 1>&2 ++ export DESTDIR + $show "$relink_command" + if $run eval "$relink_command"; then : + else +@@ -4172,6 +4186,7 @@ + continue + fi + fi ++ unset DESTDIR + + # See the names of the shared library. + set dummy $library_names |