aboutsummaryrefslogtreecommitdiffstats
path: root/ftp/wget/Makefile
blob: 1a95d3a051386cfea983f3d981ddcf9dd1f2a340 (plain) (blame)
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
84
85
86
87
88
89
90
# Created by: Thomas Gellekum <tg@FreeBSD.org>
# $FreeBSD$

PORTNAME=   wget
DISTVERSION=    1.19.1
CATEGORIES= ftp www ipv6
MASTER_SITES=   GNU

MAINTAINER= vd@FreeBSD.org
COMMENT=    Retrieve files from the Net via HTTP(S) and FTP

LICENSE=    GPLv3+
LICENSE_FILE=   ${WRKSRC}/COPYING

TEST_DEPENDS=   p5-HTTP-Daemon>=0:www/p5-HTTP-Daemon \
        p5-IO-Socket-SSL>=0:security/p5-IO-Socket-SSL

USES=       charsetfix cpe iconv makeinfo perl5 tar:xz
USE_PERL5=  build
CPE_VENDOR= gnu
GNU_CONFIGURE=  yes
OPTIONS_SUB=    yes

OPTIONS_RADIO=  SSL
OPTIONS_RADIO_SSL=GNUTLS OPENSSL
OPTIONS_DEFINE= IPV6 NLS IDN METALINK PCRE PSL
OPTIONS_DEFAULT=OPENSSL IDN

PCRE_DESC=  Support Perl regular expressions in addition to POSIX

IPV6_CONFIGURE_ENABLE=  ipv6

NLS_USES=       gettext
NLS_CONFIGURE_ENABLE=   nls
NLS_CPPFLAGS=       -I${LOCALBASE}/include
NLS_LDFLAGS=        -L${LOCALBASE}/lib

IDN_LIB_DEPENDS=    libidn2.so:dns/libidn2 \
            libunistring.so:devel/libunistring
IDN_CPPFLAGS=       -I${LOCALBASE}/include
IDN_LDFLAGS=        -L${LOCALBASE}/lib
IDN_CONFIGURE_ENABLE=   iri
IDN_CONFIGURE_ON=   --with-libidn=${LOCALBASE} --with-libunistring-prefix=${LOCALBASE}
IDN_CONFIGURE_OFF=  --with-included-libunistring

METALINK_CONFIGURE_WITH=metalink
METALINK_LIB_DEPENDS=   libmetalink.so:misc/libmetalink

PCRE_LIB_DEPENDS=   libpcre.so:devel/pcre
PCRE_CPPFLAGS=      -I${LOCALBASE}/include
PCRE_LDFLAGS=       -L${LOCALBASE}/lib
PCRE_CONFIGURE_ENABLE=  pcre

PSL_CONFIGURE_WITH= libpsl
PSL_LIB_DEPENDS=    libpsl.so:dns/libpsl

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MOPENSSL}
USES+=      ssl
CONFIGURE_ARGS+=--with-ssl=openssl --with-libssl-prefix=${OPENSSLBASE}
CPPFLAGS+=  -I${OPENSSLINC}
LDFLAGS+=   -L${OPENSSLLIB}
.elif ${PORT_OPTIONS:MGNUTLS}
USES+=      pkgconfig
LIB_DEPENDS+=   libgnutls.so:security/gnutls
CONFIGURE_ARGS+=--with-ssl=gnutls
CPPFLAGS+=  -I${LOCALBASE}/include
LDFLAGS+=   -L${LOCALBASE}/lib
.else
CONFIGURE_ARGS+=--without-ssl
.endif

INFO=       wget

TEST_TARGET=    check

post-patch:
    ${REINPLACE_CMD} -e 's,WGETRC = $$(sysconfdir)/wgetrc,&.sample,' \
        ${WRKSRC}/doc/Makefile.in
    ${REINPLACE_CMD} -e 's,/usr/local/etc/wgetrc,${PREFIX}/etc/wgetrc,' \
        ${WRKSRC}/doc/sample.wgetrc* ${WRKSRC}/doc/wget.texi ${WRKSRC}/doc/wget.info

.include <bsd.port.pre.mk>

.if ${PORT_OPTIONS:MOPENSSL} && ${SSL_DEFAULT:Mopenssl-devel}
BROKEN=     Does not build with openssl-devel
.endif

.include <bsd.port.post.mk>