Update sysutils/dateutils to version 0.4.1
[dports.git] / sysutils / ucspi-tcp / Makefile
1 # Created by: Dom Mitchell <dom@happygiraffe.net>
2 # $FreeBSD$
3
4 PORTNAME=       ucspi-tcp
5 PORTVERSION=    0.88
6 PORTREVISION=   2
7 CATEGORIES=     sysutils net
8 MASTER_SITES=   http://cr.yp.to/ucspi-tcp/ \
9                 LOCAL/garga/ucspi-tcp
10
11 PATCH_DIST_STRIP=       -p1
12
13 MAINTAINER=     ports@FreeBSD.org
14 COMMENT=        Command-line tools for building TCP client-server applications
15
16 OPTIONS_DEFINE= RSS_DIFF RBL2SMTPD IPV6 SSL LIMITS
17
18 RSS_DIFF_DESC=  Patch rblsmtpd for qmail users
19 RBL2SMTPD_DESC= Don't drop connection, pass envvar to smtpd
20 LIMITS_DESC=    Implement per-connection and other limits
21
22 ALL_TARGET=     prog install instcheck
23
24 SCRIPTS_ENV=    BINOWN="${BINOWN}" \
25                 BINGRP="${BINGRP}" \
26                 BINMODE="${BINMODE}" \
27                 MANMODE="${MANMODE}" \
28                 CFLAGS="${CFLAGS}"
29
30 PROGRAMS=       addcr \
31                 argv0 \
32                 delcr \
33                 fixcrio \
34                 mconnect-io \
35                 rblsmtpd \
36                 recordio \
37                 tcpclient \
38                 tcprules \
39                 tcprulescheck \
40                 tcpserver
41
42 SCRIPTS=        date@ \
43                 finger@ \
44                 http@ \
45                 mconnect \
46                 who@ \
47                 tcpcat
48
49 .include <bsd.port.options.mk>
50
51 # SSL and LIMITS can't coexist
52 .if ${PORT_OPTIONS:MSSL} && ${PORT_OPTIONS:MLIMITS}
53 BROKEN= SSL and LIMITS options cannot coexist, please choose one of them
54 .endif
55
56 MASTER_SITES+=  http://smarden.org/pape/djb/manpages/:man \
57                 LOCAL/garga/ucspi-tcp/:man
58 DISTFILES+=     ${DISTNAME}${EXTRACT_SUFX} \
59                 ${DISTNAME}-man.tar.gz:man
60 MAN_FILES=      addcr.1 argv0.1 date@.1 delcr.1 finger@.1 fixcrio.1 \
61                 http@.1 mconnect.1 rblsmtpd.1 recordio.1 tcpcat.1 \
62                 tcpclient.1 tcprules.1 tcprulescheck.1 tcpserver.1 who@.1
63
64 .if ${PORT_OPTIONS:MRSS_DIFF}
65 PATCH_SITES+=   http://www.qmail.org/:rss
66 PATCHFILES+=    ucspi-rss.diff:rss
67 .endif
68
69 .if ${PORT_OPTIONS:MSSL}
70 USE_OPENSSL=    yes
71 PATCH_SITES+=   http://www.nrg4u.com/qmail/:ssl
72 PATCHFILES+=    ucspi-tcp-ssl-20050405.patch.gz:ssl
73 .endif
74
75 .if ${PORT_OPTIONS:MRBL2SMTPD}
76 PATCHFILES+=    ucspi-tcp_rbl2smtpd.diff:rbl2smtpd
77 .endif
78
79 .if ${PORT_OPTIONS:MLIMITS}
80 PATCH_SITES+=   http://linux.voyager.hr/ucspi-tcp/files/:limits
81 PATCHFILES+=    tcpserver-limits-2006-01-26.diff:limits
82 .endif
83
84 .if ${PORT_OPTIONS:MIPV6}
85 # Neither can IPv6 and SSL
86 . if ${PORT_OPTIONS:MSSL}
87 BROKEN= SSL and IPv6 options cannot coexist, please choose one of them
88 . endif
89
90 # Same for IPv6 and LIMITS
91 . if ${PORT_OPTIONS:MLIMITS}
92 BROKEN= IPv6 and LIMITS options cannot coexist, please choose one of them
93 . endif
94
95 PATCH_SITES+=   http://www.fefe.de/ucspi/:ipv6
96 PATCHFILES+=    ucspi-tcp-0.88-ipv6.diff19.bz2:ipv6
97 .endif
98
99 PATCH_SITES+=           LOCAL/garga/ucspi-tcp/:rss,ssl,rbl2smtpd
100
101 .include <bsd.port.pre.mk>
102
103 # Restrict optimization to -O - -O2 causes problems at least on amd64
104 .if ${ARCH} == "x86_64"
105 CFLAGS+=        -O
106 .endif
107
108 post-patch:
109         @${REINPLACE_CMD} -e 's/^extern int errno;/#include <errno.h>/' \
110                 ${WRKSRC}/error.h
111 .if ${PORT_OPTIONS:MSSL}
112         @${REINPLACE_CMD} -e 's|#INCS=-I/usr/local/include|INCS=-I${OPENSSLINC}|g; \
113                               /^LIBS=/s|-lcrypto|-L${OPENSSLLIB} &|g' \
114                 ${WRKSRC}/Makefile
115 .endif
116
117 post-configure:
118         @${ECHO_CMD} ${PREFIX} > ${WRKSRC}/conf-home
119         @${ECHO_CMD} ${CC} ${CFLAGS} > ${WRKSRC}/conf-cc
120         @${ECHO_CMD} ${CC} -s > ${WRKSRC}/conf-ld
121
122 do-install:
123 .for file_name in ${PROGRAMS}
124         ${INSTALL_PROGRAM} ${WRKSRC}/${file_name} ${STAGEDIR}${PREFIX}/bin
125 .endfor
126 .for file_name in ${SCRIPTS}
127         ${INSTALL_SCRIPT} ${WRKSRC}/${file_name} ${STAGEDIR}${PREFIX}/bin
128 .endfor
129 .for file_name in ${MAN_FILES}
130         ${INSTALL_MAN} ${WRKSRC}-man/${file_name} ${STAGEDIR}${MAN1PREFIX}/man/man1/
131 .endfor
132
133 .include <bsd.port.post.mk>