%{!?_with_bootstrap: %global bootstrap 1} Name: smlnj Version: 110.80 Release: 1%{?dist} Summary: Standard ML of New Jersey License: MIT URL: http://www.smlnj.org Source0: http://smlnj.cs.uchicago.edu/dist/working/%{version}/config.tgz Source1: http://smlnj.cs.uchicago.edu/dist/working/%{version}/cm.tgz Source2: http://smlnj.cs.uchicago.edu/dist/working/%{version}/compiler.tgz Source3: http://smlnj.cs.uchicago.edu/dist/working/%{version}/runtime.tgz Source4: http://smlnj.cs.uchicago.edu/dist/working/%{version}/system.tgz Source5: http://smlnj.cs.uchicago.edu/dist/working/%{version}/old-basis.tgz Source6: http://smlnj.cs.uchicago.edu/dist/working/%{version}/smlnj-lib.tgz Source7: http://smlnj.cs.uchicago.edu/dist/working/%{version}/MLRISC.tgz Source8: http://smlnj.cs.uchicago.edu/dist/working/%{version}/ckit.tgz Source9: http://smlnj.cs.uchicago.edu/dist/working/%{version}/nlffi.tgz Source10: http://smlnj.cs.uchicago.edu/dist/working/%{version}/cml.tgz Source11: http://smlnj.cs.uchicago.edu/dist/working/%{version}/eXene.tgz Source12: http://smlnj.cs.uchicago.edu/dist/working/%{version}/ml-lpt.tgz Source13: http://smlnj.cs.uchicago.edu/dist/working/%{version}/ml-lex.tgz Source14: http://smlnj.cs.uchicago.edu/dist/working/%{version}/ml-yacc.tgz Source15: http://smlnj.cs.uchicago.edu/dist/working/%{version}/ml-burg.tgz Source16: http://smlnj.cs.uchicago.edu/dist/working/%{version}/pgraph.tgz Source17: http://smlnj.cs.uchicago.edu/dist/working/%{version}/trace-debug-profile.tgz Source18: http://smlnj.cs.uchicago.edu/dist/working/%{version}/heap2asm.tgz Source19: http://smlnj.cs.uchicago.edu/dist/working/%{version}/smlnj-c.tgz Source20: http://smlnj.cs.uchicago.edu/dist/working/%{version}/doc.tgz # Bootstrap source: Source21: http://smlnj.cs.uchicago.edu/dist/working/%{version}/boot.x86-unix.tgz # Extra manpages, will be shipped in upstream 110.81: # http://smlnj-gforge.cs.uchicago.edu/tracker/index.php?func=detail&aid=176&group_id=33&atid=215 Source100: ml-burg.1 Source101: ml-lex.1 Source102: ml-nlffigen.1 Source103: ml-yacc.1 Source104: nowhere.1 Source105: heap2asm.1 Source106: heap2exec.1 # smlnj lacks 64-bit support, and has not been bootstrapped on arm. ExclusiveArch: %{ix86} %if ! 0%{?bootstrap} BuildRequires: smlnj %endif # Use execstack to remove executable stack, will be fixed in 110.81: #http://smlnj-gforge.cs.uchicago.edu/tracker/index.php?func=detail&aid=175&group_id=33&atid=215 BuildRequires: execstack # For building docs: BuildRequires: latexmk BuildRequires: texlive BuildRequires: texlive-epsf BuildRequires: texlive-stmaryrd BuildRequires: texlive-wrapfig BuildRequires: texlive-xypic BuildRequires: transfig %description Standard ML of New Jersey (SML/NJ) is a compiler and programming environment for the Standard ML programming language. It was originally developed jointly at Bell Laboratories and Princeton University, and is now a joint project between researchers at Bell Laboratories, Lucent Technologies, Princeton University, Yale University (The FLINT Project), AT&T Research, and the University of Chicago. %package doc Summary: The SML/NJ Documentation %description doc Documentation for Standard ML of New Jersey (SML/NJ). %package static Summary: Static library for SML/NJ Requires: %{name}%{?_isa} = %{version}-%{release} %description static This package contains the statically-linked libraries for SML/NJ. Install this package if you want to use heap2exec to statically link against SML/NJ. %prep # config/install.sh unpacks the sources for us. %setup -q -T -c -a 0 for i in %{sources}; do cp "$i" . done %build # On Fedora, we want to self-bootstrap when we can, cf.: # http://www.smlnj.org/doc/CM/btcomp/btcomp.html %if ! 0%{?bootstrap} eval $(%{_libdir}/smlnj/bin/.arch-n-opsys) rm -f boot.$ARCH-unix.tgz mkdir bootstrap for file in system.tgz MLRISC.tgz cm.tgz compiler.tgz ml-yacc.tgz smlnj-lib.tgz pgraph.tgz; do tar -xzf $file -C bootstrap done pushd bootstrap/system sed -i -e 's@\.\./\.\./@\.\./@g' pathconfig echo 'CMB.make ();' | sml '$smlnj/cmb.cm' sed -i -e 's@twoup=.*@twoup=%{_libdir}/smlnj@' makeml # We have to rebuild to a temporary directory to get the paths right. ./makeml -rebuild self-bootstrap rm -rf sml.boot.$ARCH-unix mv self-bootstrap.boot.$ARCH-unix sml.boot.$ARCH-unix tar -zcf ../../boot.$ARCH-unix.tgz sml.boot.$ARCH-unix popd %endif # We build all targets: cat > config/targets << EOF request old-basis request ml-ulex request ml-ulex-mllex-tool request ml-lex request ml-lex-lex-ext request ml-yacc request ml-yacc-grm-ext request ml-antlr request ml-lpt-lib request ml-burg request smlnj-lib request pgraph-util request tdp-util request cml request cml-lib request eXene request mlrisc request ckit request ml-nlffi-lib request ml-nlffigen request mlrisc-tools request nowhere request heap2asm request doc EOF # Pass the optflags to make: sed -ie 's@\($MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS\)@\1 CFLAGS="%{optflags}"@' config/install.sh # CM_DIR_ARC is changed to not hide CM metadata in .cm directories. URLGETTER=false CM_DIR_ARC=CM config/install.sh # Build docs by hand, skipping cml and smlnj-lib, which rely on mldoc. # The install script deletes some directories which still contain docs. tar -zxf cm.tgz -C base tar -zxf compiler.tgz -C base tar -zxf system.tgz -C base tar -zxf smlnj-c.tgz pushd base/cm/Doc latex manual.tex && latex manual.tex && dvipdfmx -o manual.pdf manual.dvi popd pushd ml-burg/doc transfig -L ps tree.fig && make latex doc.tex && latex doc.tex && dvipdfmx -o doc.pdf doc.dvi popd pushd ml-lex latex lexgen.tex && latex lexgen.tex && dvipdfmx -o lexgen.pdf lexgen.dvi popd pushd ml-lpt/doc latex manual.tex && latex manual.tex && dvipdfmx -o manual.pdf manual.dvi popd pushd MLRISC sed -i \ -e '1s@#!/usr/local/bin/perl@#!/usr/bin/perl@' \ -e 's@require "mltex.thm";@do "mltex.thm" || die "$!";@' \ Doc/html/mltex2html make -C Doc && make -C Tools/Doc popd pushd ml-yacc/doc latex mlyacc.tex && latex mlyacc.tex && dvipdfmx -o mlyacc.pdf mlyacc.dvi popd pushd nlffi/lib/Doc/manual latex nlffi.tex && latex nlffi.tex && dvipdfmx -o nlffi.pdf nlffi.dvi popd # Done building docs %install mkdir -p %{buildroot}/%{_bindir} mkdir -p %{buildroot}/%{_libdir}/smlnj mv bin lib %{buildroot}/%{_libdir}/smlnj execstack -c %{buildroot}/%{_libdir}/smlnj/bin/.run/run.x86-linux execstack -c %{buildroot}/%{_libdir}/smlnj/bin/.run/run.x86-linux.so # Fix paths. for file in %{buildroot}%{_libdir}/smlnj/bin/{*,.*}; do if [[ -f $file ]]; then sed -i \ -e 's@BIN_DIR=".*"@BIN_DIR="%{_libdir}/smlnj/bin"@g' \ -e 's@LIB_DIR=".*"@LIB_DIR="%{_libdir}/smlnj/lib"@g' \ $file fi done # Fix permissions chmod 0755 %{buildroot}%{_libdir}/smlnj/bin/.arch-n-opsys chmod 0755 %{buildroot}%{_libdir}/smlnj/bin/.link-sml chmod 0755 %{buildroot}%{_libdir}/smlnj/bin/.run-sml chmod 0755 %{buildroot}%{_libdir}/smlnj/bin/.run/run.*-linux chmod 0755 %{buildroot}%{_libdir}/smlnj/bin/heap2asm chmod 0755 %{buildroot}%{_libdir}/smlnj/bin/heap2exec chmod 0755 %{buildroot}%{_libdir}/smlnj/bin/ml-antlr chmod 0755 %{buildroot}%{_libdir}/smlnj/bin/ml-build chmod 0755 %{buildroot}%{_libdir}/smlnj/bin/ml-burg chmod 0755 %{buildroot}%{_libdir}/smlnj/bin/ml-lex chmod 0755 %{buildroot}%{_libdir}/smlnj/bin/ml-makedepend chmod 0755 %{buildroot}%{_libdir}/smlnj/bin/ml-nlffigen chmod 0755 %{buildroot}%{_libdir}/smlnj/bin/ml-ulex chmod 0755 %{buildroot}%{_libdir}/smlnj/bin/ml-yacc chmod 0755 %{buildroot}%{_libdir}/smlnj/bin/nowhere chmod 0755 %{buildroot}%{_libdir}/smlnj/bin/sml # Make wrapper scripts. for file in %{buildroot}%{_libdir}/smlnj/bin/*; do cmd=$(basename $file) cat > %{buildroot}%{_bindir}/$cmd << EOF #!/bin/sh export SMLNJ_HOME="%{_libdir}/smlnj" exec %{_libdir}/smlnj/bin/$cmd "\$@" EOF chmod 0755 %{buildroot}%{_bindir}/$cmd done # Copy man pages. mkdir -p %{buildroot}/%{_mandir}/{man1,man7} cp -p doc/man/man1/* %{buildroot}/%{_mandir}/man1 cp -p doc/man/man7/* %{buildroot}/%{_mandir}/man7 cp -p heap2asm.1 heap2exec.1 ml-burg.1 ml-lex.1 ml-nlffigen.1 ml-yacc.1 nowhere.1 %{buildroot}/%{_mandir}/man1 # Move docs into a separate directory. mkdir -p docs/{base,ckit,cml,eXene,ml-burg,ml-lex,ml-lpt,MLRISC,ml-yacc,nlffi,smlnj-c,smlnj-lib} mkdir -p docs/base/{cm,compiler,system} mkdir -p docs/MLRISC/Tools mkdir -p docs/nlffi/{lib,gen} mv base/cm/Doc/manual.pdf docs/base/cm mv base/compiler/{README,MAP} docs/base/compiler mv base/system/{README,ADD-PRIMOPS} docs/base/system mv ckit/{BUGS,HISTORY,README,doc/overview,doc/overview.html,doc/todo} docs/ckit mv cml/{CHANGES,README,TODO} docs/cml mv doc/html/{extensions.html,HISTORY.html,readme/%{version}-README.html} docs mv eXene/{CHANGES,README*} docs/eXene mv ml-burg/{doc/doc.pdf,README} docs/ml-burg mv ml-lex/{lexgen.pdf,mlex_int.doc,README} docs/ml-lex mv ml-lpt/{doc/manual.pdf,README,todo} docs/ml-lpt mv MLRISC/Doc/latex/*.pdf docs/MLRISC mv MLRISC/Tools/Doc/*.ps docs/MLRISC/Tools mv ml-yacc/{README,doc/mlyacc.pdf,doc/tech.doc} docs/ml-yacc mv nlffi/gen/README docs/nlffi/gen mv nlffi/lib/{README,Doc/mini-tutorial.txt,Doc/manual/nlffi.pdf} docs/nlffi/lib mv smlnj-c/README docs/smlnj-c mv smlnj-lib/{CHANGES,README,PORTING,TODO} docs/smlnj-lib %files %{_bindir}/* %{_libdir}/smlnj %exclude %{_libdir}/smlnj/bin/.run/*.a %{_mandir}/man1/* %{_mandir}/man7/* %license smlnj-lib/LICENSE %files doc %doc docs/* %license smlnj-lib/LICENSE %files static %{_libdir}/smlnj/bin/.run/*.a %changelog * Thu Jan 26 2017 Daniel Moerner - 110.80-1 - New upstream release. - Build upstream documentation and ship in separate -doc package. * Mon May 30 2011 Ricky Zhou - 110.73-1 - Upstream released a new version. * Fri Mar 12 2010 Ricky Zhou - 110.72-1 - Upstream released a new version. * Sat Dec 05 2009 Ricky Zhou - 110.71-1 - Upstream released a new version. * Fri May 29 2009 Ricky Zhou - 110.67-1 - Initial RPM Package.