diff network/wget/wget.sh @ 141:21e18b280dea

network: merge .sh and .info
author David Demelier <markand@malikania.fr>
date Mon, 11 Mar 2019 20:10:00 +0100
parents 70d465d61d60
children 7c631ce1660f
line wrap: on
line diff
--- a/network/wget/wget.sh	Mon Mar 11 16:33:11 2019 +0100
+++ b/network/wget/wget.sh	Mon Mar 11 20:10:00 2019 +0100
@@ -15,54 +15,72 @@
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #
 
+PKGNAME=wget
+PKGVERSION=1.20.1
+PKGREVISION=1
+PKGLICENSE="GPLv3"
+PKGSUMMARY="GNU network utility to retrieve files from the web"
+PKGDOWNLOAD="https://ftp.gnu.org/gnu/$PKGNAME/$PKGNAME-$PKGVERSION.tar.lz"
+PKGDEPENDS="network/gnutls lib/libunistring lib/zlib"
+PKGOPTIONS="NLS SSL UUID"
+
 : ${CHOST:=$(uname -m)-linux-musl}
 : ${CBUILD:=$(uname -m)-linux-musl}
+: ${CTARGET:=$(uname -m)-linux-musl}
 : ${CC:=gcc}
 : ${CFLAGS:=-O2}
+: ${LDFLAGS:=}
+: ${LIBS:=}
 : ${SSL:=gnutls}       # upstream default
 : ${NLS:=yes}
 : ${UUID:=yes}
 
-source ./wget.info
-
-set -ex
-
-if [ "$SSL" = "openssl" ]; then
-	with_ssl="--with-ssl=openssl"
-elif [ "$SSL" = "gnutls" ]; then
-	with_ssl="--with-ssl=gnutls"
-elif [ "$SSL" = "no" ]; then
-	with_ssl="--without-ssl"
-fi
-
 if [ "$NLS" = "yes" ]; then
+	PKGDEPENDS="core/gettext $PKGDEPENDS"
 	with_nls="--enable-nls"
 else
 	with_nls="--disable-nls"
 fi
 
+if [ "$SSL" = "openssl" ]; then
+	PKGDEPENDS="network/openssl $PKGDEPENDS"
+	with_ssl="--with-ssl=openssl"
+elif [ "$SSL" = "gnutls" ]; then
+	PKGDEPENDS="network/gnutls $PKGDEPENDS"
+	with_ssl="--with-ssl=gnutls"
+else
+	with_ssl="--without-ssl"
+fi
+
 if [ "$UUID" = "yes" ]; then
+	PKGDEPENDS="core/util-linux $PKGDEPENDS"
 	with_uuid="--with-uuid"
 else
 	with_uuid="--without-uuid"
 fi
 
-rm -rf $PKGNAME-$PKGVERSION
-tar xvaf $PKGNAME-$PKGVERSION.tar.lz
-pushd $PKGNAME-$PKGVERSION
+build()
+{
+	rm -rf $PKGNAME-$PKGVERSION
+	tar xvaf $PKGNAME-$PKGVERSION.tar.lz
+	pushd $PKGNAME-$PKGVERSION
 
-CC="$CC" \
-CFLAGS="$CFLAGS" \
-./configure \
-	--build=$CBUILD \
-	--host=$CHOST \
-	--prefix=/usr \
-	--without-included-libunistring \
-	${with_nls} \
-	${with_ssl} \
-	${with_uuid}
-make
-make install DESTDIR=$DESTDIR
+	CC="$CC" \
+	CFLAGS="$CFLAGS" \
+	LDFLAGS="$LDFLAGS" \
+	LIBS="$LIBS" \
+	./configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--target=$CTARGET \
+		--prefix=/usr
+		--without-included-libunistring \
+		$with_nls \
+		$with_ssl \
+		$with_uuid
+	make
+	make install DESTDIR=$DESTDIR
 
-popd
-rm -rf $PKGNAME-$PKGVERSION
+	popd
+	rm -rf $PKGNAME-$PKGVERSION
+}