slackware-current/source/a/elilo/elilo.SlackBuild
Patrick J Volkerding af4fda5687 Mon Jul 29 23:17:22 UTC 2019
a/aaa_elflibs-15.0-x86_64-10.txz:  Rebuilt.
  Upgraded: libglib-2.0.so.0.6000.6, libgmodule-2.0.so.0.6000.6,
  libgobject-2.0.so.0.6000.6, libgthread-2.0.so.0.6000.6,
  liblber-2.4.so.2.10.11, libldap-2.4.so.2.10.11.
  Added: libargon2.so.1, libjson-c.so.4.0.0.
a/cryptsetup-2.1.0-x86_64-1.txz:  Upgraded.
  Shared library .so-version bump.
  Thanks to Robby Workman.
a/efibootmgr-20190528_d9eb7f1-x86_64-1.txz:  Upgraded.
  Even though efibootmgr-17 will compile against efivar from git, it's probably
  best to take this from git as well to keep things closely synced.
a/efivar-20190618_272b216-x86_64-1.txz:  Upgraded.
  Switch to git to fix "efibootmgr -v" failing with a parse error.
a/elilo-3.16-x86_64-10.txz:  Rebuilt.
  eliloconfig: If /boot/initrd.gz exists, install the generic kernel and initrd.
  Otherwise, install the huge kernel.
a/lvm2-2.03.05-x86_64-1.txz:  Upgraded.
  Back to lvm2-2.03.x (cryptsetup needs it). Hopefully there's been enough time
  for most of the bugs to have been ironed out.
l/argon2-20190702-x86_64-3.txz:  Rebuilt.
  Fix shared library permissions.
l/aspell-0.60.7-x86_64-1.txz:  Upgraded.
l/imagemagick-6.9.10_57-x86_64-1.txz:  Upgraded.
l/python-docutils-0.15.1-x86_64-1.txz:  Upgraded.
n/ipset-7.3-x86_64-1.txz:  Upgraded.
xap/geeqie-1.5-x86_64-1.txz:  Upgraded.
xfce/garcon-0.6.4-x86_64-1.txz:  Upgraded.
xfce/thunar-volman-0.9.4-x86_64-1.txz:  Upgraded.
xfce/tumbler-0.2.6-x86_64-1.txz:  Upgraded.
2019-07-30 08:59:48 +02:00

142 lines
4.9 KiB
Bash
Executable file

#!/bin/bash
# Copyright 2013, 2014, 2016, 2017, 2018, 2019 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# 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=elilo
VERSION=${VERSION:-$(echo $PKGNAM*.tar.?z* | rev | cut -f 2 -d - | rev)}
BUILD=${BUILD:-10}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
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
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf elilo
mkdir elilo
cd elilo
tar xvf $CWD/${PKGNAM}-$VERSION-all.tar.?z* || exit 1
tar xvf elilo-${VERSION}-source.tar.gz || exit 1
# The tarball extracted below contains rebuilt versions of the x86_64 and
# ia32 elilo, which were extracted from $TMP/elilo/elilo-${VERSION}-source/
# after building under both architectures. This approach simplifies making
# changes to other parts of the package without needlessly complicating
# things, as the loaders themselves seldom need to be rebuilt. Besides,
# elilo can be rather fragile, so we don't want to rebuild it without a
# good reason and risk breaking it.
tar xvf $CWD/elilo.loader.binaries.tar.xz || exit 1
chown -R root:root .
chmod -R u+w,go+r-w,a-s .
cd elilo-${VERSION}-source || cd elilo || exit
sed -i "s,/usr/lib,/usr/lib${LIBDIRSUFFIX},g" Make.defaults
sed -i "s,EFICRT0.*= /usr/lib${LIBDIRSUFFIX},EFICRT0 = /usr/lib${LIBDIRSUFFIX}/gnuefi,g" Make.defaults
sed -i "s,dpkg-architecture -qDEB_BUILD_ARCH,uname -m,g" Make.defaults
# Fix collision with StrnCpy() function in both elilo and gnu-efi:
grep -r -l StrnCpy * | xargs sed -i "s/StrnCpy/elilo_StrnCpy/g"
# Increase kernel size limit from 8MB to 16MB (nobody will ever need more than 640K ;-):
zcat $CWD/elilo.double.kernel.size.limit.diff.gz | patch -p1 --verbose || exit 1
# We will build this from source.
# However, we will package the pre-built EFI binaries, since we would
# like to include both 32-bit and 64-bit x86 EFI loaders in the
# finished package.
make || exit 1
# Install the files in the package directory:
mkdir -p $PKG/usr/sbin
cp tools/eliloalt $PKG/usr/sbin
# Install eliloconfig, a simple setup script:
cp -a $CWD/eliloconfig $PKG/usr/sbin
chown root:root $PKG/usr/sbin/eliloconfig
chmod 755 $PKG/usr/sbin/eliloconfig
mkdir -p $PKG/var/log/setup
cp -a $CWD/setup.ll.eliloconfig $PKG/var/log/setup
chown root:root $PKG/var/log/setup/setup.ll.eliloconfig
chmod 755 $PKG/var/log/setup/setup.ll.eliloconfig
mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
cp -a \
ChangeLog LIMITATIONS README README.gnu-efi TODO docs/* \
examples \
$PKG/usr/doc/$PKGNAM-$VERSION
# Since it might not be safe to strip the EFI binaries, do this now:
( 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
)
cd ..
# Install EFI bootloaders in /boot:
mkdir $PKG/boot
# The ia32 version is pretty much useless, since 32-bit UEFI is nowhere to be
# found. Maybe it would help old 32-bit Intel Macs though?
cp -a elilo*ia32.efi $PKG/boot/elilo-ia32.efi
# Itanium binary isn't needed here.
#cp -a elilo*ia64.efi $PKG/boot/elilo-ia64.efi
cp -a elilo*x86_64.efi $PKG/boot/elilo-x86_64.efi
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz