File sdcc.spec of Package sdcc
#
# spec file for package sdcc
#
# Copyright (c) 2015 SUSE LINUX 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/
#
Name: sdcc
Version: 3.5.0
Release: 0
Summary: Small Device C Compiler
License: GPL-2.0+ and GPL-3.0+
Group: Development/Languages/C and C++
Url: http://sdcc.sourceforge.net/
Source: http://downloads.sourceforge.net/%{name}/%{name}-src-%{version}.tar.bz2
Source1: %{name}-rpmlintrc
Patch1: sdcc_add_ppc64le_suse_support.patch
BuildRequires: bison
BuildRequires: boost-devel
BuildRequires: fdupes
BuildRequires: flex
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: glibc-devel
BuildRequires: gputils
BuildRequires: libstdc++-devel
BuildRequires: libtool
BuildRequires: ncurses-devel
BuildRequires: python-devel
# documentation
%if 0%{?suse_version} >= 1320
BuildRequires: latex2html
BuildRequires: lyx
BuildRequires: makeinfo
BuildRequires: texlive-babel-english
BuildRequires: texlive-dvipdfmx
BuildRequires: texlive-fancyhdr
BuildRequires: texlive-latex
BuildRequires: texlive-makeindex
BuildRequires: texlive-ulem
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
SDCC is a C compiler for 8051 class and similar microcontrollers.
The package includes the compiler, assemblers and linkers, a device
simulator and a core library. The processors supported (to a varying
degree) include the 8051, ds390, z80, hc08, and PIC.
%package doc
Summary: Documentation for the SDCC C compiler
Group: Documentation/HTML
%if 0%{?suse_version} >= 1140
BuildArch: noarch
%endif
%description doc
SDCC is a C compiler for 8051 class and similar microcontrollers.
The package includes the compiler, assemblers and linkers, a device
simulator and a core library. The processors supported (to a varying
degree) include the 8051, ds390, z80, hc08, and PIC.
This package contains documentation for SDCC C compiler.
%package libc-sources
Summary: Small Device C Compiler
Group: Development/Languages/C and C++
Requires: %{name} = %{version}
%description libc-sources
SDCC is a C compiler for 8051 class and similar microcontrollers.
The package includes the compiler, assemblers and linkers, a device
simulator and a core library. The processors supported (to a varying
degree) include the 8051, ds390, z80, hc08, and PIC.
This package contains sources for the C library and other files for
development.
%prep
%setup -q
rm support/regression/tests/bug3304184.c
%patch1 -p1
%build
CFLAGS="%{optflags} -fno-strict-aliasing" \
%configure \
--docdir=%{_docdir}/sdcc \
%if 0%{?suse_version} >= 1320
--enable-doc
%endif
make %{?_smp_mflags}
%install
%make_install
# install documentation
mkdir -p %{buildroot}%{_docdir}/%{name}/sdas
cp sdas/doc/* %{buildroot}%{_docdir}/%{name}/sdas
cp ChangeLog %{buildroot}%{_docdir}/%{name}
cp COPYING %{buildroot}%{_docdir}/%{name}
mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp
mv %{buildroot}%{_bindir}/*.el %{buildroot}%{_datadir}/emacs/site-lisp
#remove useless file
rm %{buildroot}%{_docdir}/%{name}/INSTALL.txt
cp ChangeLog %{buildroot}%{_docdir}/%{name}
cp COPYING %{buildroot}%{_docdir}/%{name}
#remove strange suff (installed by mistake?)
rm -rf %{buildroot}%{_includedir}
rm -rf %{buildroot}%{_libdir}
# remove non-free libraries, see doc/README.txt: Licenses
rm -rf %{buildroot}%{_datadir}/%{name}/non-free/
# duplicates
%fdupes -s %{buildroot}%{_datadir}/%{name}/lib/src
%if 0%{?suse_version} <= 1210
find %{buildroot}%{_datadir}/%{name} -name '*.Po' -exec rm {} \;
rm -rf %{buildroot}%{_datadir}/%{name}/lib/src/pic16/*/.deps
rm -rf %{buildroot}%{_datadir}/%{name}/lib/src/pic14/libsdcc/*/.deps
rm -rf %{buildroot}%{_datadir}/%{name}/lib/src/pic14/libm/.deps
rm -rf %{buildroot}%{_datadir}/%{name}/non-free/lib/src/pic16/libdev/.deps
%endif
%files
%defattr(-,root,root)
%dir %{_docdir}/%{name}
%{_docdir}/%{name}/ChangeLog
%{_docdir}/%{name}/COPYING
%{_docdir}/%{name}/README.txt
%{_bindir}/*
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/include
%{_datadir}/%{name}/lib
%exclude %{_datadir}/%{name}/lib/src
%dir %{_datadir}/emacs/site-lisp
%{_datadir}/emacs/site-lisp/*.el
%files libc-sources
%defattr(-,root,root)
%{_datadir}/%{name}/lib/src
%files doc
%defattr(-,root,root)
%dir %{_docdir}/%{name}
%{_docdir}/%{name}/ucsim
%{_docdir}/%{name}/sdas
%if 0%{?suse_version} >= 1320
%{_docdir}/%{name}/sdccman.pdf
%endif
%changelog