scfc / rpms / gambit-c

Forked from rpms/gambit-c 5 years ago
Clone
7b38a4d
%define dirname gambc-v4_2_8
7b38a4d
7b38a4d
%if %($(pkg-config emacs) ; echo $?)
7b38a4d
%define emacs_version 22.2
7b38a4d
%define emacs_lispdir %{_datadir}/emacs/site-lisp
7b38a4d
%define emacs_startdir %{_datadir}/emacs/site-lisp/site-start.d
7b38a4d
%else
7b38a4d
%define emacs_version %(pkg-config emacs --modversion)
7b38a4d
%define emacs_lispdir %(pkg-config emacs --variable sitepkglispdir)
7b38a4d
%define emacs_startdir %(pkg-config emacs --variable sitestartdir)
7b38a4d
%endif
7b38a4d
7b38a4d
Name:           gambit-c
7b38a4d
Version:        4.2.8
51590d7
Release:        6%{?dist}
7b38a4d
Summary:        Gambit-C Scheme programming system
7b38a4d
7b38a4d
Group:          Development/Languages
7564f61
License:        ASL 2.0 or LGPLv2
7b38a4d
URL:            http://www.iro.umontreal.ca/~gambit
7b38a4d
Source0:        http://www.iro.umontreal.ca/~gambit/download/gambit/v4.2/source/%{dirname}.tgz
a3c2c77
Source1:        http://toute.ca/termite080616_0057.tar.gz
7b38a4d
Source2:        gambit-init.el
7b38a4d
Patch0:         gambc-v4_2_8-modtime.patch
7564f61
Patch1:		termite-fix-defrandom.patch
7b38a4d
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
7b38a4d
7b38a4d
BuildRequires:  emacs emacs-el
7b38a4d
Requires:       gcc
7b38a4d
7b38a4d
%description
7b38a4d
Gambit-C includes a Scheme interpreter and a Scheme compiler which can
7b38a4d
be used to build standalone executables.  Because the compiler
7b38a4d
generates portable C code it is fairly easy to port to any platform
7b38a4d
with a decent C compiler.
7b38a4d
7b38a4d
The Gambit-C system conforms to the R4RS, R5RS and IEEE Scheme
7b38a4d
standards.  The full numeric tower is implemented, including: infinite
7b38a4d
precision integers (bignums), rationals, inexact reals (floating point
7b38a4d
numbers), and complex numbers.
7b38a4d
7b38a4d
7b38a4d
%package        doc
7b38a4d
Summary:        Documentation for %{name}
7b38a4d
Group:          Documentation
7b38a4d
Requires:       %{name} = %{version}-%{release}
7b38a4d
Requires(post):  info
7b38a4d
Requires(preun): info
7b38a4d
7b38a4d
7b38a4d
%description    doc
7b38a4d
Gambit-C includes a Scheme interpreter and a Scheme compiler which can
7b38a4d
be used to build standalone executables.  Because the compiler
7b38a4d
generates portable C code it is fairly easy to port to any platform
7b38a4d
with a decent C compiler.
7b38a4d
7b38a4d
This package contains the Gambit-C user manual in HTML and PDF formats.
7b38a4d
7b38a4d
7564f61
%package        termite
7564f61
Summary:        Termite distributed programming system
7564f61
Group:          Development/Languages
7564f61
URL:            http://www.toute.ca/
7564f61
Requires:       %{name} = %{version}-%{release}
7564f61
7564f61
7564f61
%description    termite
7564f61
Termite is an Erlang-like distributed programming system written in Scheme.
7564f61
7564f61
7564f61
%package	termite-doc
7564f61
Summary:	Examples for the Termite distributed programming system
7564f61
Group:		Documentation
7564f61
Requires:	%{name}-termite = %{version}-%{release}
7564f61
7564f61
%description	termite-doc
7564f61
Termite is an Erlang-like distributed programming system written in Scheme.
7564f61
7564f61
This package contains examples and benchmarks for Termite.
7564f61
7564f61
7b38a4d
%package -n emacs-gambit
7b38a4d
Summary:        Gambit-C editing mode for Emacs
7b38a4d
Group:          Applications/Editors
7b38a4d
Requires:       emacs(bin) >= %{emacs_version}
7b38a4d
7b38a4d
7b38a4d
%description -n emacs-gambit
7b38a4d
An Emacs mode for editing Gambit-C Scheme source code.
7b38a4d
7b38a4d
7b38a4d
%prep
7564f61
%setup -q -n %{dirname} -a1
7b38a4d
%patch0 -p1 -b .modtime
7564f61
# Not using -b, as the directory content is moved to DESTDIR as a whole
7564f61
# This way we don't end up with the unpatched file lying around
7564f61
%patch1 -p0
7564f61
7b38a4d
find . -name '*.scm' | xargs chmod 0644
7b38a4d
find examples -name '*.scm' | xargs sed -i 's|/usr/local/Gambit-C|/usr|g'
7b38a4d
sed -i "s|\xE9|\xC3\xA9|g" doc/gambit-c.info-2
7b38a4d
# Permission fixes
7b38a4d
chmod -x lib/{mem.c,setup.h}
7b38a4d
7b38a4d
7b38a4d
%build
7b38a4d
%configure --enable-single-host \
7b38a4d
           --enable-gcc-opts \
51590d7
           --prefix=%{_libdir}/%{name} \
7e43580
	   --includedir=%{_includedir}
7b38a4d
7b38a4d
make %{?_smp_mflags}
7b38a4d
7b38a4d
# Compile emacs module
7b38a4d
(cd misc && emacs -batch -f batch-byte-compile gambit.el)
7b38a4d
7b38a4d
7b38a4d
%check
7b38a4d
make check
7b38a4d
7b38a4d
7b38a4d
%install
7b38a4d
rm -rf $RPM_BUILD_ROOT
7b38a4d
make install prefix=$RPM_BUILD_ROOT%{_libdir}/%{name}
7b38a4d
mkdir -p $RPM_BUILD_ROOT%{_bindir}
7b38a4d
for i in gsc gsi
7b38a4d
do
7b38a4d
  ln -sf ../%{_lib}/%{name}/current/bin/$i $RPM_BUILD_ROOT%{_bindir}/$i
7b38a4d
done
7b38a4d
cat > $RPM_BUILD_ROOT%{_bindir}/gsix <
7b38a4d
#!/bin/sh
7b38a4d
%{_libdir}/%{name}/current/bin/six $@
7b38a4d
EOF
7b38a4d
chmod +x $RPM_BUILD_ROOT%{_bindir}/gsix
7b38a4d
7564f61
# Remove duplicate docs
7b38a4d
rm -rf $RPM_BUILD_ROOT%{_libdir}/%{name}/current/doc
7b38a4d
mkdir -p $RPM_BUILD_ROOT%{_infodir}
7b38a4d
cp -a $RPM_BUILD_ROOT%{_libdir}/%{name}/current/info/* $RPM_BUILD_ROOT%{_infodir}
7b38a4d
rm -rf $RPM_BUILD_ROOT%{_libdir}/%{name}/current/info
7b38a4d
rm -rf $RPM_BUILD_ROOT%{_libdir}/%{name}/current/share
7b38a4d
7564f61
# Emacs mode files
7b38a4d
mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir}
7b38a4d
mkdir -p $RPM_BUILD_ROOT%{emacs_startdir}
7b38a4d
cp -p misc/gambit.el* $RPM_BUILD_ROOT%{emacs_lispdir}
7b38a4d
cp -p %{SOURCE2} $RPM_BUILD_ROOT%{emacs_startdir}
7b38a4d
7b38a4d
# Termite
7564f61
chmod 755 termite termite/examples
7564f61
chmod -R g+r-w,o+r termite
7564f61
cd termite
7564f61
mv tsi $RPM_BUILD_ROOT%{_bindir}
7b38a4d
7b38a4d
# Fix script interpreters
7564f61
find benchmarks examples otp -name '*.scm' | xargs \
7564f61
  sed -i 's|/usr/local/Gambit-C/bin/gsi|/usr/bin/gsi|g'
7564f61
chmod +x otp/gen_event.scm
7b38a4d
51590d7
# Link static libs
51590d7
(cd $RPM_BUILD_ROOT%{_libdir} && ln -s %{name}/current/lib/*.a .)
51590d7
7564f61
# Move docs
7564f61
mkdir ../termite-doc ../termite-more-docs
7564f61
mv CHANGELOG LICENSE README VERSION ../termite-doc
7564f61
mv benchmarks examples ../termite-more-docs
7564f61
rm INSTALL
7564f61
cd ..
7564f61
7564f61
mv termite $RPM_BUILD_ROOT%{_libdir}/%{name}/current/lib
7b38a4d
7b38a4d
7b38a4d
%clean
7b38a4d
rm -rf $RPM_BUILD_ROOT
7b38a4d
7b38a4d
7b38a4d
%post doc
7b38a4d
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir 2>/dev/null || :
7b38a4d
7b38a4d
7b38a4d
%preun doc
7b38a4d
if [ $1 -eq 0 ]; then
7b38a4d
  /sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir 2>/dev/null || :
7b38a4d
fi
7b38a4d
7b38a4d
7b38a4d
%files
7b38a4d
%defattr(-,root,root,-)
7b38a4d
%doc LGPL.txt LICENSE-2.0.txt README
7564f61
%exclude %{_bindir}/tsi
7b38a4d
%{_bindir}/*
51590d7
%{_includedir}/*.h
7564f61
%exclude %{_libdir}/%{name}/*/lib/termite
7b38a4d
%{_libdir}/%{name}
7b38a4d
7b38a4d
%files termite
7b38a4d
%defattr(-,root,root,-)
7564f61
%doc termite-doc/*
7564f61
%{_bindir}/tsi
7564f61
%{_libdir}/%{name}/v%{version}/lib/termite
7b38a4d
7b38a4d
%files -n emacs-gambit
7b38a4d
%defattr(-,root,root,-)
7b38a4d
%{emacs_lispdir}/*
7b38a4d
7b38a4d
%files doc
7b38a4d
%defattr(-,root,root,-)
7b38a4d
%doc doc/gambit-c.html doc/gambit-c.pdf examples
7b38a4d
%{_infodir}/*
7b38a4d
7564f61
%files termite-doc
7564f61
%defattr(-,root,root,-)
7564f61
%doc termite-more-docs/*
7564f61
7b38a4d
7b38a4d
7b38a4d
%changelog
51590d7
* Mon Jul 14 2008 Michel Alexandre Salim <salimma@fedoraproject.org> - 4.2.8-6
51590d7
- Put include files and libraries in standard paths
51590d7
7564f61
* Thu Jun 19 2008 Michel Alexandre Salim <salimma@fedoraproject.org> - 4.2.8-5
7564f61
- Package Termite as a module instead of bundling a custom Gambit-C with it
7564f61
60e780e
* Thu Jun 19 2008 Michel Alexandre Salim <salimma@fedoraproject.org> - 4.2.8-4
60e780e
- Permission fixes for Termite subpackage
60e780e
7b38a4d
* Wed Jun 18 2008 Michel Alexandre Salim <salimma@fedoraproject.org> - 4.2.8-3
7b38a4d
- Bundle Termite as a subpackage
7b38a4d
7b38a4d
* Sat Jun  7 2008 Michel Alexandre Salim <salimma@fedoraproject.org> - 4.2.8-2
7b38a4d
- Rename six symlink to avoid clash with existing six package
7b38a4d
7b38a4d
* Mon Jun  2 2008 Michel Alexandre Salim <salimma@fedoraproject.org> - 4.2.8-1
7b38a4d
- Update to 4.2.8
7b38a4d
- Rename to gambit-c
7b38a4d
7b38a4d
* Fri Dec 28 2007 Gerard Milmeister <gemi@bluewin.ch> - 4.1.2-1
7b38a4d
- new release 4.1.2
7b38a4d
7b38a4d
* Sat Apr 14 2007 Gerard Milmeister <gemi@bluewin.ch> - 4.0-1.b22
7b38a4d
- new version 4.0b22
7b38a4d
7b38a4d
* Sun Oct 15 2006 Gerard Milmeister <gemi@bluewin.ch> - 4.0-1.b20
7b38a4d
- new version 4.0b20
7b38a4d
7b38a4d
* Sat Feb  4 2006 Gerard Milmeister <gemi@bluewin.ch> - 4.0-1.b17
7b38a4d
- new version 4.0b17
7b38a4d
7b38a4d
* Mon Nov  7 2005 Gerard Milmeister <gemi@bluewin.ch> - 4.0-1.b15
7b38a4d
- New Version 4.0b15
7b38a4d
7b38a4d
* Fri Aug 12 2005 Gerard Milmeister <gemi@bluewin.ch> - 4.0-1.b14
7b38a4d
- First Fedora release
7b38a4d