File avrdude.spec of Package avrdude

#
# spec file for package avrdude (Version 5.5)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, 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 http://bugs.opensuse.org/
#

# norootforbuild


Name:           avrdude
%if %{?suse_version:1}0
BuildRequires:  bison flex libpng readline-devel
%if %suse_version > 1020
BuildRequires:  texlive texlive-latex
BuildRequires:  libusb-devel
%else
BuildRequires:  libusb te_ams te_latex
%endif
%else
BuildRequires:  libpng mesa-libGL te_latex texi2html
%endif
Version:        5.5
Release:        111
Url:            http://savannah.nongnu.org/projects/avrdude
Group:          Development/Tools/Other
License:        GPL v2 or later
Summary:        Upload tool for AVR microcontrollers
Source:         %name-%version.tar.bz2
Source2:        modprobe.avrdude_parport
Source3:        udev-parport.rules
Patch0:         avrdude-use-serial-device-for-serbb
Patch1:         avrdude-5.5.usbtiny.64bit.patch
AutoReqProv:    on
Provides:       avr-programmer
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
PreReq:         /bin/cat /sbin/modprobe

%description
avrdude is a tool for avr microcontrollers and drives many hardware
in-system programmers. avrdude allows you to program your
microcontroller through the parallel port of your computer.



Authors:
--------
    Brian S. Dean  <bsd@bdmicro.com>
    Joerg Wunsch <j@uriah.heep.sax.de>
    Eric Weddington <ericw@evcohs.com>
    Jan-Hinnerk Reichert <hinni@despammed.com>
    Alex Shepherd <maillists@ajsystems.co.nz>
    Martin Thomas <mthomas@rhrk.uni-kl.de>
    Theodore A. Roth <troth@openavr.org>
    Michael Holzt <kju-avr@fqdn.org>
    Colin O'Flynn <coflynn@newae.com>

%prep
%setup
%patch0 -p1
%patch1 -p1
touch lexer.l

%build
export CFLAGS="$RPM_OPT_FLAGS"
./configure --prefix=/opt/cross \
            --mandir=/usr/share/man \
%if %{?suse_version:1}0
            --enable-doc
%else
            --enable-doc
%endif
make

%install
make DESTDIR=$RPM_BUILD_ROOT install
if [ -d $RPM_BUILD_ROOT/opt/cross/share/doc/%name-%version ]; then
  mv doc doc.orig
  mv $RPM_BUILD_ROOT/opt/cross/share/doc/%name-%version doc
  rmdir $RPM_BUILD_ROOT/opt/cross/share/doc
  rmdir $RPM_BUILD_ROOT/opt/cross/share
fi
install -D -m 644 %{SOURCE2} $RPM_BUILD_ROOT/etc/modprobe.d/avrdude_parport
install -D -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/udev/rules.d/98-parport.rules

%post
%if %{?suse_version:1}0
%if %suse_version >= 1000
if [ "$1" -eq 1 ]; then
  # $1==0 is binary uninstall.
  # $1==1 is binary install.
  # $1==2 is during build 
  if [  "$YAST_IS_RUNNING" = "yes" ]; then
    # make life trivial for yast users.
    /sbin/modprobe ppdev
  fi
fi
%endif
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr (-, root, root)
%doc AUTHORS COPYING NEWS README doc
%doc /usr/share/man/man?/*.*
/opt/*
%config /etc/*

%changelog
* Tue Sep 30 2008 kukuk@suse.de
- Fix libusb BuildRequires
* Fri Aug 08 2008 sndirsch@suse.de
- avrdude-5.5.usbtiny.64bit.patch
  * fixes initialization of USBtinyISP on 64bit (bnc #415773)
* Mon Jun 23 2008 bwalle@suse.de
- don't use default_parallel for "serbb" devices like the "ponyser"
  programmer (https://savannah.nongnu.org/bugs/index.php?23685)
* Mon Feb 04 2008 jw@suse.de
- added /etc/udev/rules.d/98-parport.rules
  as a possible fix for bnc#235059
  (must not be named 99-*, because of bnc#358391)
* Wed Nov 21 2007 sndirsch@suse.de
- avrdude 5.5
  * support for the USBtinyISP programmer (patch #6233)
  * support for the C2N232I serial bitbang programmer (patch #6121)
  * Bugfixes.
* Sun Oct 28 2007 bwalle@suse.de
- Link against libreadline to have history.
- rpmlint: Start "Summary" with a capital letter.
- rpmlint: Remove BuildRequires for SuSE < 9.3.
* Thu Oct 18 2007 bwalle@suse.de
- Link against libusb to have USB support.
- Switch from gzip to bzip2 for the source file to save space.
* Sun Aug 05 2007 sndirsch@suse.de
- updated to release 5.4
  * New devices supported:
    - AT90PWM2B/AT90PWM3B
  * Bugfixes.
  * Source code rearranged so that the functionality is now built
  into a libavrdude.a library where main.c is currently the only
  existing frontend.
  * Implement ATmega256x support for butterfly/avr109.
* Sun May 06 2007 sndirsch@suse.de
- updated to release 5.3.1
* Fri Apr 20 2007 sndirsch@suse.de
- switched to TeXLive packages
* Fri Mar 30 2007 sndirsch@suse.de
- added flex/bison to Buildrequires
* Mon Jan 15 2007 sndirsch@suse.de
- removed resmgr config file (Bug #235059)
* Fri Oct 20 2006 sndirsch@suse.de
- update to release 5.2
  * bugfixes
* Thu Jan 26 2006 sndirsch@suse.de
- update to release 5.1:
  * New devices supported:
    - ATmega640/1280/1281
    - ATtiny24/44/84
  * JTAG mkII support now works with libusb-win32, too
  * JTAG ICE mkI support has been added
  * Solaris support has been added (including ecpp(7D)
  parallel-port bit-bang mode)
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Sun Jan 08 2006 sndirsch@suse.de
- created package
openSUSE Build Service is sponsored by