Blob Blame History Raw
%define mlton_bootstrap 0

Name:		mlton
Version:	20070826
Release:	18%{?dist}
Summary:	Optimizing compiler for Standard ML

Group:		Development/Languages
License:	MIT
URL:		http://mlton.org/
Source0:	http://mlton.org/pages/Download/attachments/%{name}-%{version}-1.src.tgz

#Source1:	mlton-20070826-1.arm-linux.tgz

Patch0:		mlton-20070826-debuginfo.patch
Patch1:		mlton-20070826-no-execmem.patch
Patch2:		mlton-20070826-arm.patch

BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:	gmp-devel htmldoc tex(latex)
%if ! %{mlton_bootstrap}
BuildRequires:	mlton
%endif

Requires:	gmp-devel gcc

# need to bootstrap ppc64 still
ExcludeArch:	ppc64


# description taken from the Debian package by Stephen Weeks
%description
MLton is a whole-program optimizing compiler for Standard ML.  MLton
generates standalone executables with excellent runtime performance,
is SML 97 compliant, and has a complete basis library.	MLton has
source-level profiling, a fast C FFI, an interface to the GNU
multiprecision library, and lots of useful libraries.


%prep
%setup -q

# disable strip so debuginfo packages work
%patch0 -p1 -b .debuginfo

# no execmem
%patch1 -p1 -b .no-execmem

# ARM
%patch2 -p1 -b .arm

%if %{mlton_bootstrap}
%setup -T -D -q -a 1
sed -i 's/\(^lib=\).*$/\1\$MLTON_BOOTSTRAP_DIR\/lib\/mlton/g'  \
	usr/bin/mlton
%endif

# Filter unwanted Requires:
cat << \EOF > %{name}-req
#!/bin/sh
%{__perl_requires} $* |\
  sed -e '/perl(mltex.thm)/d'
EOF

%define __perl_requires %{_builddir}/%{name}-%{version}/%{name}-req
chmod +x %{__perl_requires}


%build
%if %{mlton_bootstrap}
export MLTON_BOOTSTRAP_DIR=$(pwd)/usr
export PATH="${PATH}":$MLTON_BOOTSTRAP_DIR/bin
%endif

make OPTFLAGS="$RPM_OPT_FLAGS"


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT MAN_PREFIX_EXTRA=/share \
	TDOC=$RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} \
	ULIB=%{_lib}/mlton

# remove unecessary regression test
rm -rf $RPM_BUILD_ROOT%{_libdir}/mlton/sml/ckit-lib/regression

# move some documentation around
mv $RPM_BUILD_ROOT%{_libdir}/mlton/sml/ckit-lib/doc \
	$RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/ckit-lib
mv $RPM_BUILD_ROOT%{_libdir}/mlton/sml/smlnj-lib/Doc \
	$RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/smlnj-lib


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc %{_docdir}/%{name}-%{version}
%{_bindir}/ml*
%{_libdir}/mlton
%{_mandir}/man1/*


%changelog
* Sun May 31 2009 Adam Goode <adam@spicenitz.org> - 20070826-17
- Use non-trunk version of MLton to bootstrap ARM

* Tue May 26 2009 Adam Goode <adam@spicenitz.org> - 20070826-16
- Add missing ARM patch

* Tue May 26 2009 Adam Goode <adam@spicenitz.org> - 20070826-15
- Bootstrap ARM

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20070826-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sat Aug 30 2008 Adam Goode <adam@spicenitz.org> - 20070826-13
- RPM 4.6 fix for patch tag
- Update LaTeX build requires

* Sat Feb  9 2008 Adam Goode <adam@spicenitz.org> - 20070826-12
- Introduce patch to not call mprotect with PROT_EXEC

* Fri Jan 18 2008 Adam Goode <adam@spicenitz.org> - 20070826-11
- Rebuild for new GCC

* Thu Sep 27 2007 Adam Goode <adam@spicenitz.org> - 20070826-10
- Disable bootstrap

* Thu Sep 27 2007 Adam Goode <adam@spicenitz.org> - 20070826-9
- Re-bootstrap ppc

* Wed Sep 26 2007 Adam Goode <adam@spicenitz.org> - 20070826-8
- Really fix SRPM conditionals

* Wed Sep 26 2007 Adam Goode <adam@spicenitz.org> - 20070826-7
- Work around strange SRPM problem in conditionals
- Fix changelog (forgot release 5?)

* Wed Sep 26 2007 Adam Goode <adam@spicenitz.org> - 20070826-6
- Build on ppc now that #247407 is fixed

* Thu Sep 13 2007 Adam Goode <adam@spicenitz.org> - 20070826-4
- Do not condition bootstrap source tag

* Thu Sep 13 2007 Adam Goode <adam@spicenitz.org> - 20070826-3
- Bootstrap x86_64

* Mon Aug 27 2007 Adam Goode <adam@spicenitz.org> - 20070826-2
- Exclude ppc for now (GCC internal compiler error!)

* Sun Aug 26 2007 Adam Goode <adam@spicenitz.org> - 20070826-1
- Update to new release

* Wed Aug 22 2007 Adam Goode <adam@spicenitz.org> - 20061107-4
- Exclude ppc64 for now

* Wed Aug 22 2007 Adam Goode <adam@spicenitz.org> - 20061107-3
- Update license tag
- Rebuild for buildid

* Fri Nov 24 2006 Adam Goode <adam@spicenitz.org> - 20061107-2
- Use RPM_OPT_FLAGS
- Correctly instantiate version
- Adjust patches

* Sun Nov 12 2006 Adam Goode <adam@spicenitz.org> - 20061107-1
- New release, taken from svn://mlton.org/mlton/tags/on-20061107

* Thu Aug 31 2006 Adam Goode <adam@spicenitz.org> - 20051202-8.1
- Mass rebuild

* Sun Jul  9 2006 Adam Goode <adam@spicenitz.org> - 20051202-8
- Conditionalize bootstrapping and disable it

* Sat Jul  1 2006 Adam Goode <adam@spicenitz.org> - 20051202-7
- Fix macro in changelog
- Remove mixed use of tabs and spaces

* Sun Jun 25 2006 Adam Goode <adam@spicenitz.org> - 20051202-6
- Build runtime with -g, but not -gstabs+
- Re-enable debuginfo packages

* Wed Jun 21 2006 Adam Goode <adam@spicenitz.org> - 20051202-5
- Disable empty debuginfo packages

* Wed Jun 21 2006 Adam Goode <adam@spicenitz.org> - 20051202-4
- Be more specific about license
- Add "which" to BuildRequires until everyone is running new mock

* Tue Jun 20 2006 Adam Goode <adam@spicenitz.org> - 20051202-3
- Create PDF documentation for mlyacc and mllex (instead of .ps.gz)
- Move ckit-lib/doc and smlnj-lib/Doc to %%{_docdir}
- Remove regression files from ckit

* Thu Jun  8 2006 Adam Goode <adam@spicenitz.org> - 20051202-2
- Change to use bootstrap

* Wed Jun  7 2006 Adam Goode <adam@spicenitz.org> - 20051202-1
- Initial release for FC5