comparison network/curl/curl.sh @ 191:6452b7ac91ac

network/curl: initial import, closes #1139
author David Demelier <markand@malikania.fr>
date Tue, 19 Mar 2019 20:05:00 +0100
parents
children 9e95fda0e5c6
comparison
equal deleted inserted replaced
190:96cc0131586a 191:6452b7ac91ac
1 #!/bin/sh
2 #
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr>
4 #
5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
8 #
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 #
17
18 PKGNAME=curl
19 PKGVERSION=7.64.0
20 PKGREVISION=1
21 PKGLICENSE="MIT"
22 PKGSUMMARY="command line tool for transferring data with URLs"
23 PKGDOWNLOAD="https://curl.haxx.se/download/$PKGNAME-$PKGVERSION.tar.xz"
24 #PKGDEPENDS="category/foo category/bar"
25 PKGOPTIONS="IDN2 IPV6 NGHTTP2 SSH SSL"
26
27 : ${CHOST:=$(uname -m)-linux-musl}
28 : ${CBUILD:=$(uname -m)-linux-musl}
29 : ${CC:=gcc}
30 : ${CFLAGS:=-O2}
31 : ${LDFLAGS:=}
32 : ${LIBS:=}
33 : ${IDN2:=yes}
34 : ${IPV6:=yes}
35 : ${NGHTTP2:=yes}
36 : ${SSH:=yes}
37 : ${SSL:=yes}
38
39 if [ "$IDN2" = "yes" ]; then
40 PKGDEPENDS="core/libidn2 $PKGDEPENDS"
41 with_idn2="--with-libidn2"
42 else
43 with_idn2="--without-libidn2"
44 fi
45
46 if [ "$IPV6" = "yes" ]; then
47 with_ipv6="--enable-ipv6"
48 else
49 with_ipv6="--disable-ipv6"
50 fi
51
52 if [ "$NGHTTP2" = "yes" ]; then
53 PKGDEPENDS="network/nghttp2 $PKGDEPENDS"
54 with_nghttp2="--with-nghttp2"
55 else
56 with_nghttp2="--without-nghttp2"
57 fi
58
59 if [ "$SSH" = "yes" ]; then
60 PKGDEPENDS="lib/libssh2 $PKGDEPENDS"
61 with_ssh="--with-libssh2"
62 else
63 with_ssh="--without-libssh2"
64 fi
65
66 if [ "$SSL" = "yes" ]; then
67 PKGDEPENDS="network/openssl $PKGDEPENDS"
68 with_ssl="--with-ssl"
69 else
70 with_ssl="--without-ssl"
71 fi
72
73 build()
74 {
75 rm -rf $PKGNAME-$PKGVERSION
76 tar xvaf $PKGNAME-$PKGVERSION.tar.xz
77 pushd $PKGNAME-$PKGVERSION
78
79 CC="$CC" \
80 CFLAGS="$CFLAGS" \
81 LDFLAGS="$LDFLAGS" \
82 LIBS="$LIBS" \
83 ./configure \
84 --build=$CBUILD \
85 --host=$CHOST \
86 --prefix=/usr \
87 --disable-static \
88 --enable-shared \
89 --with-ca-bundle=/etc/ssl/cert.pem \
90 --without-cyassl \
91 --without-gnutls \
92 --without-mbedtls \
93 --without-polarssl \
94 --without-wolfssl \
95 $with_idn2 \
96 $with_ipv6 \
97 $with_nghttp2 \
98 $with_ssh \
99 $with_ssl
100 make
101 make install DESTDIR=$DESTDIR
102 rm -f $DESTDIR/usr/lib/libcurl.la
103
104 popd
105 rm -rf $PKGNAME-$PKGVERSION
106 }