70e2823
Name:           sdcc
b662307
Version:        2.9.0
b825c9c
Release:        3%{?dist}
70e2823
Summary:        Small Device C Compiler
70e2823
Group:          Applications/Engineering
3d74d92
License:        GPLv2+
eebd19f
URL:            http://sdcc.sourceforge.net/
b662307
Source0:        http://downloads.sourceforge.net/sdcc/sdcc-src-%{version}.tar.bz2
70e2823
Source1:        README.fedora
b662307
Patch0:         sdcc-2.9.0-patch-out-getline.diff
b662307
Patch1:         sdcc-2.9.0-configure.diff
b825c9c
Patch2:         sdcc-2.9.0-r5476-fix-doublefree.diff
70e2823
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
70e2823
f261839
BuildRequires:  autoconf
70e2823
BuildRequires:  bison
f261839
BuildRequires:  flex
f261839
BuildRequires:  gc-devel
6e90ff8
BuilDrequires:  gputils
70e2823
BuildRequires:  lyx
70e2823
BuildRequires:  latex2html
70e2823
70e2823
70e2823
%description
70e2823
SDCC is a C compiler for 8051 class and similar microcontrollers.
70e2823
The package includes the compiler, assemblers and linkers, a device
70e2823
simulator and a core library. The processors supported (to a varying
70e2823
degree) include the 8051, ds390, z80, hc08, and PIC.
70e2823
70e2823
70e2823
%package libc-sources
70e2823
Summary:        Small Device C Compiler
70e2823
Group:          Applications/Engineering
3810a36
License:        GPLv2+
70e2823
Requires:       sdcc = %{version}-%{release}
70e2823
70e2823
%description libc-sources
70e2823
SDCC is a C compiler for 8051 class and similar microcontrollers.
25e5454
This package includes the sources for the C library, and is only necessary
70e2823
if you want to modify the C library or as reference of how it works.
70e2823
3810a36
3810a36
%package -n emacs-sdcc
3810a36
Summary:        Emacs extensions for SDCC
3810a36
Group:          Applications/Editors
3810a36
License:        GPLv2+
3810a36
Requires:       sdcc = %{version}-%{release}
3810a36
Requires:       emacs(bin)
3810a36
3810a36
%description -n emacs-sdcc
3810a36
Emacs extensions for SDCC.
3810a36
3810a36
70e2823
%prep
70e2823
%setup -q -n sdcc
59d394e
%patch0 -p1
b662307
%patch1 -p1
b825c9c
%patch2 -p2
70e2823
find -name '*.[ch]' -exec chmod -x '{}' \;
70e2823
6e90ff8
# Extract %%__os_install_post into os_install_post~
6e90ff8
cat << \EOF > os_install_post~
6e90ff8
%__os_install_post
6e90ff8
EOF
6e90ff8
6e90ff8
# Generate customized brp-*scripts
6e90ff8
cat os_install_post~ | while read a x y; do
6e90ff8
case $a in
6e90ff8
# Prevent brp-strip* from trying to handle foreign binaries
6e90ff8
*/brp-strip*)
6e90ff8
  b=$(basename $a)
6e90ff8
  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
6e90ff8
  chmod a+x $b
6e90ff8
  ;;
6e90ff8
esac
6e90ff8
done
6e90ff8
6e90ff8
sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
6e90ff8
< os_install_post~ > os_install_post 
6e90ff8
70e2823
70e2823
%build
b662307
# Rebuild configure scripts (patched configure.in s in patch0).
b662307
autoconf
b662307
cd debugger/mcs51 ; autoconf ; cd ../..
b662307
cd sim/ucsim ; autoconf ; cd ../..
b662307
70e2823
%configure --enable-doc --enable-libgc STRIP=:
434816b
make Q=
70e2823
70e2823
70e2823
%install
70e2823
rm -rf $RPM_BUILD_ROOT
70e2823
make install DESTDIR=$RPM_BUILD_ROOT Q=
eebd19f
mv $RPM_BUILD_ROOT%{_datadir}/doc installed-docs
70e2823
install -m 644 %SOURCE1 installed-docs
4c78baf
mkdir -p $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
4c78baf
mv $RPM_BUILD_ROOT%{_bindir}/*.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
70e2823
find $RPM_BUILD_ROOT -type f -name \*.c -exec chmod a-x '{}' \;
eebd19f
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/sdcc
eebd19f
mv $RPM_BUILD_ROOT%{_bindir}/* $RPM_BUILD_ROOT%{_libexecdir}/sdcc
a7fa497
eebd19f
# Create launch scripts in %{_bindir}
eebd19f
pushd $RPM_BUILD_ROOT%{_bindir}
191c52a
for x in ../libexec/sdcc/*; do
a7fa497
echo "#!/bin/sh
a7fa497
PATH=/usr/libexec/sdcc:\$PATH
a7fa497
/usr/libexec/%{name}/$(basename $x) \"\$@\"" > %{name}-$(basename $x)
a7fa497
chmod 755 %{name}-$(basename $x)
a7fa497
done
70e2823
popd
70e2823
70e2823
70e2823
%clean
70e2823
rm -rf $RPM_BUILD_ROOT
70e2823
70e2823
70e2823
%files
70e2823
%defattr(-,root,root,-)
70e2823
%doc installed-docs/*
70e2823
%{_bindir}/*
70e2823
%{_libexecdir}/%{name}
70e2823
%{_datadir}/%{name}
70e2823
%exclude %{_datadir}/%{name}/lib/src
70e2823
70e2823
70e2823
%files libc-sources
70e2823
%defattr(-,root,root,-)
70e2823
%{_datadir}/%{name}/lib/src
70e2823
3810a36
3810a36
%files -n emacs-sdcc
3810a36
%defattr(-,root,root,-)
25e5454
%{_datadir}/emacs/site-lisp/*.el
3810a36
3810a36
70e2823
%changelog
b825c9c
* Mon Jul 20 2009 Conrad Meyer <konrad@tylerc.org> - 2.9.0-3
b825c9c
- Fix double-free (rhbz# 509278) with patch from upstream.
b825c9c
6e90ff8
* Wed Jul 1 2009 Conrad Meyer <konrad@tylerc.org> - 2.9.0-2
6e90ff8
- Fix #454205 by BR'ing gputils and re-adding install_post hack.
6e90ff8
b662307
* Thu Apr 30 2009 Conrad Meyer <konrad@tylerc.org> - 2.9.0-1
b662307
- Bump to 2.9.0.
b662307
f3dbe06
* Thu Feb 26 2009 Conrad Meyer <konrad@tylerc.org> - 2.8.0-5
f3dbe06
- Make subpackages noarch.
f3dbe06
4672896
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8.0-4
4672896
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
4672896
3810a36
* Thu Nov 13 2008 Conrad Meyer <konrad@tylerc.org> - 2.8.0-3
3810a36
- Separate out emacs-sdcc subpackage.
3810a36
191c52a
* Thu Oct 16 2008 José Matos <jamatos@fc.up.pt> - 2.8.0-2
191c52a
- use lyx to generate the pdf documentation and ignore its warnings (for now)
191c52a
eebd19f
* Tue Sep 9 2008 Conrad Meyer <konrad@tylerc.org> - 2.8.0-1
eebd19f
- Bump to 2.8.0.
eebd19f
- Patch configure to not mess up CFLAGS.
eebd19f
- Patch debugger Makefile to not break canonicalized paths.
eebd19f
3d74d92
* Thu Sep  4 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.6.0-13
3d74d92
- fix license tag
3d74d92
434816b
* Sun Mar 2  2008 Marek Mahut <mmahut@fedoraproject.org> - 2.6.0-12
434816b
- Fixing build problems under GCC 4.3
434816b
0866ea8
* Wed Feb 20 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.6.0-11
0866ea8
- Autorebuild for GCC 4.3
0866ea8
59d394e
* Sat Apr 07 2007 Trond Danielsen <trond.danielsen@gmail.com> - 2.6.0-10
59d394e
- Added patch to fix a problem with sdccman.lyx that caused lyx to fail.
59d394e
a7fa497
* Fri Mar 23 2007 Trond Danielsen <trond.danielsen@gmail.com> - 2.6.0-9
a7fa497
- Removed symlinks, added scripts (solves bug #233385).
a7fa497
70e2823
* Thu Feb 29 2007 Trond Danielsen <trond.danielsen@gmail.com> - 2.6.0-8
70e2823
- Added Fedora specific README file.
70e2823
- Corrected permissions on files in debuginfo package.
70e2823
70e2823
* Wed Feb 28 2007 Trond Danielsen <trond.danielsen@gmail.com> - 2.6.0-7
70e2823
- Updated requirement for libc-source to include version and release number.
70e2823
70e2823
* Wed Feb 28 2007 Trond Danielsen <trond.danielsen@gmail.com> - 2.6.0-6
70e2823
- Renamed source code package to libc-sources.
70e2823
- Change BuildRequire from byacc to bison.
70e2823
- Added "Require: sdcc" to libc-sources package.
70e2823
- Empty %doc entry removed.
70e2823
- Updated description of libc-sources package.
70e2823
70e2823
* Tue Feb 27 2007 Trond Danielsen <trond.danielsen@gmail.com> - 2.6.0-5
70e2823
- Source URL updated.
70e2823
- Separate src package created.
70e2823
- Disabling stripping of binaries to get proper debuginfo package.
70e2823
70e2823
* Mon Feb 26 2007 Ralf Corsépius <rc040203@freenet.de> - 2.6.0-4
70e2823
- Add sdcc-2.6.0-configure.diff.
70e2823
- Pass Q= to make to make building verbose.
191c52a
- Add __os_install_post post-hacks to prevent brp-strip from processing
70e2823
  foreign binaries.
70e2823
70e2823
* Mon Feb 26 2007 Trond Danielsen <trond.danielsen@gmail.com> - 2.6.0-3
70e2823
- Broken symlinks fixed.
70e2823
70e2823
* Mon Feb 5 2007 Trond Danielsen <trond.danielsen@gmail.com> - 2.6.0-2
70e2823
- Emacs scripts moved to the correct folder.
70e2823
- Moved binaries to /urs/libexec/sdcc, added symlinks with sdcc- prefix in /usr/bin.
191c52a
- Various rpmlint errors fixed.
70e2823
70e2823
* Thu Feb 1 2007 Trond Danielsen <trond.danielsen@gmail.com> - 2.6.0-1
70e2823
- Initial version.