File bios_extract.spec of Package bios_extract
%define realname bios_extract
%define srcext tar.bz2
# turn off the generation of debuginfo rpm (RH9) ??
%global debug_package %{nil}
# Common info
Name: %{realname}
Version: 0
Release: wiz%{?extraver:0.}1%{?dist}
License: GPL-2.0+ and BSD-3-Clause and SUSE-Public-Domain
Group: Development/Tools/Other
URL: https://www.coreboot.org/Bios_extract
Summary: Tool for extracting individual modules from proprietary BIOS/UEFI images
# Install-time parameters
Requires: python%{?suse_version:-base}
# Build-time parameters
BuildRoot: %{_tmppath}/%{name}-root
Source: %{realname}-%{version}%{?extraver}.%{srcext}
%description
bios_extract is a GPL tool for extracting individual modules from proprietary
BIOS/UEFI images.
This utility should work on most modern UNIX-like operating systems; it has been
tested on at least Linux and FreeBSD. It is very useful for extracting PCI
Expansion ROMs from onboard devices, like IGP graphics, raid controllers, nic
boot roms, etc, for inclusion in a coreboot image.
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{version}%{?extraver}
%build
%{__sed} -ri '1 i\#!%{_bindir}/python' *.py
%{__make} %{?_smp_mflags} \
CFLAGS="%{optflags} %{?gcc_lto}" \
CXXFLAGS="%{optflags} %{?gcc_lto}" \
LDFLAGS="-Wl,--as-needed -Wl,--strip-all %{?gcc_lto}"
%install
%{__install} -d -m0755 %{buildroot}%{_bindir}
for BIN in bios_extract bcpvpd ami_slab xfv/efidecomp xfv/xfv.py decap.sh *.py; do
%{__install} -m0755 ${BIN} %{buildroot}%{_bindir}/
done
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%files
%defattr(-,root,root)
%doc COPYING README
%{_bindir}/*
%changelog