File syslinux.spec of Package syslinux
#
# spec file for package syslinux
#
# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2015-2020 LISA GmbH, Bingen, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define tftpboot /srv/tftpboot
Name: syslinux
ExclusiveArch: %ix86 x86_64
BuildRequires: asciidoc
BuildRequires: gnu-efi > 3.0q
BuildRequires: libpng-devel
BuildRequires: libuuid-devel
BuildRequires: nasm
BuildRequires: netpbm
BuildRequires: python
BuildRequires: upx
BuildRequires: xz
# lots of assembler here that would need to be changed :(
#!BuildIgnore: gcc-PIE
Url: http://www.syslinux.org/wiki/index.php/The_Syslinux_Project
Requires: mtools
Summary: Boot Loader for Linux
License: GPL-2.0+
Group: System/Boot
Version: 6.03+git.20190220T194912.05ac953c
Release: 0
Source: https://www.kernel.org/pub/linux/utils/boot/syslinux/%{name}-%{version}.tar.xz
Source1: isolinux-config
Source2: README.gfxboot
# SUSE basic patches
Patch0: %{name}-6.02-iso9660.diff
Patch1: %{name}-6.02-mboot_bootif.diff
Patch2: %{name}-6.02-md5pass.diff
Patch3: %{name}-6.02-debugflags.diff
# Debian patches
Patch5: 0005-gnu-efi-version-compatibility.patch
Patch16: 0016-strip-gnu-property.patch
Patch17: 0017-single-load-segment.patch
Patch18: 0018-prevent-pow-optimization.patch
Patch19: 0019-gcc-10-compatibility.patch
# SUSE EFI
Patch30: 0001-openSUSE-specific-EFI-booting-implementation.patch
Patch31: 0002-allowing-to-set-partition-id-entry-in-U-EFI-mode.patch
Patch32: 0003-fix-more-fcommon-fallout.patch
AutoReq: 0
%description
SYSLINUX is a boot loader for the Linux operating system which operates
off an MS-DOS or Windows FAT file system. It is intended to simplify
first-time installation of Linux and for creation of rescue and other
special purpose boot disks.
%package -n pxelinux
Summary: PXE Boot Loader for Linux
Group: System/Boot
AutoReq: 0
%description -n pxelinux
PXELINUX is a Syslinux derivative, for booting from a network server using a
network ROM conforming to the Intel PXE (Pre-Execution Environment)
specification.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch5 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%build
cp %{SOURCE2} .
%ifarch x86_64
make bios efi64 DATADIR=%{_libexecdir}
%else
make bios efi32 DATADIR=%{_libexecdir}
%endif
%install
%ifarch x86_64
make bios efi64 install \
%else
make bios efi32 install \
%endif
INSTALLROOT=%{buildroot} \
BINDIR=%{_bindir} \
SBINDIR=%{_bindir} \
DATADIR=%{_libexecdir} \
LIBDIR=%{_datadir} \
INCDIR=%{_includedir} \
MANDIR=%{_mandir}
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT/%{_bindir}
rm -rf $RPM_BUILD_ROOT/%{_libexecdir}/syslinux/com32
mkdir -p $RPM_BUILD_ROOT/srv
cp -rp $RPM_BUILD_ROOT/%{_libexecdir}/syslinux $RPM_BUILD_ROOT%{tftpboot}
rm -rf $RPM_BUILD_ROOT%{tftpboot}/{diag,dosutil,efi*,iso*,syslinux.com,*.bin}
%files
%defattr(-,root,root)
%doc doc/*.txt
%doc README* NEWS
%doc %{_mandir}/man1/*
%{_bindir}/*
%{_libexecdir}/syslinux
%files -n pxelinux
%defattr(-,root,root)
%{tftpboot}
%changelog