#!/bin/bash # # syslinux-tftp.SlackBuild is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # syslinux-tftp.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # default settings PACKAGE="syslinux-tftp" PACKAGE_EXT="xz" VERSION=${VERSION:=6.04} BUILD=${BUILD:=1} if [ -f ~/.slackbuildrc ]; then source ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc fi SRC="syslinux-${VERSION}-pre1.tar.$PACKAGE_EXT" URL="https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/Testing/${VERSION}/${SRC}" get_source $SRC $URL unpack_source $SRC syslinux-$VERSION-pre1 # Generic patches patch -p1 < $CWD/0004-pull-in-sysmacros.patch patch -p1 < $CWD/0005-Workaround-multiple-definition-of-symbol-errors.patch patch -p1 < $CWD/0006-Replace-builtin-strlen-that-appears-to-get-optimized.patch # Fix EFI64 loader. patch -p1 < $CWD/0016-strip-gnu-property.patch patch -p1 < $CWD/0017-single-load-segment.patch patch -p1 < $CWD/0017-single-load-segment-2.patch # Build tftp loaders only. # See: https://wiki.syslinux.org/wiki/index.php?title=Doc/building make bios efi64 || exit 1 echo -n "Installing .." make bios efi64 install INSTALLROOT="$PKG" SBINDIR=/usr/bin MANDIR=/usr/man AUXDIR=/tftpboot echo -n "." rm -rf $PKG/tftpboot/{com32,dosutil,syslinux.com} mkdir -p $DOCS cp -a COPYING NEWS README doc/* $DOCS echo -n "." mkdir -p $PKG/tftpboot/bios mv $PKG/tftpboot/{*.bin,*.exe,*.c32,*.0,memdisk} $PKG/tftpboot/bios mkdir -p $PKG/tftpboot/{bios,efi64}/pxelinux.cfg echo -n "." rm -rf $PKG/usr/bin rm -rf $PKG/usr/man rm -rf $PKG/tftpboot/diag echo -n "." echo fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi