Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Sep 2014 02:54:49 +0000 (UTC)
From:      "Vanilla I. Shu" <vanilla@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r367144 - in head/www/hydra: . files
Message-ID:  <201409030254.s832snWe031657@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: vanilla
Date: Wed Sep  3 02:54:49 2014
New Revision: 367144
URL: http://svnweb.freebsd.org/changeset/ports/367144
QAT: https://qat.redports.org/buildarchive/r367144/

Log:
  Support STAGEDIR.
  
  PR:		ports/193169
  Submitted by:	Ports Fury.

Added:
  head/www/hydra/files/patch-src__global.h   (contents, props changed)
  head/www/hydra/files/patch-src__request.c   (contents, props changed)
  head/www/hydra/files/patch-src__ssl.c   (contents, props changed)
  head/www/hydra/files/patch-src__ssl.h   (contents, props changed)
Modified:
  head/www/hydra/Makefile
  head/www/hydra/files/patch-src__cgi_ssl.c
  head/www/hydra/pkg-plist

Modified: head/www/hydra/Makefile
==============================================================================
--- head/www/hydra/Makefile	Wed Sep  3 02:40:23 2014	(r367143)
+++ head/www/hydra/Makefile	Wed Sep  3 02:54:49 2014	(r367144)
@@ -5,8 +5,7 @@ PORTNAME=	hydra
 PORTVERSION=	0.1.8
 PORTREVISION=	9
 CATEGORIES=	www
-MASTER_SITES=	http://mirror.inerd.com/FreeBSD/distfiles/${PORTNAME}/ \
-		ftp://ftp.hellug.gr/pub/software/hydra/
+MASTER_SITES=	http://hydra.hellug.gr/download/
 PKGNAMESUFFIX=	-web
 
 MAINTAINER=	ports@FreeBSD.org
@@ -14,38 +13,41 @@ COMMENT=	High performance multi-threaded
 
 LIB_DEPENDS=	libgnutls.so:${PORTSDIR}/security/gnutls
 
+USES=		perl5 pkgconfig shebangfix
+SHEBANG_FILES=	src/webindex.pl
 USE_RC_SUBR=	hydra
-
-CONFLICTS_INSTALL=	hydra-[0-9]*
+USE_PERL5=	run
 GNU_CONFIGURE=	yes
 
-CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib
+CFLAGS+=	-DENABLE_SSL -DHAVE_LIBGNUTLS
+CPPFLAGS+=	$$(pkg-config --cflags gnutls)
+LDFLAGS+=	$$(pkg-config --libs gnutls)
 
-LOGDIR?=	/var/log/hydra
+PLIST_SUB=	LOGDIR="${LOGDIR}"
 
 SUB_FILES=	pkg-deinstall
-PLIST_SUB=	LOGDIR=${LOGDIR}
-SUB_LIST=	LOGDIR=${LOGDIR}
+SUB_LIST=	LOGDIR="${LOGDIR}"
+
+CONFLICTS_INSTALL=	hydra-[0-9]*
+
+LOGDIR?=	/var/log/hydra
 
-NO_STAGE=	yes
 post-patch:
+	@${REINPLACE_CMD} -e \
+		'/LDFLAGS/s| -g"|"|' ${WRKSRC}/configure
 .for f in src/defines.h examples/hydra.conf
-	@${REINPLACE_CMD} -e "s,%%PREFIX%%,${PREFIX},g" \
-	                  -e "s,%%LOGDIR%%,${LOGDIR},g" \
-	                  -e "s,%%WWWOWN%%,${WWWOWN},g" \
-	                  -e "s,%%WWWGRP%%,${WWWGRP},g" \
-	                  ${WRKSRC}/${f}
+	@${REINPLACE_CMD} -e \
+		's|%%PREFIX%%|${PREFIX}|g ; \
+		 s|%%LOGDIR%%|${LOGDIR}|g ; \
+		 s|%%WWWOWN%%|${WWWOWN}|g ; \
+		 s|%%WWWGRP%%|${WWWGRP}|g' ${WRKSRC}/${f}
 .endfor
 
 post-install:
-	@${MKDIR} ${PREFIX}/etc/hydra
+	@${MKDIR} ${STAGEDIR}${ETCDIR}
 .for f in hydra.conf mime.types
-	${INSTALL_DATA} ${WRKSRC}/examples/${f} ${PREFIX}/etc/hydra/${f}-dist
-	[ -f ${PREFIX}/etc/hydra/${f} ] || \
-		${INSTALL_DATA} ${WRKSRC}/examples/${f} ${PREFIX}/etc/hydra/
+	(cd ${WRKSRC}/examples && ${INSTALL_DATA} ${f} \
+		${STAGEDIR}${ETCDIR}/${f}.sample)
 .endfor
-	[ -d ${LOGDIR} ] || \
-		( ${MKDIR} ${LOGDIR} && ${CHOWN} ${WWWOWN}:${WWWGRP} ${LOGDIR} )
 
 .include <bsd.port.mk>

Modified: head/www/hydra/files/patch-src__cgi_ssl.c
==============================================================================
--- head/www/hydra/files/patch-src__cgi_ssl.c	Wed Sep  3 02:40:23 2014	(r367143)
+++ head/www/hydra/files/patch-src__cgi_ssl.c	Wed Sep  3 02:54:49 2014	(r367144)
@@ -9,3 +9,25 @@
  
  #ifdef ENABLE_SSL
  extern int ssl_verify;
+@@ -44,7 +44,7 @@
+ # define GNUTLS_MAX_SESSION_ID 32
+ #endif
+    char session_id[GNUTLS_MAX_SESSION_ID];
+-   int session_id_length = sizeof(session_id);
++   size_t session_id_length = sizeof(session_id);
+    int i, ret;
+    char str_session_id[(GNUTLS_MAX_SESSION_ID * 2) + 1];
+    size_t size;
+@@ -128,10 +128,10 @@
+    }
+ 
+    {
+-      const gnutls_datum *cert_list;
++      const gnutls_datum_t *cert_list;
+       char buf[512];
+       int cert_list_size, ret;
+-      gnutls_x509_crt crt;
++      gnutls_x509_crt_t crt;
+ 
+       buf[0] = 0;
+ 

Added: head/www/hydra/files/patch-src__global.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/hydra/files/patch-src__global.h	Wed Sep  3 02:54:49 2014	(r367144)
@@ -0,0 +1,11 @@
+--- src/globals.h.orig
++++ src/globals.h
+@@ -103,7 +103,7 @@
+     int pollfd_id;
+ #endif
+ #ifdef ENABLE_SSL
+-    gnutls_session ssl_state;
++    gnutls_session_t ssl_state;
+     char * certificate_verified; /* a string that describes the output of the
+                                   * certificate verification function. Needed
+                                   * in CGIs.

Added: head/www/hydra/files/patch-src__request.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/hydra/files/patch-src__request.c	Wed Sep  3 02:54:49 2014	(r367144)
@@ -0,0 +1,20 @@
+--- src/request.c.orig
++++ src/request.c
+@@ -133,7 +133,7 @@
+    int len;
+    static int sockbufsize = SOCKETBUF_SIZE;
+ #ifdef ENABLE_SSL
+-   gnutls_session ssl_state = NULL;
++   gnutls_session_t ssl_state = NULL;
+ #endif
+ 
+    remote_addr.S_FAMILY = 0xdead;
+@@ -194,7 +194,7 @@
+ 	 return;
+       }
+ 
+-      gnutls_transport_set_ptr(ssl_state, (gnutls_transport_ptr)fd);
++      gnutls_transport_set_ptr(ssl_state, (gnutls_transport_ptr_t)fd);
+    }
+ #endif
+ 

Added: head/www/hydra/files/patch-src__ssl.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/hydra/files/patch-src__ssl.c	Wed Sep  3 02:54:49 2014	(r367144)
@@ -0,0 +1,148 @@
+--- src/ssl.c.orig
++++ src/ssl.c
+@@ -29,10 +29,7 @@
+ 
+ #include <gnutls/gnutls.h>
+ #include <gnutls/x509.h>
+-#include <gcrypt.h>
+ #ifdef ENABLE_SMP
+-GCRY_THREAD_OPTION_PTHREAD_IMPL;
+-
+ pthread_mutex_t ssl_session_cache_lock = PTHREAD_MUTEX_INITIALIZER;
+ #endif
+ 
+@@ -51,12 +48,12 @@
+                         */
+ 
+ static void wrap_db_init(void);
+-static int wrap_db_store(void *dbf, gnutls_datum key, gnutls_datum data);
+-static gnutls_datum wrap_db_fetch(void *dbf, gnutls_datum key);
+-static int wrap_db_delete(void *dbf, gnutls_datum key);
++static int wrap_db_store(void *dbf, gnutls_datum_t key, gnutls_datum_t data);
++static gnutls_datum_t wrap_db_fetch(void *dbf, gnutls_datum_t key);
++static int wrap_db_delete(void *dbf, gnutls_datum_t key);
+ 
+ static int cur = 0; /* points to the credentials structure used */
+-static gnutls_certificate_credentials credentials[2] = { NULL, NULL };
++static gnutls_certificate_credentials_t credentials[2] = { NULL, NULL };
+ 
+ static int need_dh_params = 0; /* whether we need to generate DHE
+  * parameters. Depend on the chosen ciphersuites.
+@@ -69,10 +66,10 @@
+  */
+ extern int ssl_dh_bits;
+ 
+-gnutls_dh_params _dh_params[2];
+-gnutls_rsa_params _rsa_params[2];
++gnutls_dh_params_t _dh_params[2];
++gnutls_rsa_params_t _rsa_params[2];
+ 
+-static int generate_dh_primes( gnutls_dh_params* dh_params)
++static int generate_dh_primes( gnutls_dh_params_t* dh_params)
+ {
+     if (gnutls_dh_params_init( dh_params) < 0) {
+         log_error_time();
+@@ -101,7 +98,7 @@
+      return 0;
+ }
+ 
+-static int generate_rsa_params( gnutls_rsa_params* rsa_params)
++static int generate_rsa_params( gnutls_rsa_params_t* rsa_params)
+ {
+     if (gnutls_rsa_params_init( rsa_params) < 0) {
+ 	log_error_time();
+@@ -165,9 +162,9 @@
+ /* Initializes a single SSL/TLS session. That is set the algorithm,
+  * the db backend, whether to request certificates etc.
+  */
+-gnutls_session initialize_ssl_session(void)
++gnutls_session_t initialize_ssl_session(void)
+ {
+-    gnutls_session state;
++    gnutls_session_t state;
+     
+     gnutls_init(&state, GNUTLS_SERVER);
+ 
+@@ -215,9 +212,6 @@
+ 
+     log_error_time();
+     fprintf(stderr, "tls: Initializing GnuTLS/%s.\n", gnutls_check_version(NULL));
+-#ifdef ENABLE_SMP
+-    gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+-#endif
+     gnutls_global_init();
+ 
+     if (gnutls_certificate_allocate_credentials( &credentials[0]) < 0) {
+@@ -294,8 +288,6 @@
+     	comp_priority[i++] = GNUTLS_COMP_NULL;
+     if ( parse_cs_string( ssl_comp, "ZLIB") != 0)
+     	comp_priority[i++] = GNUTLS_COMP_ZLIB;
+-    if ( parse_cs_string( ssl_comp, "LZO") != 0)
+-    	comp_priority[i++] = GNUTLS_COMP_LZO;
+     comp_priority[i] = 0;
+ 
+     /* Add protocols
+@@ -416,7 +408,7 @@
+     cache_db = calloc(1, ssl_session_cache * sizeof(CACHE));
+ }
+ 
+-static int wrap_db_store(void *dbf, gnutls_datum key, gnutls_datum data)
++static int wrap_db_store(void *dbf, gnutls_datum_t key, gnutls_datum_t data)
+ {
+ 
+     if (cache_db == NULL)
+@@ -447,9 +439,9 @@
+     return 0;
+ }
+ 
+-static gnutls_datum wrap_db_fetch(void *dbf, gnutls_datum key)
++static gnutls_datum_t wrap_db_fetch(void *dbf, gnutls_datum_t key)
+ {
+-    gnutls_datum res = { NULL, 0 };
++    gnutls_datum_t res = { NULL, 0 };
+     int i;
+ 
+     if (cache_db == NULL)
+@@ -489,7 +481,7 @@
+     return res;
+ }
+ 
+-static int wrap_db_delete(void *dbf, gnutls_datum key)
++static int wrap_db_delete(void *dbf, gnutls_datum_t key)
+ {
+ int i;
+ 
+@@ -567,11 +559,11 @@
+         
+         if (ssl_verify >= 1) {
+            size_t size;
+-           int verify, ret, valid;
++           int ret, valid;
+            char name[128];
+-           const gnutls_datum *cert_list;
+-           int cert_list_size;
+-           gnutls_x509_crt crt = NULL;
++           const gnutls_datum_t *cert_list;
++           unsigned int cert_list_size, verify;
++           gnutls_x509_crt_t crt = NULL;
+ 
+            ret = gnutls_x509_crt_init( &crt);
+            if (ret < 0) {
+@@ -601,7 +593,7 @@
+ 	   }
+ 
+ 
+-           verify = gnutls_certificate_verify_peers( current->ssl_state);
++           gnutls_certificate_verify_peers2( current->ssl_state, &verify);
+            current->certificate_verified = "NONE";
+ 
+            if (cert_list == NULL) {
+@@ -737,8 +729,6 @@
+     	comp_priority[i++] = GNUTLS_COMP_NULL;
+     if ( parse_cs_string( ssl_comp, "ZLIB") != 0)
+     	comp_priority[i++] = GNUTLS_COMP_ZLIB;
+-    if ( parse_cs_string( ssl_comp, "LZO") != 0)
+-    	comp_priority[i++] = GNUTLS_COMP_LZO;
+     comp_priority[i] = 0;
+ 
+     /* Add protocols

Added: head/www/hydra/files/patch-src__ssl.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/hydra/files/patch-src__ssl.h	Wed Sep  3 02:54:49 2014	(r367144)
@@ -0,0 +1,17 @@
+--- src/ssl.h.orig
++++ src/ssl.h
+@@ -1,12 +1,12 @@
+ #ifdef ENABLE_SSL
+ 
+-gnutls_session initialize_ssl_session(void);
++gnutls_session_t initialize_ssl_session(void);
+ void check_ssl_alert( request* req, int ret);
+ int send_alert(request * current);
+ int finish_handshake(request * current);
+ void ssl_regenerate_params(void);
+ void generate_x509_dn(char *buf, int sizeof_buf,
+-			const gnutls_datum * cert, int issuer);
++			const gnutls_datum_t * cert, int issuer);
+ 
+ #endif
+ 

Modified: head/www/hydra/pkg-plist
==============================================================================
--- head/www/hydra/pkg-plist	Wed Sep  3 02:40:23 2014	(r367143)
+++ head/www/hydra/pkg-plist	Wed Sep  3 02:54:49 2014	(r367144)
@@ -1,10 +1,7 @@
-bin/hydra
 bin/boa_indexer
+bin/hydra
 bin/webindex.pl
-@unexec if cmp -s %D/etc/hydra/hydra.conf %D/etc/hydra/hydra.conf-dist; then rm -f %D/etc/hydra/hydra.conf; fi
-etc/hydra/hydra.conf-dist
-@exec [ -f %B/hydra.conf ] || cp %B/%f %B/hydra.conf
-@unexec if cmp -s %D/etc/hydra/mime.types %D/etc/hydra/mime.types-dist; then rm -f %D/etc/hydra/mime.types; fi
-etc/hydra/mime.types-dist
-@exec [ -f %B/mime.types ] || cp %B/%f %B/mime.types
-@unexec rmdir %D/etc/hydra 2> /dev/null || echo "Dont forget to remove %D/etc/hydra if you won't use hydra anymore"
+@sample %%ETCDIR%%/hydra.conf.sample
+@sample %%ETCDIR%%/mime.types.sample
+@dirrmtry %%ETCDIR%%
+@exec install -d -o www -g www %%LOGDIR%%



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409030254.s832snWe031657>