Sophie

Sophie

distrib > Mandriva > 9.0 > i586 > media > contrib-src > by-pkgid > e2a9a64a33b233188ee8ea834625232e > files > 2

smlnj-110.0.7-1mdk.src.rpm

%define name	smlnj
%define version	110.0.7
%define release	1mdk

Summary:	Standard ML of New Jersey
Name:		%name
Version:	%version
Release:	%release
License:	BSD-like
Group:		Development/Other
Source0:	%{name}-%{version}.tar.bz2
URL:		http://www.smlnj.org/
BuildRequires:	tetex-latex
BuildRequires:	tetex-dvips
BuildRoot:	%{_tmppath}/%{name}-%{version}-root

%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
tar -xzf config.tar.Z

%build
CFLAGS="%{rpmcflags}" config/install.sh

%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_libdir}/smlnj
cp -a bin lib src $RPM_BUILD_ROOT%{_libdir}/smlnj
chmod u+w -R $RPM_BUILD_ROOT%{_libdir}/smlnj
sed \
	-e "s|@BINDIR@|%{_libdir}/smlnj/bin|" \
	-e "s|@VERSION@|`cat config/version`|" \
	config/_run-sml > $RPM_BUILD_ROOT%{_libdir}/smlnj/bin/.run-sml
install -d $RPM_BUILD_ROOT%{_bindir}
for f in $RPM_BUILD_ROOT%{_libdir}/smlnj/lib/*cm; do
	sed -e "s|$PWD|%{_libdir}/smlnj|" $f > $f.new
	mv $f.new $f
done
# damn hacks..
rep=$(echo "$PWD" | sed -e 's|.|/|g' | \
      sed -e "s|$(echo "%{_libdir}/smlnj" | \
	      sed -e 's|.|.|g')\$|%{_libdir}/smlnj|")
sed -e "s|$PWD|$rep|g" bin/.heap/sml-cm*-linux > \
	$RPM_BUILD_ROOT/%{_libdir}/smlnj/bin/.heap/sml-cm*-linux

ln -sf %{_libdir}/smlnj/bin/{ml-{burg,lex,yacc},sml,sml-cm} \
       $RPM_BUILD_ROOT%{_bindir}

# documetation... gotta extract from src/ tree
rm -rf docs
mkdir docs
# CM
cp -f src/cm/Doc/manual.ps docs/cm.ps
mkdir docs/cm
cp -f src/cm/Doc/HTML/*.{html,css,gif} docs/cm
# CML
cp -a src/cml/doc/HTML docs/cml
cp -f src/cml/doc/Hardcopy/manual.ps docs/cml.ps
# ml-burg
cp -f src/ml-burg/doc/doc.ps docs/ml-burg.ps
# ml-lex
cd src/ml-lex
latex lexgen.tex
dvips lexgen.dvi -o ml-lex.ps
cd ../..
cp -f src/ml-lex/ml-lex.ps docs/
cp -f src/ml-lex/mlex_int.doc docs/ml-lex-int.txt
# ml-yacc
cd src/ml-yacc/doc
latex mlyacc.tex
dvips mlyacc.dvi -o ml-yacc.ps
cd ../../..
cp -f src/ml-yacc/doc/ml-yacc.ps docs/
cp -f src/ml-yacc/doc/tech.doc docs/ml-yacc-tech.txt
cp -a src/ml-yacc/examples docs/ml-yacc-examples
# smlnj-lib
cp -a src/smlnj-lib/Doc/HTML docs/smlnj-lib

# get rid of docs from src/ tree...
rm -rf $RPM_BUILD_ROOT%{_libdir}/smlnj/src/*/{Doc,doc}

cp -f 110* docs/
rm docs/110-README.html
gzip -9nf docs/110* docs/*.ps docs/*.txt

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc docs/*
%attr(755,root,root) %{_bindir}/*
%dir %{_libdir}/smlnj
%dir %{_libdir}/smlnj/bin
%{_libdir}/smlnj/bin/.heap
%attr(755,root,root) %{_libdir}/smlnj/bin/.arch-n-opsys
%attr(755,root,root) %{_libdir}/smlnj/bin/.run-sml
%dir %{_libdir}/smlnj/bin/.run
%attr(755,root,root) %{_libdir}/smlnj/bin/.run/*
%{_libdir}/smlnj/bin/*
%{_libdir}/smlnj/lib
# some equivalent of make clean could be probably done here...
# however this source is needed to comiple some programs
%{_libdir}/smlnj/src

%changelog
* Tue Sep 17 2002 Lenny Cartier <lenny@mandrakesoft.com> 110.0.7-1mdk
- from Austin Acton <aacton@yorku.ca> :
	- chopped up PLD specfile to build for Mandrake 9.0