Name: fxload
Summary: A helper program to download firmware into FX and FX2 EZ-USB devices
Summary(ja): FX/FX2 EZ-USB デバイスにファームウェアをダウンロードするプログラム
Version: 2008_10_13
Release: 1%{?_dist_release}
Group: system

License: GPLv2+
URL: http://linux-hotplug.sourceforge.net/
Source0: fxload-%{version}-noa3load.tar.gz
# The above file is derived from:
# http://downloads.sourceforge.net/project/linux-hotplug/fxload/2008_10_13/fxload-2008_10_13.tar.gz
# This file contains code that is copyright Cypress Semiconductor Inc,
# and cannot be distributed. Therefore we use this script to remove the
# copyright code before shipping it. Download the upstream tarball and
# invoke this script while in the tarball's directory:
# ./fxload-generate-tarball.sh 2008_10_13
Source1: fxload-generate-tarball.sh
Patch0: fxload-noa3load.patch
Patch1: fxload-ldflags.patch

BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

BuildRequires: kernel-headers
Requires: udev
Conflicts: hotplug-gtk hotplug

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

%description -l ja
このプログラムを使って、EZ-USB FX / FX2 デバイス、およびオリジナルの
AnchorChips EZ-USB にファームウェアをダウンロードすることができます。
本プログラムは、バス上にデバイスが検出された時に udev スクリプト経由で
起動されるものです。


%debug_package


%prep
%setup -q 
%patch0 -p1 -b .fxload-noa3load
%patch1 -p1 -b .ldflags


%build 
%{make_build} CFLAGS="$RPM_OPT_FLAGS -fPIE" LDFLAGS="$RPM_LD_FLAGS -pie"


%install
rm -rf %{buildroot}
mkdir -p -m 755 %{buildroot}/sbin
install -m 755 fxload %{buildroot}/sbin
mkdir -p -m 755 %{buildroot}/%{_mandir}/man8/
install -m 644 fxload.8 %{buildroot}/%{_mandir}/man8/


%clean
rm -rf %{buildroot}


%files
%defattr(0644,root,root,0755)
%license COPYING
%doc README.txt
%attr(0755, root, root) /sbin/fxload
%{_mandir}/*/*


%changelog
* Wed Mar 10 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2008_10_13-1
- new upstream release.

* Sun Aug 24 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 2002_04_11-9
- rebuild with VineSeed environment

* Sun Apr 17 2011 Shu KONNO <owa@bg.wakwak.com> - 2002_04_11-8
- rebuilt with rpm-4.8.1-3

* Thu Feb 19 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 2002_04_11-7
- initial build for Vine Linux

* Sat Feb 9 2008 Stephen Warren <s-t-rhbugzilla@wwwdotorg.org> - 2002_04_11-7
- Bump version to rebuild with gcc-4.3

* Fri Nov 16 2007 Stephen Warren <s-t-rhbugzilla@wwwdotorg.org> - 2002_04_11-6
- Rework the spec file formatting to match templates from rpmdev
- Be explicit about file attributes, just in case

* Fri Nov 16 2007 Stephen Warren <s-t-rhbugzilla@wwwdotorg.org> - 2002_04_11-5
- Updates after reading packaging guide-lines more thoroughly:
- Make license version more explicit
- Add generate-tarball.sh, and associated comments
- Added BuildRequires on kernel-headers
- Added COPYING as a doc
- Use dollar v.s. percent macros more consitently

* Thu Nov 15 2007 Stephen Warren <s-t-rhbugzilla@wwwdotorg.org> - 2002_04_11-4
- Repackage the source tarball to remove a3load.hex
- Added instructions to spec file on how to do the above
- Remove reference to a3load.hex from the man page too

* Thu Nov 15 2007 Stephen Warren <s-t-rhbugzilla@wwwdotorg.org> - 2002_04_11-3
- Update BuildRoot per Fedora wiki
- Fixed rpmlint complaint about not cleaning buildroot
- Updated source patch file to match latest kernel file layout
- Add patch to remove reference to non-shipped non-free a3load.hex firmware

* Fri Dec 8 2006 Bart Vanbrabant <bart.vanbrabant@zoeloelip.be> - 2002_04_11-2
- Fixed some rpmlint complaints
- Added patch to fix an include header
- Added dist tag

* Wed Apr 12 2006 Bart Vanbrabant <bart.vanbrabant@zoeloelip.be> - 2002_04_11-1
- First version of fxload spec based on hotplug spec

