firmware RPM spec template
Michael_E_Brown at Dell.com
Michael_E_Brown at Dell.com
Mon Mar 3 09:26:56 CST 2008
Overall, looks good to me.
1) You need a %changelog. I'm looking at trying to autogenerate the actual firmware changelog into the RPM changelog, but at the very least, you need a changelog for the spec file.
%changelog
* Thu May 24 2007 your name <email at company> - 1.3.0-1
- changed packaging, blah
- see bios relnotes.txt for bios-specific release notes.
2) for the Dell stuff, I generate the package.ini at extract time, so no need for me to build it in the spec file.
3) good catch on the %{name} stuff on irc, I'll look through and fix mine.
--
Michael
-----Original Message-----
From: firmware-tools-devel-bounces at lists.us.dell.com on behalf of Ken MacLeod
Sent: Sun 3/2/2008 2:21 PM
To: firmware-tools-devel at lists.us.dell.com
Subject: firmware RPM spec template
Here is a generic RPM spec file template for a firmware RPM.
This started out from one of the Dell spec files. I removed the Epoch
and oldname bits, since those were specific to the Dell repository. I
normalized most of the other macros.
The spec file assumes the image file is the "source" file.
'NoSource0:' could be used to avoid duplicating the identical binary
firmware image in both the .noarch.rpm and .src.rpm but it requires
the repackager to do an extra step (and have both RPMs to rebuild
with). If you can build your firmware in Linux you'd use a typical
source tarball, %setup macro, and build.
The firmware directory is organized like this:
firmware/VENDOR/NAMESPACE/FIRMWARE_ID_version_VERSION/
The FIRMWARE_ID does not include the namespace prefix since it's in
the NAMESPACE sub-directory.
Let me know what you think.
-- Ken
-------- http://bitsko.slc.ut.us/2008/03/02/fw-template.spec --------
%define vendor_full_name VENDOR_FULL_NAME
%define vendor_name VENDOR_NAME
%define vendor_id VENDOR_ID
%define device_id DEVICE_ID
%define namespace NAMESPACE
%define namespace_name NAMESPACE_NAME
%define firmware_id ven_%{vendor_id}_dev_%{device_id}
# %define shortname %{firmware_id}
%define shortname SHORTNAME
%define provide_name %{namespace}(%{firmware_id})
%define name %{namespace}_%{shortname}
%define version VERSION
%define source_image_name SOURCE_IMAGE_NAME
Summary: %{namespace_name} upgrade package for System: %{shortname}
Name: %{name}
Version: %{version}
Release: 1
Vendor: %{vendor_full_name}
License: Proprietary
Group: System Environment/Base
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(id -u)-buildroot/
Source0: %{source_image_name}
Source1: LICENSE
Requires: firmware-addon-%{vendor_name}
Requires: firmware-tools >= 2.0.10
Provides: %{provide_name} = %{version}-%{release}
%description
This package contains %{namespace_name} update version %{version} for
System %{shortname}.
%prep
cp %{SOURCE1} LICENSE
cat <<'EOF' >package.ini
[package]
name = %{name}
module = firmware_addon_%{vendor_name}.%{namespace}
vendor_id = %{vendor_id}
device_id = %{device_id}
shortname = %{shortname}
version = %{version}
type = %{namespace_name}Package
EOF
%build
%install
FW_PATH=$RPM_BUILD_ROOT/%{_datadir}/firmware/%{vendor_name}/%{namespace}/%{firmware_id}_version_%{version}
rm -rf $RPM_BUILD_ROOT
mkdir -p $FW_PATH
install -m 644 %{SOURCE0} $FW_PATH/`basename %{SOURCE0}`
install -m 644 package.ini $FW_PATH/package.ini
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc LICENSE
%{_datadir}/firmware/%{vendor_name}/*/*
%posttrans
# only attempt to update after we have gotten to the end of the
# transaction and all the requisite rpms have been installed. we might
# have deps on other rpms.
/usr/sbin/firmwaretool --update --rpm -y
%changelog
_______________________________________________
firmware-tools-devel mailing list
firmware-tools-devel at lists.us.dell.com
http://lists.us.dell.com/mailman/listinfo/firmware-tools-devel
More information about the firmware-tools-devel
mailing list