Blob Blame Raw
# This package depends on automagic byte compilation
# https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_2
%global _python_bytecompile_extra 1

# vim:tw=0:ts=4:sw=4:et

%define major 2
%define minor 1
%define micro 15
%define extra %{nil}
%define release_version %{major}.%{minor}.%{micro}%{extra}

# per fedora python packaging guidelines
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

Name:           firmware-tools
Version:        %{release_version}
Release:        7%{?dist}
Summary:        Scripts and tools to manage firmware and BIOS updates

License:        GPLv2+ or OSL 2.1
URL:            http://linux.dell.com/libsmbios/download/
Source0:        http://linux.dell.com/libsmbios/download/%{name}/%{name}-%{version}/%{name}-%{version}.tar.bz2
Patch0:         comment-gnome-import.patch

# SUSE doesnt have noarch python, so for SUSE, always build arch-dependent
%if ! 0%{?suse_version}
BuildArch:      noarch
%endif

BuildRequires:  python2-devel, python2-rpm
BuildRequires:  %{__perl}

Requires: python2-rpm, pciutils
Provides: firmware_inventory(pci) = 0:%{release_version}
Requires: gnome-python2-gnome

# packages that dont conform to latest ABI
Conflicts: firmware_addon_dell < 0:2.1.0
Conflicts: dell-dup < 0:1.1.0

%description
The firmware-tools project provides tools to inventory hardware and a plugin
architecture so that different OEM vendors can provide different inventory
components. It is intended to tie to the package system to enable seamless
installation of updated firmware via your package manager, as well as provide
a framework for BIOS and firmware updates.


%prep
%setup -q
%patch0 -p1


%build
# this line lets us build an RPM directly from a git tarball
[ -e ./configure ] || \
    RELEASE_MAJOR=%{major}  \
    RELEASE_MINOR=%{minor}  \
    RELEASE_MICRO=%{micro}  \
    RELEASE_EXTRA=%{extra}  \
    ./autogen.sh --no-configure

# fix problems when buildsystem time is out of sync. ./configure will
# fail if newly created files are older than the packaged files.
# this should normally be a no-op on proper buildsystems.
touch configure
find . -type f -newer configure -print0 | xargs -r0 touch

%configure
make -e %{?_smp_mflags}

%check
make -e %{?_smp_mflags} check

%install
# Fedora Packaging guidelines
rm -rf $RPM_BUILD_ROOT
# SUSE Packaging rpmlint
mkdir $RPM_BUILD_ROOT

make install DESTDIR=%{buildroot} INSTALL="%{__install} -p"

mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/firmware/firmware.d/
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/firmware

# backwards compatibility symlinks
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
ln -s firmwaretool $RPM_BUILD_ROOT/%{_sbindir}/inventory_firmware
ln -s firmwaretool $RPM_BUILD_ROOT/%{_sbindir}/bootstrap_firmware
ln -s firmwaretool $RPM_BUILD_ROOT/%{_sbindir}/update_firmware
ln -s %{_sbindir}/firmwaretool $RPM_BUILD_ROOT/%{_bindir}/update_firmware



%files
%doc COPYING-GPL COPYING-OSL COPYING.LIB README
%{python2_sitelib}/*
%attr(0755,root,root) %{_sbindir}/*
%attr(0755,root,root) %{_bindir}/*
%{_datadir}/firmware-tools/
%dir %{_sysconfdir}/firmware
%dir %{_sysconfdir}/firmware/firmware.d
%config(noreplace) %{_sysconfdir}/firmware/firmware.conf
%{_datadir}/firmware/


%changelog
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.15-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.15-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Feb 14 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.1.15-5
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.15-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.15-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Wed Feb 22 2017 Ralf Cors├ępius <corsepiu@fedoraproject.org> - 2.1.15-2
- Add BR: %%{__perl} (F26FTBFS, RHBZ#1423566).
- Reset %%release to standard fedora conventions. Remove %%rpm_release.

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.15-1.11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.15-1.10
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.15-1.9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.15-1.8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.15-1.7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Mon Aug 19 2013 Praveen K Paladugu <praveen_paladugu@dell.com> - 2.1.15-1.6
- Added the dependency on gnome-python2-gnome to fix BZ#997577

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.15-1.5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.15-1.4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.15-1.3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.15-1.2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Wed Aug  3 2011 Praveen K Paladugu <praveen_paladugu@dell.com> - 2.1.15-1
- Updated the sources to the latest version

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.14-1.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Tue Oct  5 2010 Matt Domsch <mdomsch@fedoraproject.org> - 2.1.14-1
- don't open root-writeable log files until necessary,
  fixes https://bugzilla.redhat.com/show_bug.cgi?id=582299

* Mon Sep 27 2010 Matt Domsch <mdomsch@fedoraproject.org> - 2.1.13-1
- update to 2.1.13

* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 2.1.9-2
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Fri Dec 11 2009 Matt Domsch <mdomsch@fedoraproject.org> - 2.1.9-1
- minor enhancements
 - Changed bootstrap_firmware to output extra strings for pci devices
   with and without subven/subdev.
 - Added logger for updates.
 - add override for storage-topdir to the cli --update command

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.5-2.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Thu May 14 2009 Matt Domsch <mdomsch@fedoraproject.org> - 2.1.5-1.1
- rebase to upstream release

* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.6-2.2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 1.5.6-2.1
- Rebuild for Python 2.6

* Thu Aug 23 2007 Michael E Brown <michael_e_brown at dell.com> - 1.5.6-1
- rebase to upstream release

* Fri Aug 17 2007 Michael E Brown <michael_e_brown at dell.com> - 1.5.5-1
- rebase to upstream release

* Fri Aug 17 2007 Michael E Brown <michael_e_brown at dell.com> - 1.4.2-1
- rebase to upstream release

* Tue May 1 2007 Michael E Brown <michael_e_brown at dell.com> - 1.2.6-1
- disable empty debuginfo package

* Tue Mar 20 2007 Michael E Brown <michael_e_brown at dell.com> - 1.2.5-1
- Remove python-abi dep for RHEL3 (it was broken)

* Fri Mar 16 2007 Michael E Brown <michael_e_brown at dell.com> - 1.2.4-1
- fix typo in sitelib path -- only for RHEL3 build

* Wed Mar 14 2007 Michael E Brown <michael_e_brown at dell.com> - 1.2.3-1
- create and own {_sysconfdir}/firmware/firmware.d/ for plugins.
- Fedora review changes

* Mon Mar 12 2007 Michael E Brown <michael_e_brown at dell.com> - 1.2.0-1
- Fedora-compliant packaging changes.