File dell-dup.spec of Package delldup

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

%define major 1
%define minor 1
%define sub 3
%define extralevel %{nil}
%define release_name dell-dup
%define release_version %{major}.%{minor}.%{sub}%{extralevel}
%define rpm_release 1

%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

%define python_xml_BR %{nil}
# Some variable definitions so that we can be compatible between SUSE Build service and Fedora build system
# SUSE: fedora_version  suse_version rhel_version centos_version sles_version
# Fedora: fedora dist fc8 fc9
%if 0%{?suse_version} || 0%{?sles_version}
    # Suse splits out python-xml into its own RPM, but most others dont
    %define python_xml_BR python-xml

Name:           %{release_name}
Version:        %{release_version}
Release:        %{rpm_release}%{?dist}
Summary:        A firmware-tools plugin to handle converting Dell DUPs to FT format.

Group:          Applications/System
# License is actually GPL/OSL dual license (GPL Compatible), but rpmlint complains
License:        GPL style
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

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

# SUSE build has anal directory ownership check. RPM which owns all dirs *must*
# be installed at buildtime. This means we have to BuildRequire them, even if
# we dont really need them at build time.
%if 0%{?suse_version}
BuildRequires: firmware-tools

%if 0%{?rhel_version} == 406 
BuildRequires: kernel>=2.2

BuildRequires:  python-devel, firmware-tools, firmware-addon-dell, %{python_xml_BR}
Requires: firmware-tools >= 0:2.0.0, firmware-addon-dell >= 0:2.0

Provides: dell-bmcflash, dell-lsiflash
Obsoletes: dell-bmcflash < 0:1.5.0, dell-lsiflash < 0:2.0.6

This firmware-tools plugin will extract Dell DUPs into Firmware-Tools format.

%setup -q

# this line lets us build an RPM directly from a git tarball
[ -e ./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

make -e %{?_smp_mflags}

make -e %{?_smp_mflags} check

# Fedora Packaging guidelines
# SUSE Packaging rpmlint

make install DESTDIR=%{buildroot} INSTALL="%{__install} -p"
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/firmware/dell/dup/


%config(noreplace) %{_sysconfdir}/firmware/firmware.d/*.conf

* Thu May 24 2007 Michael E Brown <michael_e_brown at> - 1.3.0-1
- Fedora-compliant packaging changes.