diff options
Diffstat (limited to 'source/d/flex/flex.SlackBuild')
-rwxr-xr-x | source/d/flex/flex.SlackBuild | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/source/d/flex/flex.SlackBuild b/source/d/flex/flex.SlackBuild index b79f0e76..76956313 100755 --- a/source/d/flex/flex.SlackBuild +++ b/source/d/flex/flex.SlackBuild @@ -1,6 +1,6 @@ -#!/bin/sh +#!/bin/bash -# Copyright 2006, 2007, 2008, 2009, 2010, 2013 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2006, 2007, 2008, 2009, 2010, 2013, 2017, 2018 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -20,10 +20,11 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +cd $(dirname $0) ; CWD=$(pwd) PKGNAM=flex -VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-1} +VERSION=${VERSION:-$(echo $PKGNAM-*.tar.lz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-3} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -35,9 +36,16 @@ if [ -z "$ARCH" ]; then esac fi +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz" + exit 0 +fi + NUMJOBS=${NUMJOBS:-" -j7 "} -CWD=$(pwd) TMP=${TMP:-/tmp} PKG=$TMP/package-${PKGNAM} @@ -60,7 +68,7 @@ fi cd $TMP rm -rf ${PKGNAM}-${VERSION} -tar xvf $CWD/${PKGNAM}-$VERSION.tar.xz || exit 1 +tar xvf $CWD/${PKGNAM}-$VERSION.tar.lz || exit 1 cd ${PKGNAM}-$VERSION # Make sure ownerships and permissions are sane: @@ -71,6 +79,9 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; +# Fix an issue introduced with recent glibc versions. Thanks to LFS: +sed -i "/math.h/a #include <malloc.h>" src/flexdef.h + # Configure: CFLAGS="$SLKCFLAGS" \ ./configure \ @@ -79,12 +90,15 @@ CFLAGS="$SLKCFLAGS" \ --mandir=/usr/man \ --infodir=/usr/info \ --docdir=/usr/doc/flex-${VERSION} \ - --build=$ARCH-slackware-linux + --build=$ARCH-slackware-linux || exit 1 # Build and install: make $NUMJOBS || make || exit 1 make install DESTDIR=$PKG || exit 1 +# Don't ship .la files: +rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la + # A symlink to harken back to the Goodle days: ( cd $PKG/usr/bin ; ln -sf flex lex ) |