Mercurial > vanilla
diff gnu/wget/wget.sh @ 1114:6de02aa035d2
gnu: move GNU packages to this category
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 19 Sep 2019 15:09:24 +0200 |
parents | network/wget/wget.sh@7791d3dbfecf |
children | 297b5eef115e |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnu/wget/wget.sh Thu Sep 19 15:09:24 2019 +0200 @@ -0,0 +1,88 @@ +#!/bin/busybox sh +# +# Copyright (c) 2019 David Demelier <markand@malikania.fr> +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +PKGNAME=wget +PKGVERSION=1.20.1 +PKGREVISION=1 +PKGLICENSE="GPLv30" +PKGSUMMARY="GNU network utility to retrieve files from the web" +PKGDOWNLOAD="https://ftp.gnu.org/gnu/$PKGNAME/$PKGNAME-$PKGVERSION.tar.lz" +PKGDEPENDS="libunistring zlib" +PKGOPTIONS="NLS SSL UUID" + +: ${CHOST:=$(uname -m)-linux-musl} +: ${CBUILD:=$(uname -m)-linux-musl} +: ${CC:=clang} +: ${CFLAGS:=-O2} +: ${LDFLAGS:=} +: ${LIBS:=} +: ${SSL:=gnutls} # Note: can be gnutls (or yes) or libressl. +: ${NLS:=yes} +: ${UUID:=yes} + +if [ "$NLS" = "yes" ]; then + PKGDEPENDS="gettext $PKGDEPENDS" + with_nls="--enable-nls" +else + with_nls="--disable-nls" +fi + +case $SSL in +"yes"|"gnutls") + PKGDEPENDS="gnutls $PKGDEPENDS" + with_ssl="--with-ssl=gnutls" + ;; +"libressl") + PKGDEPENDS="libressl $PKGDEPENDS" + with_ssl="--with-ssl=openssl" + ;; +*) + with_ssl="--without-ssl" + ;; +esac + +if [ "$UUID" = "yes" ]; then + PKGDEPENDS="util-linux $PKGDEPENDS" + with_uuid="--with-uuid" +else + with_uuid="--without-uuid" +fi + +build() +{ + rm -rf $PKGNAME-$PKGVERSION + tar xvf $PKGNAME-$PKGVERSION.tar.lz + cd $PKGNAME-$PKGVERSION + + CC="$CC" \ + CFLAGS="$CFLAGS" \ + LDFLAGS="$LDFLAGS" \ + LIBS="$LIBS" \ + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix= \ + --without-included-libunistring \ + $with_nls \ + $with_ssl \ + $with_uuid + make + make install DESTDIR=$DESTDIR + + cd .. + rm -rf $PKGNAME-$PKGVERSION +}