File flashrom.spec of Package flashrom

%define realname flashrom
%define realver  1.1
%define srcext   tar.bz2

# turn off the generation of debuginfo rpm  (RH9) ??
%global debug_package %{nil}

# Common info
Name:          %{realname}
Version:       %{realver}
Release:       wiz%{?extraver:0.}1%{?dist}
License:       GPL-2.0+
Group:         System/Console
URL:           http://www.flashrom.org/
Summary:       Utility for identifying, reading, writing, verifying and erasing flash chips

# Build-time parameters
BuildRequires: pkg-config
BuildRequires: pciutils-devel zlib-devel
BuildRequires: pkgconfig(libusb-1.0)
%if 0%{?suse_version} >= 1320
BuildRequires: libftdi1-devel
BuildRequires: libusb-compat-devel
%endif
BuildRoot:     %{_tmppath}/%{name}-root
Source:        https://download.flashrom.org/releases/%{realname}-v%{realver}%{?extraver}.%{srcext}

%description
flashrom is a utility for identifying, reading, writing, verifying and erasing
flash chips. It is designed to flash BIOS/EFI/coreboot/firmware/optionROM images
on mainboards, network/graphics/storage controller cards, and various other
programmer devices.

 * Supports more than 380 flash chips, 260 chipsets, 450 mainboards, 50 PCI
   devices, 12 USB devices and various parallel/serial port-based programmers.
 * Supports parallel, LPC, FWH and SPI flash interfaces and various chip
   packages (DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32, TSOP40, TSOP48, BGA and more)
 * No physical access needed, root access is sufficient (not needed for some
   programmers).
 * No bootable floppy disk, bootable CD-ROM or other media needed.
 * No keyboard or monitor needed. Simply reflash remotely via SSH.
 * No instant reboot needed. Reflash your chip in a running system, verify it,
   be happy. The new firmware will be present next time you boot.
 * Crossflashing and hotflashing is possible as long as the flash chips are
   electrically and logically compatible (same protocol). Great for recovery.
 * Scriptability. Reflash a whole pool of identical machines at the same time
   from the command line. It is recommended to check flashrom output
   and error codes.
 * Speed. flashrom is often much faster than most vendor flash tools.
 * Portability. Supports DOS, Linux, FreeBSD, NetBSD, OpenBSD, DragonFly BSD,
   Solaris, Mac OS X, and other Unix-like OSes. Partial Windows support
   is available (no internal programmer support at the moment, hence
   no "BIOS flashing"). 

%package devel
Group:         Development/Languages/C and C++
Summary:       Development stuff for %{name}

%description devel
Headers, libraries and other stuff required to build
software using %{name} library.

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-v%{realver}%{?extraver}
%{__sed} -ri '/^libinstall/,/^$/ s|/lib$|/%{_lib}|' Makefile

%build
%__make %{?_smp_mflags} %{!?suse_version:CONFIG_ENABLE_LIBUSB0_PROGRAMMERS=no} \
 PREFIX=%{_prefix} \
 CFLAGS="%{optflags}" \
 LDFLAGS="-Wl,--strip-all -Wl,--as-needed"

%install
%__make install libinstall DESTDIR=%{buildroot} \
 PREFIX=%{_prefix} %{!?suse_version:CONFIG_ENABLE_LIBUSB0_PROGRAMMERS=no}

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc COPYING README Documentation/*.txt
%{_sbindir}/flashrom
%doc %{_mandir}/man8/*

%files devel
%{_libdir}/libflashrom.a
%{_includedir}/libflashrom.h

%changelog
openSUSE Build Service is sponsored by