# Ref. http://cvs.openpkg.org/fileview?f=openpkg-src/smlnj/smlnj.spec %define smlnjhome %{_libdir}/smlnj %define priority 20 Name: smlnj Version: 110.65 Release: 1%{?dist} Summary: Standard ML of New Jersey Group: Development/Languages URL: http://www.smlnj.org License: BSD-like Source0: %{name}-%{version}.tar.bz2 Source1: smlnj-doc.tar.bz2 #Patch0: smlnj-%{version}-config.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: tetex-latex BuildRequires: tetex-dvips BuildRequires: perl BuildRequires: curl Requires: /usr/sbin/update-alternatives %description Standard ML of New Jersey is most popular implementation of Standard Meta Language (SML). It is compilant with SML'97 specification. SML is functional language from ML family (like CAML). %prep %setup -q %setup -q -D -T -a 1 tar zxf config.tgz echo "SRCARCHIVEURL=file://"$(pwd)"/" > config/srcarchiveurl %build # Build process requires $RPM_BUILD_ROOT so that build it after. %install rm -rf $RPM_BUILD_ROOT export URLGETTER=curl export INSTALLDIR=$RPM_BUILD_ROOT%{smlnjhome} install -d $RPM_BUILD_ROOT%{smlnjhome}/ CFLAGS="%{rpmcflags}" config/install.sh chmod u+w -R $RPM_BUILD_ROOT%{smlnjhome} for f in .link-sml .run-sml heap2exec ml-build ml-makedepend; do \ %{__sed} -i -e "s!$RPM_BUILD_ROOT!!g" \ -e "/x.*$.*SMLNJ_HOME.*/i\export SMLNJ_HOME=%{smlnjhome}" \ $RPM_BUILD_ROOT%{smlnjhome}/bin/$f done # Hack: strip wrongly embedded working dirname in objects. #find $RPM_BUILD_ROOT -type f -name \*.cm -print | xargs \ # %{__sed} -i -e "s!$RPM_BUILD_DIR/%{name}-%{version}/!!g" install -d $RPM_BUILD_ROOT%{_bindir} #for f in {heap2asm,heap2exec,ml-build,ml-burg,ml-lex,ml-makedepend,ml-nlffigen,ml-yacc,nowhere,sml}; \ for f in {heap2asm,heap2exec,ml-build,ml-burg,ml-lex,ml-makedepend,ml-nlffigen,ml-yacc,nowhere}; \ do cat < $RPM_BUILD_ROOT%{_bindir}/$f #! /bin/sh set -e exec %{smlnjhome}/bin/${f} $@ EOF chmod +x $RPM_BUILD_ROOT%{_bindir}/$f done %clean rm -rf $RPM_BUILD_ROOT %post update-alternatives --install %{_bindir}/sml sml %{smlnjhome}/bin/sml %{priority} %postun [ $1 -eq 0 ] || exit 0 update-alternatives --remove sml %{smlnjhome}/bin/sml %files %defattr(-,root,root) %doc %{version}-README.html HISTORY %doc doc/* %{_bindir}/* %{_libdir}/smlnj %changelog * Sat Jul 7 2007 Satoru SATOH - 110.65-1 - New upstream - Corrected wrongly embedded build-time path in object files. - Use alternatives. * Tue Apr 3 2007 Satoru SATOH - 110.62-1 - New upstream - Added readme files and HISTORY. - Explicitly make use of local tgz files by specifying SRCARCHIVEURL. * Sun Jun 19 2005 Gerard Milmeister - 110.54-1 - First Fedora release