File fxload.spec of Package fxload

# spec file for package fxload
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2014 B1 Systems GmbH, Vohburg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           fxload
Version:        2008_10_13
Release:        0
Summary:        Download Firmware into USB FX and FX2 Devices
License:        LGPL-2.1-or-later
Group:          System/Kernel
Source1:        %{name}.changes
Patch0:         fxload-2002_04_11.patch
# PATCH-FIX-UPSTREAM fxload-2008_10_13-prefer_DEVNAME.patch lp#156085 --
Patch1:         fxload-2008_10_13-prefer_DEVNAME.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

This program can download firmware into FX and FX2 EZ-USB devices as
well as the original AnchorChips EZ-USB.  It is intended to be invoked
by hotplug scripts when the unprogrammed device appears on the bus.

Primarily as an aid for developers, this can also be used to update
firmware on devices that boot from I2C serial EEPROMs.	For that use,
as well as downloading firmware to all other off-chip memory, a second
stage loader must first be downloaded.

%setup -q
%patch0 -p1
%patch1 -p1

# use date of .changes file instead of __DATE__
# to avoid useless republishing
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{SOURCE1} '+%%b %%e %%Y')
make %{?_smp_mflags} CC="gcc" CFLAGS="%{optflags} -Wall -g -DFXLOAD_VERSION=\"\\\"$FAKE_BUILDDATE (development)\\\"\""

%if !0%{?usrmerged}
mkdir %{buildroot}/sbin
ln -sf %{_sbindir}/fxload %{buildroot}/sbin

%if !0%{?usrmerged}
%attr(755,root,root) %{_sbindir}/fxload
%dir %{_datadir}/usb

openSUSE Build Service is sponsored by