Update of /cvsroot/fink/experimental/alexkhansen/common/finkinfo/devel
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv7289/finkinfo/devel

Added Files:
        cvs-proxy.patch cvs-stable.info cvs.info 
Log Message:
restructuring

--- NEW FILE: cvs.info ---
Package: cvs
Version: 1.12.13
Revision: 11
Maintainer: Alexander Hansen <[EMAIL PROTECTED]>
#
Conflicts: cvs-stable
Replaces: cvs-stable
Source: mirror:gnu:non-gnu/%n/source/feature/%v/%n-%v.tar.bz2 
Source-MD5: 956ab476ce276c2d19d583e227dbdbea
ConfigureParams: <<
--mandir=%p/share/man\
--infodir=%p/share/info\
--with-libiconv-prefix=%p\
--with-libintl-prefix=%p\
--with-gssapi=/usr\
--with-krb4=/usr\
--enable-case-sensitivity\
--disable-dependency-tracking
<<
BuildDepends:  system-openssl-dev, libgettext3-dev, libiconv-dev
Depends: libgettext3-shlibs, libiconv
SetCPPFLAGS: -no-cpp-precomp -I%p/lib/system-openssl/include
SetLDFLAGS: -L%p/lib/system-openssl/lib
InstallScript: <<
 make install DESTDIR=%d
<<
DocFiles: <<
 BUGS COPYING* ChangeLog* DEVEL-CVS FAQ HACKING MINOR-BUGS NEWS
 PROJECTS README TESTS TODO
<<
InfoDocs: cvs.info cvsclient.info
#
Description: Version control system
DescDetail: <<
 CVS is the Concurrent Versions System, the dominant open-source
 network-transparent version control system. CVS is useful for
 everyone from individual developers to large, distributed teams:
        - Its client-server access method lets developers access the
          latest code from anywhere there's an Internet connection.
        - Its unreserved check-out model to version control avoids
          artificial conflicts common with the exclusive check-out model.
        - Its client tools are available on most platforms.
This version is based on the upstream "feature" tree.  If you need to downgrade
for any reason, either just remove the package and use the builtin version
(1.11.20 for the 2.2 and later XCode tools), or install the "cvs-stable" 
package.
<<
DescPackaging: <<
 added the configure params to comply with Fink policy
 added InfoDocs field
 enabled case sensitivity for everybody:
 "Enabling this on a case insensitive system should
  have little effect on the server or client
  operation":  from the help text in the configure script.
Uses system's OpenSSL.
 Uses zlib provided with package source.
 Prior versions by Sylvain Cuaz <[EMAIL PROTECTED]>
<<
DescPort: <<

<<
Homepage: http://www.nongnu.org/cvs/
License: GPL

--- NEW FILE: cvs-stable.info ---
Info2:<<
Package: cvs%type_pkg[-proxy]
Type: -proxy (-proxy -stable)

Version: 1.11.22
Revision: 2
Maintainer: Alexander Hansen <[EMAIL PROTECTED]>
#
Source: mirror:gnu:non-gnu/%{ni}/source/stable/%v/%{ni}-%v.tar.bz2 
Source-MD5: f24043a640509aff1aa28871dd345762
Conflicts: cvs, cvs-stable, cvs-proxy
Replaces: cvs, cvs-stable, cvs-proxy
Provides: cvs-client, cvs-server
# Patch: %n.patch
PatchScript: <<
#!/bin/bash -ev
if [ "%type_raw[-proxy]" == "-proxy" ];
then patch -p1 <%a/cvs-proxy.patch 
fi
<<
ConfigureParams: <<
--mandir=%p/share/man\
--infodir=%p/share/info\
--with-libiconv-prefix=%p\
--with-libintl-prefix=%p\
--with-gssapi=/usr\
--with-krb4=/usr\
--enable-case-sensitivity\
--disable-dependency-tracking\
--with-external-zlib
<<
BuildDepends:  system-openssl-dev
SetCPPFLAGS: -no-cpp-precomp -I%p/lib/system-openssl/include
SetLDFLAGS: -L%p/lib/system-openssl/lib
InstallScript: <<
 make install DESTDIR=%d
<<
DocFiles: <<
 BUGS COPYING* ChangeLog* DEVEL-CVS FAQ HACKING MINOR-BUGS NEWS
 PROJECTS README TESTS TODO
<<
InfoDocs: cvs.info cvsclient.info
#
Description: Version control system
DescDetail: <<
 CVS is the Concurrent Versions System, the dominant open-source
 network-transparent version control system. CVS is useful for
 everyone from individual developers to large, distributed teams:
        - Its client-server access method lets developers access the
          latest code from anywhere there's an Internet connection.
        - Its unreserved check-out model to version control avoids
          artificial conflicts common with the exclusive check-out model.
        - Its client tools are available on most platforms.
This is the most recent (as of 7/20/06) version in the upstream "stable" tree.
<<
DescPackaging: <<
 added the configure params to comply with Fink policy
 added InfoDocs field
 enabled case sensitivity for everybody:
 "Enabling this on a case insensitive system should
  have little effect on the server or client
  operation":  from the help text in the configure script.
Uses system's OpenSSL.
 Uses system's zlib.
 Prior versions by Sylvain Cuaz <[EMAIL PROTECTED]> 
 Prior -proxy version by Max Horn <[EMAIL PROTECTED]>
<<
DescPort: <<
 added patch to enable HTTP Proxy support (based on that by Max Horn in prior
 version )
<<
Homepage: http://www.nongnu.org/cvs/
License: GPL
<<
--- NEW FILE: cvs-proxy.patch ---
diff -ru cvs-1.11.5/src/client.c cvs-1.11.5-patched/src/client.c
--- cvs-1.11.5/src/client.c     2003-01-16 16:10:55.000000000 +0100
+++ cvs-1.11.5-patched/src/client.c     2003-01-23 14:35:33.000000000 +0100
@@ -134,6 +134,7 @@
 
 static size_t try_read_from_server PROTO ((char *, size_t));
 
+static void proxy_connect PROTO ((cvsroot_t *, int));
 static void auth_server PROTO ((cvsroot_t *, struct buffer *, struct buffer *,
                                int, int, struct hostent *));
 
@@ -3884,7 +3885,7 @@
     int port_number;
     struct sockaddr_in client_sai;
     struct hostent *hostinfo;
-    struct buffer *to_server, *from_server;
+    struct buffer *local_to_server, *local_from_server;
 
     sock = socket (AF_INET, SOCK_STREAM, 0);
     if (sock == -1)
@@ -3892,7 +3893,17 @@
        error (1, 0, "cannot create socket: %s", SOCK_STRERROR (SOCK_ERRNO));
     }
     port_number = get_cvs_port_number (root);
-    hostinfo = init_sockaddr (&client_sai, root->hostname, port_number);
+
+    /* if we have a proxy connect to that instead */
+    if (root->proxy)
+    {
+       hostinfo = init_sockaddr (&client_sai, root->proxy, root->proxy_port);
+    }
+    else
+    {
+       hostinfo = init_sockaddr (&client_sai, root->hostname, port_number);
+    }
+
     if (trace)
     {
        fprintf (stderr, " -> Connecting to %s(%s):%d\n",
@@ -3902,29 +3913,41 @@
     if (connect (sock, (struct sockaddr *) &client_sai, sizeof (client_sai))
        < 0)
        error (1, 0, "connect to %s(%s):%d failed: %s",
-              root->hostname,
+              root->proxy ? root->proxy : root->hostname,
               inet_ntoa (client_sai.sin_addr),
-              port_number, SOCK_STRERROR (SOCK_ERRNO));
+              root->proxy ? root->proxy_port : port_number,
+              SOCK_STRERROR (SOCK_ERRNO));
 
-    make_bufs_from_fds (sock, sock, 0, &to_server, &from_server, 1);
+    make_bufs_from_fds (sock, sock, 0, &local_to_server, &local_from_server, 
1);
 
-    auth_server (root, to_server, from_server, verify_only, do_gssapi, 
hostinfo);
+    if (root->proxy)
+    {
+       // REALLY ugly hack to allow proxy_connect() to use send_to_server().
+       // The proper fix would be to remove the global to_server & from_server
+       // variables, and instead let send_to_server() etc. take the target
+       // server struct as a paramter.
+       to_server = local_to_server;
+       from_server = local_from_server;
+       proxy_connect (root, port_number);
+    }
+
+    auth_server (root, local_to_server, local_from_server, verify_only, 
do_gssapi, hostinfo);
 
     if (verify_only)
     {
        int status;
 
-       status = buf_shutdown (to_server);
+       status = buf_shutdown (local_to_server);
        if (status != 0)
            error (0, status, "shutting down buffer to server");
-       buf_free (to_server);
-       to_server = NULL;
+       buf_free (local_to_server);
+       local_to_server = NULL;
 
-       status = buf_shutdown (from_server);
+       status = buf_shutdown (local_from_server);
        if (status != 0)
            error (0, status, "shutting down buffer from server");
-       buf_free (from_server);
-       from_server = NULL;
+       buf_free (local_from_server);
+       local_from_server = NULL;
 
        /* Don't need to set server_started = 0 since we don't set it to 1
         * until returning from this call.
@@ -3932,8 +3955,8 @@
     }
     else
     {
-       *to_server_p = to_server;
-       *from_server_p = from_server;
+       *to_server_p = local_to_server;
+       *from_server_p = local_from_server;
     }
 
     return;
@@ -3942,6 +3965,46 @@
 
 
 static void
+proxy_connect (root, port_number)
+    cvsroot_t *root;
+    int port_number;
+{
+#define CONNECT_STRING "CONNECT %s:%d HTTP/1.0\r\n\r\n"
+    /* Send a "CONNECT" command to proxy: */
+    char* read_buf;
+    int codenum, count;
+    
+    /* 4 characters for port covered by the length of %s & %d */
+    char* write_buf = xmalloc (strlen (CONNECT_STRING) + strlen 
(root->hostname) + 20 + 1);
+    int len = sprintf (write_buf, CONNECT_STRING, root->hostname, port_number);
+    send_to_server (write_buf, len);
+    
+    /* Wait for HTTP status code, bail out if you don't get back a 2xx code.*/
+    count = read_line (&read_buf);
+    sscanf (read_buf, "%s %d", write_buf, &codenum);
+    
+    if ((codenum / 100) != 2)
+       error (1, 0, "proxy server %s:%d does not support http tunnelling",
+              root->proxy, root->proxy_port);
+    free (read_buf);
+    free (write_buf);
+    
+    /* Skip through remaining part of MIME header, recv_line
+       consumes the trailing \n */
+    while(read_line (&read_buf) > 0)
+    {
+       if (read_buf[0] == '\r' || read_buf[0] == 0)
+       {
+           free (read_buf);
+           break;
+       }
+       free (read_buf);
+    }
+}
+
+
+
+static void
 auth_server (root, lto_server, lfrom_server, verify_only, do_gssapi, hostinfo)
     cvsroot_t *root;
     struct buffer *lto_server;
--- cvs-1.11.22.orig/src/root.h 2006-08-01 19:04:01.000000000 -0400
+++ cvs-1.11.22/src/root.h      2006-08-01 19:20:18.000000000 -0400
@@ -38,6 +38,7 @@
     char *password;            /* The password or NULL if method == local. */
     char *hostname;            /* The hostname or NULL if method == local. */
     int port;                  /* The port or zero if method == local. */
+       char *proxy;
     char *proxy_hostname;      /* The hostname of the proxy server, or NULL
                                 * when method == local or no proxy will be
                                 * used.
--- cvs-1.11.22.orig/src/client.h       2006-08-01 19:04:01.000000000 -0400
+++ cvs-1.11.22/src/client.h    2006-08-01 19:29:55.000000000 -0400
@@ -83,6 +83,9 @@
 #   ifndef CVS_AUTH_PORT
 #     define CVS_AUTH_PORT 2401
 #   endif /* CVS_AUTH_PORT */
+#   ifndef CVS_PROXY_PORT
+#     define CVS_PROXY_PORT 80
+#   endif /* CVS_PROXY_PORT */
 # endif /* (AUTH_CLIENT_SUPPORT) || defined (HAVE_GSSAPI) */
 
 # if HAVE_KERBEROS
--- cvs-1.11.22.orig/src/root.c 2006-08-01 19:04:01.000000000 -0400
+++ cvs-1.11.22/src/root.c      2006-08-01 19:38:35.000000000 -0400
@@ -300,6 +300,8 @@
     newroot->proxy_hostname = NULL;
     newroot->proxy_port = 0;
 #endif /* CLIENT_SUPPORT */
+    newroot->proxy = NULL;
+    newroot->proxy_port = CVS_PROXY_PORT;
 
     return newroot;
 }
@@ -328,6 +330,8 @@
        free (root->hostname);
     if (root->proxy_hostname != NULL)
        free (root->proxy_hostname);
+       if (root->proxy != NULL)
+       free (root->proxy);
 #endif /* CLIENT_SUPPORT */
     free (root);
 }
@@ -371,8 +375,11 @@
     char *cvsroot_copy, *p, *q;                /* temporary pointers for 
parsing */
 #ifdef CLIENT_SUPPORT
     int check_hostname, no_port, no_password;
+    
 #endif /* CLIENT_SUPPORT */
 
+    const char *env_var;
+
     assert (root_in);
 
     /* allocate some space */
@@ -551,6 +558,28 @@
        /* restore the '/' */
        cvsroot_copy = firstslash;
        *cvsroot_copy = '/';
+       
+       /* Determine proxy */
+       env_var = getenv("CVS_PROXY");
+       if (!env_var)
+           env_var = getenv("HTTP_PROXY");
+       /* Check if a proxy was specified, and if it is a HTTP proxy */
+       if (env_var && !memcmp(env_var, "http://";, 7))
+       {
+           char *port_str;
+           
+           /* Try to parse the proxy data */
+           env_var += 7;
+           /* TODO - parse username/password data, too */
+           port_str = strchr(env_var, ':');
+           if (port_str)
+           {
+               *port_str++ = 0;
+               newroot->proxy_port = atoi(port_str);
+           }
+           newroot->proxy = xstrdup(env_var);
+       }
+
 #endif /* CLIENT_SUPPORT */
     }
 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to