diff options
Diffstat (limited to 'source/a/libcgroup/libcgroup.SlackBuild')
-rwxr-xr-x | source/a/libcgroup/libcgroup.SlackBuild | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/source/a/libcgroup/libcgroup.SlackBuild b/source/a/libcgroup/libcgroup.SlackBuild index b15b91ec..d059f378 100755 --- a/source/a/libcgroup/libcgroup.SlackBuild +++ b/source/a/libcgroup/libcgroup.SlackBuild @@ -1,6 +1,6 @@ -#!/bin/sh +#!/bin/bash -# Copyright 2011, 2014 Patrick J. Volkerding, Sebeka, Minnesota, USA +# Copyright 2011, 2014, 2017, 2018 Patrick J. Volkerding, Sebeka, Minnesota, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -20,25 +20,34 @@ # 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=libcgroup VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-3} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in - i?86) export ARCH=i486 ;; + i?86) export ARCH=i586 ;; arm*) export ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: *) export ARCH=$( uname -m ) ;; 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 "} -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" @@ -51,7 +60,6 @@ else LIBDIRSUFFIX="" fi -CWD=$(pwd) TMP=${TMP:-/tmp} PKG=$TMP/package-$PKGNAM @@ -61,7 +69,7 @@ mkdir -p $TMP $PKG cd $TMP rm -rf $PKGNAM-$VERSION tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1 -cd $PKGNAM-$VERSION +cd $PKGNAM-$VERSION || exit 1 # Remove Red Hat / LSB init-scriptisms: zcat $CWD/libcgroup.init.diff.gz | patch -p1 --verbose || exit 1 @@ -86,15 +94,22 @@ CFLAGS="$SLKCFLAGS" \ --infodir=/usr/info \ --disable-pam \ --disable-static \ - --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 + # If this directory is empty, do not include it in the package: rmdir $PKG/usr/lib${LIBDIRSUFFIX}/security 2> /dev/null +# cgexec doesn't need to be setuid root -- setgid cgred is sufficient: +chown root:cgred $PKG/usr/bin/cgexec +chmod 2755 $PKG/usr/bin/cgexec + # Install init scripts: mkdir -p $PKG/etc/rc.d cp -a scripts/init.d/cgconfig $PKG/etc/rc.d/rc.cgconfig.new |