summaryrefslogtreecommitdiff
path: root/chat/psybnc/patches/patch-ac
blob: aafc67b807bb9fd585c2682d848aecacd3cd24bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
$NetBSD: patch-ac,v 1.4 2020/04/25 19:13:12 rillig Exp $

Add pkgsrc path to openssl.
Don't bother creating SSL keys, they are not installed anyway and should
be created on the target system.

--- tools/autoconf.c.orig	2011-07-14 18:11:35.000000000 +0000
+++ tools/autoconf.c
@@ -290,7 +290,7 @@ int checkssl()
     strcat(sysbuf,DN);
     system(sysbuf);
 #else
-    system(CC " tools/chkssl.c -I/usr/local/ssl/include -L/usr/local/ssl/lib -lssl -lcrypto -o tools/chkssl" DN);
+    system(CC " tools/chkssl.c -I@PREFIX@/include -L@PREFIX@/lib -lssl -lcrypto -o tools/chkssl" DN);
 #endif
     return checkcmp();
 }
@@ -394,6 +394,7 @@ int main()
 	"/usr/sbin/openssl",
 	"/usr/local/bin/openssl",
 	"/usr/local/ssl/bin/openssl",
+	"@PREFIX@/bin/openssl",
 	NULL
     };
 #endif
@@ -566,7 +567,7 @@ int main()
 	    strcpy(sslbin,sslblist[sslin]);
 	    printf("Yes.\n");
 	    strcpy(sslopt,"-DHAVE_SSL ");
-	    strcpy(ssllib,"-L/usr/local/ssl/lib -lssl -lcrypto ");
+	    strcpy(ssllib,"-L@PREFIX@/lib -lssl -lcrypto ");
 	}
 #else
 	if(strlen(SSLPATH)+13<sizeof(mbuf))
@@ -614,18 +615,18 @@ int main()
     fprintf(makefile,"SRC	= src/\n");
 
 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) 
-    fprintf(makefile,"CFLAGS  = -O -Wall -Wno-pointer-sign -ggdb\n");
+    fprintf(makefile,"CFLAGS  += -O -Wall -Wno-pointer-sign -ggdb\n");
 #else
-    fprintf(makefile,"CFLAGS  = -O -Wall -ggdb\n");
+    fprintf(makefile,"CFLAGS  += -O -Wall -ggdb\n");
 #endif
 
-    fprintf(makefile,"LIBS    = -lm %s %s %s %s\n", socklib, ssllib, dnslib, mysqllib); /* math lib needed for snprintf of ap */
+    fprintf(makefile,"LIBS    = $(LDFLAGS) -lm %s %s %s %s\n", socklib, ssllib, dnslib, mysqllib); /* math lib needed for snprintf of ap */
 
     if(ssl==0)
 #ifdef SSLPATH
 	fprintf(makefile,"INCLUDE = -I./src/ -I. -I%sinclude %s %s\n", SSLPATH, mysqlheaders, dnsinc);
 #else
-	fprintf(makefile,"INCLUDE = -I./src/ -I. -I/usr/local/ssl/include %s %s\n", mysqlheaders, dnsinc);
+	fprintf(makefile,"INCLUDE = -I./src/ -I. -I@PREFIX@/include %s %s\n", mysqlheaders, dnsinc);
 #endif
     else
 	fprintf(makefile,"INCLUDE = -I./src/ -I. %s %s\n", mysqlheaders, dnsinc);
@@ -641,25 +642,6 @@ int main()
 /*    fprintf(makefile,"	@strip $(TARGET)\n");*/
     if(ssl==0)
     {
-	if(!fexists("key/psybnc.cert.pem")) /* only create, if not exist */
-	{
-	    mkdir("key",0700);
-	    fprintf(makefile,"	@echo \"*** GENERATING SSL-KEYS FROM CERTIFICATE **\"\n");
-	    fprintf(makefile,"	@echo \"* You will be prompted for Cert-Contents  *\"\n");
-	    fprintf(makefile,"	@echo \"*  This Infos will be used only for SSL   *\"\n");
-	    fprintf(makefile,"	@echo \"* Alter the informations to your values   *\"\n");
-	    fprintf(makefile,"	@echo \"* for the sake of correct Cert-Checking   *\"\n");
-	    fprintf(makefile,"	@echo \"*******************************************\"\n");
-	    fprintf(makefile,"	@echo \"Generating certificate request .. \"\n");
-	    fprintf(makefile,"	@%s req -new -config src/ssl.cnf -out key/psybnc.req.pem \\\n",sslbin);
-	    fprintf(makefile,"      	-keyout key/psybnc.key.pem -nodes\n");
-	    fprintf(makefile,"	@echo \"Generating self-signed certificate .. \"\n");
-	    fprintf(makefile,"	@%s req -x509 -days 365 -in key/psybnc.req.pem \\\n",sslbin);
-    	    fprintf(makefile,"       	-key key/psybnc.key.pem -out key/psybnc.cert.pem\n");
-	    fprintf(makefile,"	@echo \"Generating fingerprint ..\"\n");
-	    fprintf(makefile,"	@%s x509 -subject -dates -fingerprint -noout \\\n",sslbin);
-	    fprintf(makefile,"		-in key/psybnc.cert.pem\n");
-	}
 	if(!fexists("src/ssl.rnd"))
 	{
 	    sslrnd=fopen("src/ssl.rnd","w");