changeset 0:6181dd52567c

lib/zlib: initial import
author David Demelier <markand@malikania.fr>
date Fri, 22 Feb 2019 09:10:38 +0100
parents
children 61aad8410992
files lib/zlib/zlib.info lib/zlib/zlib.sh
diffstat 2 files changed, 58 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/zlib/zlib.info	Fri Feb 22 09:10:38 2019 +0100
@@ -0,0 +1,5 @@
+PKGNAME=zlib
+PKGVERSION=1.2.11
+PKGREVISION=1
+PKGSUMMARY="zlib compression library"
+PKGDOWNLOAD="http://www.zlib.net/$PKGNAME-$PKGVERSION.tar.gz"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/zlib/zlib.sh	Fri Feb 22 09:10:38 2019 +0100
@@ -0,0 +1,53 @@
+#!/bin/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.
+#
+
+. ./zlib.info
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/vpk}
+
+OBJDIR=$TMP/${PKGNAME}.work
+DSTDIR=$TMP/${PKGNAME}.install
+OUTDIR=$TMP/pkg
+
+case $(uname -m) in
+x86_64)
+	ARCH="amd64"
+	CFLAGS="-O2 -fPIC"
+	;;
+*)
+	ARCH="$(uname -m)"
+	CFLAGS="-O2"
+	;;
+esac
+
+rm -rf $DSTDIR $OBJDIR
+
+mkdir -p $DSTDIR $OBJDIR && cd $OBJDIR
+tar xvzf $CWD/$PKGNAME-$PKGVERSION.tar.gz || exit 1
+cd $PKGNAME-$PKGVERSION || exit 1
+
+CFLAGS="$CFLAGS" \
+	./configure \
+       	--prefix=/usr
+make || exit 1
+make install DESTDIR=$DSTDIR
+
+cd $OBJDIR
+vpk package $OUTDIR/$PKGNAME-$PKGVERSION-$ARCH.txz
+
+#rm -rf $DSTDIR $OBJDIR