# # spec file for package avr-libc (Version 1.7.1) # # Copyright (c) 2010 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/ # %define into_opt_cross 0 # %if 0%into_opt_cross %define _prefix /opt/cross/avr # %else # # FIXME: # okay, FHS 2.2, if you forbid the obvious choices, can you also suggest a better place? # avr-libc: "/usr/avr/{include,lib,...}" is not allowed anymore in FHS 2.2 # avr-libc: "/usr/local/avr/{include,lib,...}" is not allowed anymore in FHS 2.2 %define _prefix /usr %define _avrdir /usr/avr # Must move man dir, or C library man pages clash with host system ones. %define _mandir %{_avrdir}/share/man %endif Name: avr-libc Version: 1.8.0 Release: 9 %define doc_vers %{version} BuildRequires: cross-avr-binutils BuildRequires: avr-gcc BuildRequires: doxygen BuildRequires: findutils BuildRequires: netpbm %if 0%{?suse_version} < 1100 BuildRequires: libgmp3 BuildRequires: libmpfr1 %endif Url: http://savannah.nongnu.org/projects/avr-libc Group: Development/Libraries/C and C++ License: BSD 3-Clause Summary: The C Runtime Library for AVR Microcontrollers Source: http://savannah.nongnu.org/download/%{name}/%{name}-%{version}.tar.bz2 Source1: http://savannah.nongnu.org/download/%{name}/%{name}-user-manual-%{doc_vers}.tar.bz2 Source2: http://savannah.nongnu.org/download/%{name}/%{name}-manpages-%{doc_vers}.tar.bz2 Source3: logicp-1.02.tgz Source100: %{name}-rpmlintrc # patches from http://distribute.atmel.no/tools/opensource/avr-gcc/avr-libc-1.7.0/ Patch41: 41-avr-libc-1.7.1-xmega32X1.patch Patch42: 42-avr-libc-1.7.1-xmega128b1.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: cross-avr-binutils Requires: avr-gcc Recommends: avr-example # does not depend on host arch. bnc#233520 BuildArch: noarch %description The C runtime library for the AVR family of microcontrollers for use with the GNU toolset (avr-binutils, avr-gcc, uisp, etc.). Because the C library functions of avr-libc have the same name as the host systems ones, man pages are installed in %{_mandir}. Use avr-man instead of man to access the avr-libc man pages. Authors: -------- Joerg Wunsch Marek Michalkiewicz Theodore A. Roth %prep # Check can fail if previous versions/attempts are still around. pwd rm -rf logicp* %setup -q -b 3 # Those patches appear incomplete. Makefile.am are missing so that autoreconf could help: # configure.ac:1276: required file `avr/lib/avrxmega2/atxmega32x1/Makefile.in' not found # configure.ac:1300: required file `avr/lib/avrxmega6/atxmega128b1/Makefile.in' not found # 41-avr-libc-1.7.1-xmega32X1.patch # %patch41 -p1 # 42-avr-libc-1.7.1-xmega128b1.patch # %patch42 -p1 %build # Re-create build config (see avr-libc user manual, building tool chain). ./bootstrap # The build system doesn't distinguish between doc and man dirs, # so force the path in avr-man explicitly. for f in scripts/Makefile.am scripts/Makefile.in scripts/avr-man.in; do mv "$f" "$f-" sed 's/DOC_INST_DIR/MAN_INST_DIR/g' < "$f-" > "$f" done #export CFLAGS="$RPM_OPT_FLAGS" #export CXXFLAGS="$RPM_OPT_FLAGS" ./configure \ --host=avr \ --prefix=%{_prefix} \ --mandir=%{_mandir} listall -s scripts grep INST_ scripts/* %{__make} %{?_smp_mflags} \ MAN_INST_DIR=%{_mandir}/.. \ DOC_INST_DIR=%{_avrdir} # Adjust path to man pages in avr-man. # FIXME %install make \ DESTDIR=$RPM_BUILD_ROOT \ DOC_INST_DIR=$RPM_BUILD_ROOT%{_avrdir} \ install tar jxvf %{S:1} mv %{name}-user-manual-%{doc_vers} user-manual-%{doc_vers} mkdir -p $RPM_BUILD_ROOT/usr/share/doc/packages/%{name} cp -pr AUTHORS ChangeLog INSTALL LICENSE NEWS user-manual-%{doc_vers} \ $RPM_BUILD_ROOT/usr/share/doc/packages/%{name} ln -s pages.html \ $RPM_BUILD_ROOT/usr/share/doc/packages/%{name}/user-manual-%{doc_vers}/00_index.html cat >> $RPM_BUILD_ROOT/usr/share/doc/packages/%{name}/00_index.html < user-manual-%{doc_vers}/pages.html EOF mkdir -p $RPM_BUILD_ROOT/%{_mandir} tar jxvf %{S:2} -C $RPM_BUILD_ROOT/%{_mandir}/.. # gzipped to make http://dist.suse.de/data/i386/lint/avr-libc happy. find $RPM_BUILD_ROOT/%{_prefix}/share/man -type f -print0 | xargs -0 gzip # Do not run brp-strip-debug on our avr-elf objects, # or they will become non-functional. export NO_BRP_STRIP_DEBUG=true # # gcc looks here: /opt/cross/avr/lib/gcc/avr/4.3.3/../../../../avr/include # # This is effectively /opt/cross/avr/avr/include, which is not quite right. # # no idea where it comes from. Lets make a compat symlink. # ln -s ../include /opt/cross/avr/avr %check ### Basic selftest ### cd ../logicp* ## how do we tell the linker that crt*.o is at a nonstandard location? ln -s $RPM_BUILD_ROOT%{_prefix}/avr/lib/crttn*.o . ln -s $RPM_BUILD_ROOT%{_prefix}/avr/lib/avr?/crtm*.o . make test CFLAGS="-Wall -g -Os -mint8 -I$RPM_BUILD_ROOT%{_prefix}/avr/include/ -L$RPM_BUILD_ROOT%{_prefix}/avr/lib/avr4" CPU=mega8 make test CFLAGS="-Wall -g -Os -mint8 -I$RPM_BUILD_ROOT%{_prefix}/avr/include/ -L$RPM_BUILD_ROOT%{_prefix}/avr/lib/avr4" CPU=mega48 make test CFLAGS="-Wall -g -Os -mint8 -I$RPM_BUILD_ROOT%{_prefix}/avr/include/ -L$RPM_BUILD_ROOT%{_prefix}/avr/lib/avr4" CPU=mega644 make test CFLAGS="-Wall -g -Os -mint8 -I$RPM_BUILD_ROOT%{_prefix}/avr/include/ -L$RPM_BUILD_ROOT%{_prefix}/avr/lib" CPU=tiny2313 make test CFLAGS="-Wall -g -Os -mint8 -I$RPM_BUILD_ROOT%{_prefix}/avr/include/ -L$RPM_BUILD_ROOT%{_prefix}/avr/lib" CPU=tiny4313 || true %clean %if ! 0%?dont_clean_build_root %__rm -rf "$RPM_BUILD_ROOT" %endif %files %defattr (-, root, root) %doc /usr/share/doc/packages/%{name} %if %into_opt_cross /opt/* %else %{_bindir}/avr-man %{_prefix}/avr %endif %changelog * Wed Oct 23 2013 Volker Kuhlmann http://volker.top.geek.nz/contact.html - Move man pages from /usr/share/man/, where they clash with system ones. - Installation is to /usr. Prefix is /usr/avr/, to match avr-binutils! - Drop "cross-" prefix from package name. - Ensure logicp is cleaned from build environment before build. - Run avr-libc's bootstrap script before configure. * Sat Dec 8 2012 jw@suse.com - update to 1.8.0, bugfix release, including: PSTR() now has const, to be compatible with gcc-4.7.0 savannah32698-power.patch upstreamed, removed. - updated logicp to 1.02 to heal poisoned SIG_UART_RECV ==> UART_RX_vect and friends. - added avr-libc-gcc47.spec to build with the new compiler. * Tue Feb 7 2012 max@suse.com - Make the dependency on cross-avr-binutils unversioned. * Mon Mar 7 2011 jw@novell.com - testcase for tn4313 added, non-fatal. Still fails due to missing gcc binutils support - added savannah32698-power.patch - update to 1.7.1 This is primarily a bugfix release, and particularly, it fixes the infamous delay.h bug that caused the delay algorithm to be way off (https://savannah.nongnu.org/bugs/?30363). * Mon Nov 29 2010 jw@novell.com - fixed bnc#233520 * Tue Jun 22 2010 max@suse.de - update to 1.7.0 * New architecture: avrtiny10 * New devices: atmega3000, attiny84a, atmega325a, atmega3250a, atmega329a, atmega3290a, attiny4, attiny5, attiny9, attiny10, attiny20, attiny40, ATxmega128A1U, ATxmega64A1U * countless bugfixes and other improvements * Tue Mar 23 2010 jw@novell.com - moved avr-example sub package into an own package. logicp remains here as a pre-install self-test. * Sun Mar 7 2010 jw@novell.com - do not require cross-acr-gcc44, we have removed the version number from the package. * Mon Mar 1 2010 jw@novell.com - update to 1.6.8 * Added iox128a1u.h iom16hva2.h iom16hvb.h iom169pa.h iom649p.h iom64hve.h iotn261a.h iotn461a.h iotn861a.h iom324pa.h iotn10.h iotn4.h iotn5.h iotn9.h iom16a.h iom88pa.h iom644pa.h iotn24a.h iotn44a.h iotn2313a.h iotn4313.h iom8u2.h iom16u2.h iom32u2.h iox192d3.h * Add support for new devices: ATmega16HVA2, ATmega16HVB, ATmega48A, ATmega88A, ATmega168A, ATmega328, ATmega164A, ATmega324A, ATmega644A, ATmega165A, ATmega169A, ATmega645A, ATmega6450A, ATmega649A, ATmega6490A, ATmega6490P, ATmega645P, ATmega6450P, ATmega329PA. ATtiny2313A, ATtiny4313, ATtiny24A, ATtiny44A, ATmega644PA, ATmega88PA, ATmega16A, ATtiny261A, ATtiny861A, ATtiny461A, ATmega64HVE, ATmega169PA, ATmega649P, ATmega324PA. ATmega8U2, ATmega16U2, and ATmega32U2. ATxmega192D3. * Add new functions: strtok_P() and strtok_rP(). memccpy_P(). * Fix some tests to run with host computer. * several bugfixes. * Sun Feb 7 2010 jw@novell.com - updated avr_isp.pl to 0.9h, this now better handles a lrger range of dongles. * Fri Jan 22 2010 jw@suse.de - moved /usr/share/doc/avr-libc to /usr/share/doc/packages/avr-libc . - populated /usr/bin/avr* symlinks, adding /opt/cross/bin to PATH no longer needed. - added an 00_index.html to the user_manual. * Tue Jan 19 2010 jw@suse.de - rediffed patch to remove fuzz. pampered rpmlint warnings. * Sun Aug 9 2009 jw@suse.de - updated avr_common.mk to no longer rename dir if under svn - update to 1.6.7, new devices xmega192D3,mega8U2,mega16U2,ATmega32U2. various bugfixes. see http://cvs.savannah.gnu.org/viewvc/*checkout*/avr-libc/avr-libc/ChangeLog * Fri Aug 7 2009 jw@suse.de - updated avr_isp.pl to survive (unsigned char) casts, and give better diagnostics in case something else fails. * Wed May 20 2009 jw@suse.de - added a symlink so that html doku finds its examples. * Sun Apr 26 2009 jw@suse.de - updated to 1.6.6 Too many small changes to list here. See http://cvs.savannah.gnu.org/viewvc/*checkout*/avr-libc/avr-libc/ChangeLog * Wed Jan 30 2008 jw@suse.de - update to 1.6.1 * The fplib/math library is completely rewritten. * Functions of numbers to ascii conversion are completely rewritten. * Test suite is added to the Avr-libc project. * A few new util's headers: util/atomic.h, util/setbaud.h. * Many new devices added, many revised. * Sat Oct 13 2007 bwalle@suse.de - update to 1.4.6 o Exclude 64-bit types for -mint8 (obsoletes no64bit_int.patch) o varios bugfixes (upstream #18115, #18385, #18509, #18662, [#18686], #18688, #18726, #18899, #18903, #18915, #19009, #19050, [#19060], #19134, #19135, #19280, #19281, #19445, #19495, #19650, [#19666] #19841) o new devices: AT90USB82, AT90USB162, ATmega325P, ATmega3250P, ATmega329P, ATmega3290P, AT90PWM1, ATmega8HVA, ATmega16HVA o The "largedemo" has been ported to the ATtiny2313. o Integrate a copy of the license file into the documentation. o Include an alphabetical index of all globals o Added 'avr25' architecture. o new functions (memchr_P, memcmp_P, memmem, memmem_P, memrchr, memrchr_P, strcasestr, strcasestr_P, strchrnul, strchrnul_P, strchr_P, strcspn, strcspn_P, strpbrk, strpbrk_P, strrchr_P, strsep_P, strspn, strspn_P) o Optimized functions (atoi, atol, strchr, strcmp, strcmp_P, strlwr, strrev, strsep, strstr, strstr_P, strupr) * Thu Apr 5 2007 jw@suse.de - gzipped manpages to make rpmlint happy. user-manual moved *into* /usr/share/doc/packages/avr-libc. * Mon Jan 15 2007 jw@suse.de - 64bit datatypes on 64bit hosts only fail with -mint8 Now properly ifdefed. * Tue Jan 9 2007 jw@suse.de - update to 1.4.5 ATmega165P/169P support. Fixes to the HD44780 driver. Power Management API. New "asmdemo" example. sleep.h: Fix the entry for the ATtiny2313. new devices: ATmega2560, ATmega2561. fp_split.S: Pop 3 bytes for avr6 Bugs fixed: 15512 16125 16411 16434 16441 16868 17068 17470 17551 17591 17608 - make test now tests 3 CPUs * Tue Jan 9 2007 jw@suse.de - compiling and linking my logicp application as a simple selftest. - avr-64bit datatypes fail on 64bit hosts. * Tue May 30 2006 jw@suse.de - update to 1.4.4 added /opt/cross/share/man/man3/* and /opt/cross/share/doc symlink * Wed Jan 25 2006 mls@suse.de - converted neededforbuild to BuildRequires * Tue Jan 10 2006 jw@suse.de - update to 1.4.2 * Wed Nov 23 2005 jw@suse.de - upstreamed patches removed. - update to 1.4.0 * Wed Oct 5 2005 dmueller@suse.de - add norootforbuild * Wed Aug 17 2005 jw@suse.de - update to 1.2.5, fixes many things for atmega48 e.g. [#105226]. * Tue May 17 2005 jw@suse.de - removed dependency on uisp. * Tue May 10 2005 jw@suse.de - initial version: avr-libc-1.2.3