summaryrefslogtreecommitdiffstats
path: root/source/a/efivar/efivar.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsource/a/efivar/efivar.SlackBuild (renamed from testing/source/efibootmgr/efibootmgr.SlackBuild)65
1 files changed, 33 insertions, 32 deletions
diff --git a/testing/source/efibootmgr/efibootmgr.SlackBuild b/source/a/efivar/efivar.SlackBuild
index b5aeec81d..f954ff90d 100755
--- a/testing/source/efibootmgr/efibootmgr.SlackBuild
+++ b/source/a/efivar/efivar.SlackBuild
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
-# Copyright 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2018 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,29 +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=efibootmgr
-VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+PKGNAM=efivar
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$(uname -m)" in
- i?86) ARCH=i486 ;;
- arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7lh ;;
+ i?86) ARCH=i586 ;;
+ arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$(uname -m) ;;
esac
export ARCH
fi
-if [ "$ARCH" = "i386" ]; then
- SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "i586" ]; then
+# 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" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
@@ -62,7 +67,6 @@ else
LIBDIRSUFFIX=""
fi
-CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM
@@ -71,8 +75,8 @@ mkdir -p $TMP $PKG
cd $TMP
rm -rf $PKGNAM-$VERSION
-tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
-cd $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
+cd $PKGNAM-$VERSION || exit 1
chown -R root:root .
find . \
@@ -81,28 +85,25 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-# Build:
-export EXTRA_CFLAGS="$SLKCFLAGS -fgnu89-inline"
-make || exit 1
-
-# Install:
-mkdir -p $PKG/usr/sbin
-cp src/efibootmgr/efibootmgr $PKG/usr/sbin
-chown root:root $PKG/usr/sbin/efibootmgr
-chmod 755 $PKG/usr/sbin/efibootmgr
-mkdir -p $PKG/usr/man/man8
-cat src/man/man8/efibootmgr.8 | gzip -9c > $PKG/usr/man/man8/efibootmgr.8.gz
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+make $NUMJOBS libdir=/usr/lib$LIBDIRSUFFIX/ mandir=/usr/man/
+make $NUMJOBS install DESTDIR=${PKG}/ libdir=/usr/lib$LIBDIRSUFFIX/ mandir=/usr/man/
# Strip binaries:
-( cd $PKG
- find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
- find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-)
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+
+# Compress manual pages:
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do
+ ln -s $( readlink $i ).gz $i.gz
+ rm $i
+done
# Add a documentation directory:
mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
cp -a \
- AUTHORS COPYING* INSTALL README* doc/* \
+ COPYING* README* TODO* \
$PKG/usr/doc/${PKGNAM}-$VERSION
mkdir -p $PKG/install