diff options
-rw-r--r-- | 0001-Allow-overriding-ENABLE_WARNINGS.patch | 100 | ||||
-rw-r--r-- | simulavr.spec | 82 |
2 files changed, 171 insertions, 11 deletions
diff --git a/0001-Allow-overriding-ENABLE_WARNINGS.patch b/0001-Allow-overriding-ENABLE_WARNINGS.patch new file mode 100644 index 0000000..5d1aac6 --- /dev/null +++ b/0001-Allow-overriding-ENABLE_WARNINGS.patch @@ -0,0 +1,100 @@ +From d79a71676675636b89c78ddcc41b6faea52d410d Mon Sep 17 00:00:00 2001 +From: Hans Ulrich Niedermann <hun@n-dimensional.de> +Date: Wed, 30 Dec 2009 19:31:51 +0100 +Subject: [PATCH] Allow overriding ENABLE_WARNINGS + +Change occurences of @ENABLE_WARNINGS@ to $(ENABLE_WARNINGS) in +Makefile.am and Makefile.in. Then we can just override ENABLE_WARNINGS +on the make command line if necessary. + +We require this to work around the flex generated code ignoring the +fwrite(3) return value, which generates a warning. +--- + src/Makefile.am | 2 +- + src/Makefile.in | 2 +- + src/disp-vcd/Makefile.am | 2 +- + src/disp-vcd/Makefile.in | 2 +- + src/disp/Makefile.am | 2 +- + src/disp/Makefile.in | 2 +- + 6 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index 8cba01d..cbb59f1 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -24,7 +24,7 @@ MAINTAINERCLEANFILES = Makefile.in + SUBDIRS = getopt @ac_curses_disp_dirs@ disp-vcd + DIST_SUBDIRS = getopt disp disp-vcd + +-AM_CFLAGS = @ENABLE_WARNINGS@ \ ++AM_CFLAGS = $(ENABLE_WARNINGS) \ + -I$(top_srcdir)/src/getopt + + bin_PROGRAMS = simulavr +diff --git a/src/Makefile.in b/src/Makefile.in +index 921b5ce..61fb64d 100644 +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -225,7 +225,7 @@ target_vendor = @target_vendor@ + MAINTAINERCLEANFILES = Makefile.in + SUBDIRS = getopt @ac_curses_disp_dirs@ disp-vcd + DIST_SUBDIRS = getopt disp disp-vcd +-AM_CFLAGS = @ENABLE_WARNINGS@ \ ++AM_CFLAGS = $(ENABLE_WARNINGS) \ + -I$(top_srcdir)/src/getopt + + simulavr_LDADD = getopt/libgnugetopt.a +diff --git a/src/disp-vcd/Makefile.am b/src/disp-vcd/Makefile.am +index cfcae4f..bcf0ebc 100644 +--- a/src/disp-vcd/Makefile.am ++++ b/src/disp-vcd/Makefile.am +@@ -29,7 +29,7 @@ simulavr_vcd_SOURCES = disp.c \ + config_parser.y \ + config_scanner.l + +-AM_CFLAGS = @ENABLE_WARNINGS@ \ ++AM_CFLAGS = $(ENABLE_WARNINGS) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/getopt + +diff --git a/src/disp-vcd/Makefile.in b/src/disp-vcd/Makefile.in +index bb22595..46fc128 100644 +--- a/src/disp-vcd/Makefile.in ++++ b/src/disp-vcd/Makefile.in +@@ -219,7 +219,7 @@ simulavr_vcd_SOURCES = disp.c \ + config_parser.y \ + config_scanner.l + +-AM_CFLAGS = @ENABLE_WARNINGS@ \ ++AM_CFLAGS = $(ENABLE_WARNINGS) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/getopt + +diff --git a/src/disp/Makefile.am b/src/disp/Makefile.am +index 23238bd..99c6d95 100644 +--- a/src/disp/Makefile.am ++++ b/src/disp/Makefile.am +@@ -25,6 +25,6 @@ bin_PROGRAMS = simulavr-disp + simulavr_disp_SOURCES = disp.c + simulavr_disp_LDADD = @ac_lib_curses@ ../getopt/libgnugetopt.a + +-AM_CFLAGS = @ENABLE_WARNINGS@ \ ++AM_CFLAGS = $(ENABLE_WARNINGS) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/getopt +diff --git a/src/disp/Makefile.in b/src/disp/Makefile.in +index 4a266fd..f6b14f7 100644 +--- a/src/disp/Makefile.in ++++ b/src/disp/Makefile.in +@@ -210,7 +210,7 @@ target_vendor = @target_vendor@ + MAINTAINERCLEANFILES = Makefile.in + simulavr_disp_SOURCES = disp.c + simulavr_disp_LDADD = @ac_lib_curses@ ../getopt/libgnugetopt.a +-AM_CFLAGS = @ENABLE_WARNINGS@ \ ++AM_CFLAGS = $(ENABLE_WARNINGS) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/getopt + +-- +1.6.2.5 + diff --git a/simulavr.spec b/simulavr.spec index 8c66f27..91f9b24 100644 --- a/simulavr.spec +++ b/simulavr.spec @@ -1,43 +1,103 @@ +# Only build noarch subpackages if distribution supports it +%if 0%{?fedora} >= 11 +%global noarch_subpackage BuildArch: noarch +%else +%global noarch_subpackage %{nil} +%endif + + Name: simulavr Version: 0.1.2.6 Release: 1%{?dist} Summary: An AVR Simulator -Group: FIXME -License: FIXME +Group: Development/Tools +License: GPLv2+ URL: http://savannah.nongnu.org/projects/simulavr/ Source0: http://mirrors.zerg.biz/nongnu/simulavr/%{name}-%{version}.tar.gz +# Allow overriding ENABLE_WARNINGS definition +Patch100: 0001-Allow-overriding-ENABLE_WARNINGS.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -#BuildRequires: -#Requires: +BuildRequires: doxygen +#BuildRequires: avr-libc +#Requires: + %description A simulator for chips from Atmel's AVR series of microcontrollers. +%package doc +Group: Development/Tools +Summary: simulavr documentation (HTML and PDF) +%{noarch_subpackage} + + +%description doc +A simulator for chips from Atmel's AVR series of microcontrollers. + +This subpackage contains the documentation in HTML and PDF format. + + %prep %setup -q +%patch100 -p1 -b .override-enable-warnings %build -%configure -make %{?_smp_mflags} +%configure --enable-pdf +# FIXME: Skip -Werror for now, as flex output code ignores fwrite() return value +make %{?_smp_mflags} ENABLE_WARNINGS="-Wall -Winline" %install -rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT +rm -rf "%{buildroot}" +make install DESTDIR="%{buildroot}" +rm -f "%{buildroot}%{_infodir}/dir" +mv "%{buildroot}%{_docdir}/%{name}-%{version}" docdir %clean -rm -rf $RPM_BUILD_ROOT +rm -rf "%{buildroot}" + + +%check +make DESTDIR="%{buildroot}" check + + +%post +/sbin/install-info "%{_infodir}/simulavr.info.gz" "%{_infodir}/dir" || : + + +%preun +if [ "$1" = 0 ]; then + /sbin/install-info --delete "%{_infodir}/simulavr.info.gz" "%{_infodir}/dir" || : +fi %files %defattr(-,root,root,-) -%doc - +%doc AUTHORS COPYING +%doc ChangeLog ChangeLog-2001 ChangeLog-2002 ChangeLog-2003 +%doc ProjSummary README README.gdb README.opcodes TODO +%{_bindir}/simulavr +%{_bindir}/simulavr-disp +%{_bindir}/simulavr-vcd +%{_infodir}/simulavr.info.gz +%{_mandir}/man1/simulavr-disp.1.gz +%{_mandir}/man1/simulavr.1.gz + + +%files doc +%defattr(-,root,root,-) +%doc docdir/html +%doc docdir/internals_html +%doc docdir/simulavr-internals.pdf +%doc docdir/simulavr.pdf %changelog +* Wed Dec 30 2009 Hans Ulrich Niedermann <hun@n-dimensional.de> - 0.1.2.6-1 +- Initial RPM package for Fedora + |