5158d66
%define mlton_bootstrap 0
5158d66
04e2c3e
Name:		mlton
4ac738d
Version:	20061107
8d3c94b
Release:	4%{?dist}
04e2c3e
Summary:	Optimizing compiler for Standard ML
04e2c3e
04e2c3e
Group:		Development/Languages
171aff6
License:	MIT
04e2c3e
URL:		http://mlton.org/
4ac738d
Source0:	mlton-%{version}.tar.bz2
5158d66
%if %{mlton_bootstrap}
5158d66
# taken from mlton_20060213-1 from Debian
04e2c3e
Source1:	mlton-bootstrap.i386.tar.bz2
04e2c3e
Source2:	mlton-bootstrap.ppc.tar.bz2
5158d66
%endif
04e2c3e
bf8016d
Patch0:		mlton-20051202-pdf-docs.patch
bf8016d
Patch1:		mlton-20061107-debuginfo.patch
bf8016d
Patch2:		mlton-20061107-optflags.patch
04e2c3e
04e2c3e
04e2c3e
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
04e2c3e
4ac738d
BuildRequires:	gmp-devel htmldoc tetex-latex
5158d66
%if ! %{mlton_bootstrap}
5158d66
BuildRequires:	mlton
5158d66
%endif
5158d66
04e2c3e
Requires:	gmp-devel gcc
04e2c3e
3cbf1ea
# not yet available for 64-bit arch (#198764)
8d3c94b
ExcludeArch:	x86_64 ppc64
04e2c3e
04e2c3e
04e2c3e
# description taken from the Debian package by Stephen Weeks
04e2c3e
%description
04e2c3e
MLton is a whole-program optimizing compiler for Standard ML.  MLton
04e2c3e
generates standalone executables with excellent runtime performance,
04e2c3e
is SML 97 compliant, and has a complete basis library.	MLton has
04e2c3e
source-level profiling, a fast C FFI, an interface to the GNU
04e2c3e
multiprecision library, and lots of useful libraries.
04e2c3e
04e2c3e
04e2c3e
%prep
04e2c3e
%setup -q
04e2c3e
cf886e0
# instantiate version numbers
bf8016d
make version VERSION=%{version}
cf886e0
04e2c3e
# build documentation as PDF
bf8016d
%patch -P 0 -p1 -b .pdf-docs
bf8016d
# disable strip so debuginfo packages work
bf8016d
%patch -P 1 -p1 -b .debuginfo
bf8016d
# enable RPM_OPT_FLAGS
bf8016d
%patch -P 2 -p1 -b .optflags
04e2c3e
04e2c3e
# set correct version of PDF guide until this is fixed upstream
04e2c3e
sed -i 's/\(^version=\).*$/\1%{version}/g' bin/make-pdf-guide
04e2c3e
5158d66
%if %{mlton_bootstrap}
04e2c3e
%ifarch i386
04e2c3e
%setup -T -D -q -a 1
04e2c3e
%endif
04e2c3e
%ifarch ppc
04e2c3e
%setup -T -D -q -a 2
04e2c3e
%endif
04e2c3e
sed -i 's/\(^lib=\).*$/\1\$MLTON_BOOTSTRAP_DIR\/usr\/lib\/mlton/g'  \
04e2c3e
	bootstrap/usr/bin/mlton
5158d66
%endif
04e2c3e
04e2c3e
04e2c3e
%build
5158d66
%if %{mlton_bootstrap}
04e2c3e
export MLTON_BOOTSTRAP_DIR=$(pwd)/bootstrap
04e2c3e
export PATH="${PATH}":$MLTON_BOOTSTRAP_DIR/usr/bin
5158d66
%endif
04e2c3e
bf8016d
make OPTFLAGS="$RPM_OPT_FLAGS"
04e2c3e
04e2c3e
04e2c3e
%install
04e2c3e
rm -rf $RPM_BUILD_ROOT
04e2c3e
make install DESTDIR=$RPM_BUILD_ROOT MAN_PREFIX_EXTRA=/share \
04e2c3e
	TDOC=$RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
04e2c3e
04e2c3e
# remove unecessary regression test
04e2c3e
rm -rf $RPM_BUILD_ROOT%{_libdir}/mlton/sml/ckit-lib/regression
04e2c3e
04e2c3e
# move some documentation around
04e2c3e
mv $RPM_BUILD_ROOT%{_libdir}/mlton/sml/ckit-lib/doc \
04e2c3e
	$RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/ckit-lib
04e2c3e
mv $RPM_BUILD_ROOT%{_libdir}/mlton/sml/smlnj-lib/Doc \
04e2c3e
	$RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/smlnj-lib
04e2c3e
04e2c3e
04e2c3e
%clean
04e2c3e
rm -rf $RPM_BUILD_ROOT
04e2c3e
04e2c3e
04e2c3e
%files
04e2c3e
%defattr(-,root,root,-)
04e2c3e
%doc %{_docdir}/%{name}-%{version}
04e2c3e
%{_bindir}/ml*
04e2c3e
%{_libdir}/mlton
04e2c3e
%{_mandir}/man1/*
04e2c3e
bf8016d
04e2c3e
%changelog
8d3c94b
* Wed Aug 22 2007 Adam Goode <adam@spicenitz.org> - 20061107-4
8d3c94b
- Exclude ppc64 for now
8d3c94b
a8f9b6e
* Wed Aug 22 2007 Adam Goode <adam@spicenitz.org> - 20061107-3
a8f9b6e
- Update license tag
a8f9b6e
- Rebuild for buildid
a8f9b6e
bf8016d
* Fri Nov 24 2006 Adam Goode <adam@spicenitz.org> - 20061107-2
bf8016d
- Use RPM_OPT_FLAGS
bf8016d
- Correctly instantiate version
bf8016d
- Adjust patches
bf8016d
4ac738d
* Sun Nov 12 2006 Adam Goode <adam@spicenitz.org> - 20061107-1
4ac738d
- New release, taken from svn://mlton.org/mlton/tags/on-20061107
4ac738d
53ac43a
* Thu Aug 31 2006 Adam Goode <adam@spicenitz.org> - 20051202-8.1
53ac43a
- Mass rebuild
53ac43a
5158d66
* Sun Jul  9 2006 Adam Goode <adam@spicenitz.org> - 20051202-8
5158d66
- Conditionalize bootstrapping and disable it
5158d66
04e2c3e
* Sat Jul  1 2006 Adam Goode <adam@spicenitz.org> - 20051202-7
04e2c3e
- Fix macro in changelog
04e2c3e
- Remove mixed use of tabs and spaces
04e2c3e
04e2c3e
* Sun Jun 25 2006 Adam Goode <adam@spicenitz.org> - 20051202-6
04e2c3e
- Build runtime with -g, but not -gstabs+
04e2c3e
- Re-enable debuginfo packages
04e2c3e
04e2c3e
* Wed Jun 21 2006 Adam Goode <adam@spicenitz.org> - 20051202-5
04e2c3e
- Disable empty debuginfo packages
04e2c3e
04e2c3e
* Wed Jun 21 2006 Adam Goode <adam@spicenitz.org> - 20051202-4
04e2c3e
- Be more specific about license
04e2c3e
- Add "which" to BuildRequires until everyone is running new mock
04e2c3e
04e2c3e
* Tue Jun 20 2006 Adam Goode <adam@spicenitz.org> - 20051202-3
04e2c3e
- Create PDF documentation for mlyacc and mllex (instead of .ps.gz)
04e2c3e
- Move ckit-lib/doc and smlnj-lib/Doc to %%{_docdir}
04e2c3e
- Remove regression files from ckit
04e2c3e
04e2c3e
* Thu Jun  8 2006 Adam Goode <adam@spicenitz.org> - 20051202-2
04e2c3e
- Change to use bootstrap
04e2c3e
04e2c3e
* Wed Jun  7 2006 Adam Goode <adam@spicenitz.org> - 20051202-1
04e2c3e
- Initial release for FC5