View | Details | Raw Unified | Return to bug 193169
Collapse All | Expand All

(-)www/hydra/Makefile (-21 / +23 lines)
Lines 5-12 Link Here
5
PORTVERSION=	0.1.8
5
PORTVERSION=	0.1.8
6
PORTREVISION=	9
6
PORTREVISION=	9
7
CATEGORIES=	www
7
CATEGORIES=	www
8
MASTER_SITES=	http://mirror.inerd.com/FreeBSD/distfiles/${PORTNAME}/ \
8
MASTER_SITES=	http://hydra.hellug.gr/download/
9
		ftp://ftp.hellug.gr/pub/software/hydra/
10
PKGNAMESUFFIX=	-web
9
PKGNAMESUFFIX=	-web
11
10
12
MAINTAINER=	ports@FreeBSD.org
11
MAINTAINER=	ports@FreeBSD.org
Lines 14-51 Link Here
14
13
15
LIB_DEPENDS=	libgnutls.so:${PORTSDIR}/security/gnutls
14
LIB_DEPENDS=	libgnutls.so:${PORTSDIR}/security/gnutls
16
15
16
USES=		perl5 pkgconfig shebangfix
17
SHEBANG_FILES=	src/webindex.pl
17
USE_RC_SUBR=	hydra
18
USE_RC_SUBR=	hydra
18
19
USE_PERL5=	run
19
CONFLICTS_INSTALL=	hydra-[0-9]*
20
GNU_CONFIGURE=	yes
20
GNU_CONFIGURE=	yes
21
21
22
CPPFLAGS+=	-I${LOCALBASE}/include
22
CFLAGS+=	-DENABLE_SSL -DHAVE_LIBGNUTLS
23
LDFLAGS+=	-L${LOCALBASE}/lib
23
CPPFLAGS+=	$$(pkg-config --cflags gnutls)
24
LDFLAGS+=	$$(pkg-config --libs gnutls)
24
25
25
LOGDIR?=	/var/log/hydra
26
PLIST_SUB=	LOGDIR="${LOGDIR}"
26
27
27
SUB_FILES=	pkg-deinstall
28
SUB_FILES=	pkg-deinstall
28
PLIST_SUB=	LOGDIR=${LOGDIR}
29
SUB_LIST=	LOGDIR="${LOGDIR}"
29
SUB_LIST=	LOGDIR=${LOGDIR}
30
31
CONFLICTS_INSTALL=	hydra-[0-9]*
32
33
LOGDIR?=	/var/log/hydra
30
34
31
NO_STAGE=	yes
32
post-patch:
35
post-patch:
36
	@${REINPLACE_CMD} -e \
37
		'/LDFLAGS/s| -g"|"|' ${WRKSRC}/configure
33
.for f in src/defines.h examples/hydra.conf
38
.for f in src/defines.h examples/hydra.conf
34
	@${REINPLACE_CMD} -e "s,%%PREFIX%%,${PREFIX},g" \
39
	@${REINPLACE_CMD} -e \
35
	                  -e "s,%%LOGDIR%%,${LOGDIR},g" \
40
		's|%%PREFIX%%|${PREFIX}|g ; \
36
	                  -e "s,%%WWWOWN%%,${WWWOWN},g" \
41
		 s|%%LOGDIR%%|${LOGDIR}|g ; \
37
	                  -e "s,%%WWWGRP%%,${WWWGRP},g" \
42
		 s|%%WWWOWN%%|${WWWOWN}|g ; \
38
	                  ${WRKSRC}/${f}
43
		 s|%%WWWGRP%%|${WWWGRP}|g' ${WRKSRC}/${f}
39
.endfor
44
.endfor
40
45
41
post-install:
46
post-install:
42
	@${MKDIR} ${PREFIX}/etc/hydra
47
	@${MKDIR} ${STAGEDIR}${ETCDIR}
43
.for f in hydra.conf mime.types
48
.for f in hydra.conf mime.types
44
	${INSTALL_DATA} ${WRKSRC}/examples/${f} ${PREFIX}/etc/hydra/${f}-dist
49
	(cd ${WRKSRC}/examples && ${INSTALL_DATA} ${f} \
45
	[ -f ${PREFIX}/etc/hydra/${f} ] || \
50
		${STAGEDIR}${ETCDIR}/${f}.sample)
46
		${INSTALL_DATA} ${WRKSRC}/examples/${f} ${PREFIX}/etc/hydra/
47
.endfor
51
.endfor
48
	[ -d ${LOGDIR} ] || \
49
		( ${MKDIR} ${LOGDIR} && ${CHOWN} ${WWWOWN}:${WWWGRP} ${LOGDIR} )
50
52
51
.include <bsd.port.mk>
53
.include <bsd.port.mk>
(-)www/hydra/files/patch-src::cgi_ssl.c (+33 lines)
Line 0 Link Here
1
--- src/cgi_ssl.c.orig	Thu Nov 20 01:00:59 2003
2
+++ src/cgi_ssl.c	Thu Nov 20 01:01:17 2003
3
@@ -19,7 +19,7 @@
4
  */
5
 
6
 #include "boa.h"
7
-#include <gnutls/x509.h>
8
+#include <gnutls/gnutls.h>
9
 
10
 #ifdef ENABLE_SSL
11
 extern int ssl_verify;
12
@@ -44,7 +44,7 @@
13
 # define GNUTLS_MAX_SESSION_ID 32
14
 #endif
15
    char session_id[GNUTLS_MAX_SESSION_ID];
16
-   int session_id_length = sizeof(session_id);
17
+   size_t session_id_length = sizeof(session_id);
18
    int i, ret;
19
    char str_session_id[(GNUTLS_MAX_SESSION_ID * 2) + 1];
20
    size_t size;
21
@@ -128,10 +128,10 @@
22
    }
23
 
24
    {
25
-      const gnutls_datum *cert_list;
26
+      const gnutls_datum_t *cert_list;
27
       char buf[512];
28
       int cert_list_size, ret;
29
-      gnutls_x509_crt crt;
30
+      gnutls_x509_crt_t crt;
31
 
32
       buf[0] = 0;
33
 
(-)www/hydra/files/patch-src__cgi_ssl.c (-11 lines)
Lines 1-11 Link Here
1
--- src/cgi_ssl.c.orig	Thu Nov 20 01:00:59 2003
2
+++ src/cgi_ssl.c	Thu Nov 20 01:01:17 2003
3
@@ -19,7 +19,7 @@
4
  */
5
 
6
 #include "boa.h"
7
-#include <gnutls/x509.h>
8
+#include <gnutls/gnutls.h>
9
 
10
 #ifdef ENABLE_SSL
11
 extern int ssl_verify;
(-)www/hydra/files/patch-src__global.h (+11 lines)
Line 0 Link Here
1
--- src/globals.h.orig
2
+++ src/globals.h
3
@@ -103,7 +103,7 @@
4
     int pollfd_id;
5
 #endif
6
 #ifdef ENABLE_SSL
7
-    gnutls_session ssl_state;
8
+    gnutls_session_t ssl_state;
9
     char * certificate_verified; /* a string that describes the output of the
10
                                   * certificate verification function. Needed
11
                                   * in CGIs.
(-)www/hydra/files/patch-src__request.c (+20 lines)
Line 0 Link Here
1
--- src/request.c.orig
2
+++ src/request.c
3
@@ -133,7 +133,7 @@
4
    int len;
5
    static int sockbufsize = SOCKETBUF_SIZE;
6
 #ifdef ENABLE_SSL
7
-   gnutls_session ssl_state = NULL;
8
+   gnutls_session_t ssl_state = NULL;
9
 #endif
10
 
11
    remote_addr.S_FAMILY = 0xdead;
12
@@ -194,7 +194,7 @@
13
 	 return;
14
       }
15
 
16
-      gnutls_transport_set_ptr(ssl_state, (gnutls_transport_ptr)fd);
17
+      gnutls_transport_set_ptr(ssl_state, (gnutls_transport_ptr_t)fd);
18
    }
19
 #endif
20
 
(-)www/hydra/files/patch-src__ssl.c (+148 lines)
Line 0 Link Here
1
--- src/ssl.c.orig
2
+++ src/ssl.c
3
@@ -29,10 +29,7 @@
4
 
5
 #include <gnutls/gnutls.h>
6
 #include <gnutls/x509.h>
7
-#include <gcrypt.h>
8
 #ifdef ENABLE_SMP
9
-GCRY_THREAD_OPTION_PTHREAD_IMPL;
10
-
11
 pthread_mutex_t ssl_session_cache_lock = PTHREAD_MUTEX_INITIALIZER;
12
 #endif
13
 
14
@@ -51,12 +48,12 @@
15
                         */
16
 
17
 static void wrap_db_init(void);
18
-static int wrap_db_store(void *dbf, gnutls_datum key, gnutls_datum data);
19
-static gnutls_datum wrap_db_fetch(void *dbf, gnutls_datum key);
20
-static int wrap_db_delete(void *dbf, gnutls_datum key);
21
+static int wrap_db_store(void *dbf, gnutls_datum_t key, gnutls_datum_t data);
22
+static gnutls_datum_t wrap_db_fetch(void *dbf, gnutls_datum_t key);
23
+static int wrap_db_delete(void *dbf, gnutls_datum_t key);
24
 
25
 static int cur = 0; /* points to the credentials structure used */
26
-static gnutls_certificate_credentials credentials[2] = { NULL, NULL };
27
+static gnutls_certificate_credentials_t credentials[2] = { NULL, NULL };
28
 
29
 static int need_dh_params = 0; /* whether we need to generate DHE
30
  * parameters. Depend on the chosen ciphersuites.
31
@@ -69,10 +66,10 @@
32
  */
33
 extern int ssl_dh_bits;
34
 
35
-gnutls_dh_params _dh_params[2];
36
-gnutls_rsa_params _rsa_params[2];
37
+gnutls_dh_params_t _dh_params[2];
38
+gnutls_rsa_params_t _rsa_params[2];
39
 
40
-static int generate_dh_primes( gnutls_dh_params* dh_params)
41
+static int generate_dh_primes( gnutls_dh_params_t* dh_params)
42
 {
43
     if (gnutls_dh_params_init( dh_params) < 0) {
44
         log_error_time();
45
@@ -101,7 +98,7 @@
46
      return 0;
47
 }
48
 
49
-static int generate_rsa_params( gnutls_rsa_params* rsa_params)
50
+static int generate_rsa_params( gnutls_rsa_params_t* rsa_params)
51
 {
52
     if (gnutls_rsa_params_init( rsa_params) < 0) {
53
 	log_error_time();
54
@@ -165,9 +162,9 @@
55
 /* Initializes a single SSL/TLS session. That is set the algorithm,
56
  * the db backend, whether to request certificates etc.
57
  */
58
-gnutls_session initialize_ssl_session(void)
59
+gnutls_session_t initialize_ssl_session(void)
60
 {
61
-    gnutls_session state;
62
+    gnutls_session_t state;
63
     
64
     gnutls_init(&state, GNUTLS_SERVER);
65
 
66
@@ -215,9 +212,6 @@
67
 
68
     log_error_time();
69
     fprintf(stderr, "tls: Initializing GnuTLS/%s.\n", gnutls_check_version(NULL));
70
-#ifdef ENABLE_SMP
71
-    gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
72
-#endif
73
     gnutls_global_init();
74
 
75
     if (gnutls_certificate_allocate_credentials( &credentials[0]) < 0) {
76
@@ -294,8 +288,6 @@
77
     	comp_priority[i++] = GNUTLS_COMP_NULL;
78
     if ( parse_cs_string( ssl_comp, "ZLIB") != 0)
79
     	comp_priority[i++] = GNUTLS_COMP_ZLIB;
80
-    if ( parse_cs_string( ssl_comp, "LZO") != 0)
81
-    	comp_priority[i++] = GNUTLS_COMP_LZO;
82
     comp_priority[i] = 0;
83
 
84
     /* Add protocols
85
@@ -416,7 +408,7 @@
86
     cache_db = calloc(1, ssl_session_cache * sizeof(CACHE));
87
 }
88
 
89
-static int wrap_db_store(void *dbf, gnutls_datum key, gnutls_datum data)
90
+static int wrap_db_store(void *dbf, gnutls_datum_t key, gnutls_datum_t data)
91
 {
92
 
93
     if (cache_db == NULL)
94
@@ -447,9 +439,9 @@
95
     return 0;
96
 }
97
 
98
-static gnutls_datum wrap_db_fetch(void *dbf, gnutls_datum key)
99
+static gnutls_datum_t wrap_db_fetch(void *dbf, gnutls_datum_t key)
100
 {
101
-    gnutls_datum res = { NULL, 0 };
102
+    gnutls_datum_t res = { NULL, 0 };
103
     int i;
104
 
105
     if (cache_db == NULL)
106
@@ -489,7 +481,7 @@
107
     return res;
108
 }
109
 
110
-static int wrap_db_delete(void *dbf, gnutls_datum key)
111
+static int wrap_db_delete(void *dbf, gnutls_datum_t key)
112
 {
113
 int i;
114
 
115
@@ -567,11 +559,11 @@
116
         
117
         if (ssl_verify >= 1) {
118
            size_t size;
119
-           int verify, ret, valid;
120
+           int ret, valid;
121
            char name[128];
122
-           const gnutls_datum *cert_list;
123
-           int cert_list_size;
124
-           gnutls_x509_crt crt = NULL;
125
+           const gnutls_datum_t *cert_list;
126
+           unsigned int cert_list_size, verify;
127
+           gnutls_x509_crt_t crt = NULL;
128
 
129
            ret = gnutls_x509_crt_init( &crt);
130
            if (ret < 0) {
131
@@ -601,7 +593,7 @@
132
 	   }
133
 
134
 
135
-           verify = gnutls_certificate_verify_peers( current->ssl_state);
136
+           gnutls_certificate_verify_peers2( current->ssl_state, &verify);
137
            current->certificate_verified = "NONE";
138
 
139
            if (cert_list == NULL) {
140
@@ -737,8 +729,6 @@
141
     	comp_priority[i++] = GNUTLS_COMP_NULL;
142
     if ( parse_cs_string( ssl_comp, "ZLIB") != 0)
143
     	comp_priority[i++] = GNUTLS_COMP_ZLIB;
144
-    if ( parse_cs_string( ssl_comp, "LZO") != 0)
145
-    	comp_priority[i++] = GNUTLS_COMP_LZO;
146
     comp_priority[i] = 0;
147
 
148
     /* Add protocols
(-)www/hydra/files/patch-src__ssl.h (+17 lines)
Line 0 Link Here
1
--- src/ssl.h.orig
2
+++ src/ssl.h
3
@@ -1,12 +1,12 @@
4
 #ifdef ENABLE_SSL
5
 
6
-gnutls_session initialize_ssl_session(void);
7
+gnutls_session_t initialize_ssl_session(void);
8
 void check_ssl_alert( request* req, int ret);
9
 int send_alert(request * current);
10
 int finish_handshake(request * current);
11
 void ssl_regenerate_params(void);
12
 void generate_x509_dn(char *buf, int sizeof_buf,
13
-			const gnutls_datum * cert, int issuer);
14
+			const gnutls_datum_t * cert, int issuer);
15
 
16
 #endif
17
 
(-)www/hydra/pkg-plist (-8 / +5 lines)
Lines 1-10 Link Here
1
bin/hydra
2
bin/boa_indexer
1
bin/boa_indexer
2
bin/hydra
3
bin/webindex.pl
3
bin/webindex.pl
4
@unexec if cmp -s %D/etc/hydra/hydra.conf %D/etc/hydra/hydra.conf-dist; then rm -f %D/etc/hydra/hydra.conf; fi
4
@sample %%ETCDIR%%/hydra.conf.sample
5
etc/hydra/hydra.conf-dist
5
@sample %%ETCDIR%%/mime.types.sample
6
@exec [ -f %B/hydra.conf ] || cp %B/%f %B/hydra.conf
6
@dirrmtry %%ETCDIR%%
7
@unexec if cmp -s %D/etc/hydra/mime.types %D/etc/hydra/mime.types-dist; then rm -f %D/etc/hydra/mime.types; fi
7
@exec install -d -o www -g www %%LOGDIR%%
8
etc/hydra/mime.types-dist
9
@exec [ -f %B/mime.types ] || cp %B/%f %B/mime.types
10
@unexec rmdir %D/etc/hydra 2> /dev/null || echo "Dont forget to remove %D/etc/hydra if you won't use hydra anymore"

Return to bug 193169