# --- disable building of debug packages
%define debug_package %{nil}
%define __install_info /sbin/install-info
%define _iconsdir %{_datadir}/icons
%define _liconsdir %{_iconsdir}/large
%define _miconsdir %{_iconsdir}/mini
%define _menudir %{_libdir}/menu
# By default, this spec file will generate RPMs for CMUCL
# This can be changed by modifying the variables below.
%define enable_clisp 0
%define clisp_flags --disable-clisp
%define clisp_version 2.33
%define enable_cmucl 1
%define cmucl_flags --enable-cmucl
%define enable_sbcl 0
%define sbcl_flags --disable-sbcl
%define enable_gcl 0
%define gcl_flags --disable-gcl
%define build_emacs 1
%define build_book 1
%{!?update_menus: %define update_menus /bin/true}
%{!?clean_menus: %define clean_menus /bin/true}
# Inhibit automatic compressing of info files. Compressed info
# files break maxima's internal help.
%define __spec_install_post /bin/true
Summary: Maxima Symbolic Computation Program
Name: maxima
Version: 5.9.0.9beta2
Release: 1.alu.rh9.1
License: GPL
Group: Development/Languages
URL: http://maxima.sourceforge.net
Source0: %{name}-%{version}.tar.gz
Source1: maxima-new-16.xpm
Source2: maxima-new-32.xpm
Source3: maxima-new-48.xpm
Source4: maxima-xmaxima.menu
Source6: maxima-modes.el
Source7: breqn-0.94.tar.bz2
Source8: maxima-dimension.tex
Source9: maxima-pdiff.tex
Patch1: maxima.el-xemacs.patch
PreReq: %{__install_info}
BuildRequires: sed perl tetex texinfo tetex-latex automake >=3D 1.7 autoconf
%if %{enable_clisp}
BuildRequires: clisp
%endif
%if %{enable_cmucl}
BuildRequires: cmucl
%endif
%if %{enable_sbcl}
BuildRequires: sbcl
%endif
%if %{enable_gcl}
BuildRequires: gcl
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
%description
Maxima is a full symbolic computation program. It is full featured
doing symbolic manipulation of polynomials, matrices, rational
functions, integration, Todd-coxeter, graphing, bigfloats. It has a
symbolic debugger source level debugger for maxima code. Maxima is
based on the original Macsyma developed at MIT in the 1970's. It is
quite reliable, and has good garbage collection, and no memory leaks.
It comes with hundreds of self tests.
%package xmaxima
Summary: Tcl/Tk interface to Maxima
Group: Development/Languages
Requires: maxima tk
Provides: xmaxima
%description xmaxima
Tcl/Tk interface to Maxima.
%if %{enable_clisp}
%package exec-clisp
Summary: Maxima compiled with clisp
Group: Development/Languages
Requires: maxima
Provides: maxima_exec
%description exec-clisp
Maxima compiled with clisp.
%endif
%if %{enable_cmucl}
%package exec-cmucl
Summary: Maxima compiled with CMUCL
Group: Development/Languages
Requires: maxima
Provides: maxima_exec
%description exec-cmucl
Maxima compiled with CMUCL.
%endif
%if %{enable_sbcl}
%package exec-sbcl
Summary: Maxima compiled with SBCL
Group: Development/Languages
Requires: sbcl maxima
Provides: maxima_exec
%description exec-sbcl
Maxima compiled with SBCL.
%endif
%if %{enable_gcl}
%package exec-gcl
Summary: Maxima compiled with GCL
Group: Development/Languages
Requires: maxima
Provides: maxima_exec
%description exec-gcl
Maxima compiled with Gnu Common Lisp.
%endif
%if %{build_emacs}
%package -n emacs-maxima
Summary: Emacs Maxima modes
Summary (ru_RU.UTF-8): Emacs =D0=BC=D0=BE=D0=B4=D1=8B =D0=B4=D0=BB=D1=8F=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B =D1=81 Maxima
Group: Editors
Requires: maxima emacs auctex
Obsoletes: maxima-emacs
%description -n emacs-maxima
Set of Maxima emacs modes.
%endif
# /////////////////////////////////////////////////////////////////////////////
%prep
%setup -q
%patch1 -p1
%if %{build_emacs}
perl -i -pe 's:/usr/local/info:/usr/share/info:' \
interfaces/emacs/emaxima/maxima.el
perl -i -pe \
's/(defcustom\s+maxima-info-index-file\s+)(\S+)/$1\"maxima.info-16\"/' \
interfaces/emacs/emaxima/maxima.el
%endif
%configure %{?sbcl_flags:} %{?cmucl_flags:} %{?gcl_flags:} %{?clisp_flags:}
# /////////////////////////////////////////////////////////////////////////////
%build
make
# --- store breqn LaTeX package for maxima book compilation
%if %{build_book}
%__tar jxf %SOURCE7 -C doc/maximabook
%endif
pushd doc
%if %{build_book}
pushd maximabook
cp ../../share/physics/dimension.tex ../../share/physics/dimension.tex-
cp %SOURCE8 ../../share/physics/dimension.tex
cp %SOURCE9 ../../share/calculus/pdiff.tex
TEXINPUTS=3D"${TEXINPUTS}${PWD}/../..:"; export TEXINPUTS; make pdf-final
rm -f ../../share/calculus/pdiff.tex
mv -f ../../share/physics/dimension.tex- ../../share/physics/dimension.tex
popd
%endif
pushd intromax
pdflatex intromax.ltx
popd
popd=20=20
# /////////////////////////////////////////////////////////////////////////////
%install
%{__rm} -rf %{buildroot}
%makeinstall
make \
prefix=3D%{?buildroot:%{buildroot}}%{_prefix} \
exec_prefix=3D%{?buildroot:%{buildroot}}%{_exec_prefix} \
bindir=3D%{?buildroot:%{buildroot}}%{_bindir} \
sbindir=3D%{?buildroot:%{buildroot}}%{_sbindir} \
sysconfdir=3D%{?buildroot:%{buildroot}}%{_sysconfdir} \
datadir=3D%{?buildroot:%{buildroot}}%{_datadir} \
includedir=3D%{?buildroot:%{buildroot}}%{_includedir} \
libdir=3D%{?buildroot:%{buildroot}}%{_libdir} \
libexecdir=3D%{?buildroot:%{buildroot}}%{_libexecdir} \
localstatedir=3D%{?buildroot:%{buildroot}}%{_localstatedir} \
sharedstatedir=3D%{?buildroot:%{buildroot}}%{_sharedstatedir} \
mandir=3D%{?buildroot:%{buildroot}}%{_mandir} \
infodir=3D%{?buildroot:%{buildroot}}%{_infodir} \
install-info
touch debugfiles.list
# Deal with info/dir
%{__rm} -f '%{buildroot}%{_infodir}/dir'
# icons
install -D -m644 %SOURCE1 %{buildroot}%_miconsdir/maxima.xpm
install -D -m644 %SOURCE2 %{buildroot}%_iconsdir/maxima.xpm
install -D -m644 %SOURCE3 %{buildroot}%_liconsdir/maxima.xpm
# menu items
install -D -m644 %SOURCE4 %{buildroot}%_menudir/maxima-xmaxima
# %{__rm} -rf %{buildroot}/%{_datadir}/maxima/%{version}/doc/html
%{__rm} -rf %{buildroot}/%{_datadir}/maxima/%{version}/doc/misc
%{__rm} -rf %{buildroot}/%{_datadir}/maxima/%{version}/doc/implementation
%{__rm} -rf %{buildroot}/%{_datadir}/maxima/%{version}/doc/maximabook
%{__rm} -rf %{buildroot}/%{_datadir}/maxima/%{version}/doc/contributors
%{__rm} -f %{buildroot}/%{_datadir}/maxima/%{version}/doc/EMaximaIntro.ps
%if %{build_emacs}
%{__rm} -rf %{buildroot}/%{_datadir}/maxima/%{version}/emacs=09
# --- emaxima LaTeX style
# install -d %{buildroot}%{_datadir}/texmf/tex/latex/emaxima
install -D -m644 \
interfaces/emacs/emaxima/emaxima.sty \
%{buildroot}%{_datadir}/texmf/tex/latex/emaxima/emaxima.sty
#
# emaxima for emacs
#
install -d %{buildroot}%{_datadir}/emacs/site-lisp/maxima
install -d %{buildroot}%{_datadir}/emacs/site-lisp/site-start.d
install -D -m644 \
interfaces/emacs/emaxima/*.el \
interfaces/emacs/emaxima/*.lisp \
%{buildroot}%{_datadir}/emacs/site-lisp/maxima
# --- emacs pkg init file
install -D -m644 \
interfaces/emacs/misc/*.el \
%{buildroot}%{_datadir}/emacs/site-lisp/maxima
install -D -m644 %SOURCE6 \
%{buildroot}%{_datadir}/emacs/site-lisp/site-start.d/maxima.el
#
# emaxima for xemacs
#
%define xemacspkgdir %{_datadir}/xemacs/site-packages
install -d %{buildroot}%{xemacspkgdir}/lisp/maxima
install -d %{buildroot}%{xemacspkgdir}/lisp/site-start.d
install -D -m644 \
interfaces/emacs/emaxima/*.el \
interfaces/emacs/emaxima/*.lisp \
%{buildroot}%{xemacspkgdir}/lisp/maxima
# --- xemacs pkg init file
install -D -m644 \
interfaces/emacs/misc/*.el \
%{buildroot}%{xemacspkgdir}/lisp/maxima
install -D -m644 %SOURCE6 \
%{buildroot}%{xemacspkgdir}/lisp/site-start.d/maxima.el
%endif
%post
/sbin/install-info %{_infodir}/maxima.info %{_infodir}/dir
%preun
if [ "$1" =3D 0 ]; then
/sbin/install-info --delete %{_infodir}/maxima.info %{_infodir}/dir
fi
%clean
%{__rm} -rf %{buildroot}
%post xmaxima
%update_menus
%postun xmaxima
%clean_menus
%if %build_emacs
%post -n emacs-maxima
TEXHASH=3D/usr/bin/texhash
[ -x "$TEXHASH" ] || "$TEXHASH" 2>/dev/null ||:
%postun -n emacs-maxima
TEXHASH=3D/usr/bin/texhash
[ -x "$TEXHASH" ] || "$TEXHASH" 2>/dev/null ||:
%endif
# ////////////////////////////////////////////////////////////////////////////
%files
%defattr(-,root,root,-)
%{_datadir}/maxima/%{version}/*
%{_libexecdir}/maxima/%{version}
%{_infodir}/*
%{_mandir}/man1/maxima.1
%{_bindir}/maxima
%{_bindir}/rmaxima
%doc AUTHORS COPYING INSTALL README README.lisps README.rpms
%doc doc/misc/ doc/implementation/
# %doc doc/html/
%doc %{_datadir}/maxima/%{version}/doc/html/*
%doc doc/intromax/intromax.pdf
%if %{build_book}
%doc doc/maximabook/maxima.pdf
%endif
%files xmaxima
%{_bindir}/xmaxima
%{_datadir}/maxima/%{version}/xmaxima/*
%{_menudir}/maxima-xmaxima
%{_iconsdir}/maxima.xpm
%{_miconsdir}/maxima.xpm
%{_liconsdir}/maxima.xpm
%if %{enable_clisp}
%files exec-clisp
%{_libdir}/maxima/%{version}/binary-clisp/*
%endif
%if %{enable_cmucl}
%files exec-cmucl
%{_libdir}/maxima/%{version}/binary-cmucl/*
%endif
%if %{enable_sbcl}
%files exec_sbcl
/usr/lib/maxima/%{version}/binary-sbcl/*
%endif
%if %{enable_gcl}
%files exec-gcl
%{_libdir}/maxima/%{version}/binary-gcl/*
%endif
%if %{build_emacs}
%files -n emacs-maxima
%doc doc/emaxima/EMaximaIntro.ps
%{_datadir}/texmf/tex/latex/emaxima
%{_datadir}/emacs/site-lisp/maxima
%{_datadir}/emacs/site-lisp/site-start.d
%{xemacspkgdir}/lisp/maxima
%{xemacspkgdir}/lisp/site-start.d
%endif
# /////////////////////////////////////////////////////////////////////////////
%changelog
* Fri Jul 30 2004 A.Lusiani 5.9.0.9beta2-1.alu.rh9.1
- disabled debuginfo
- added BuildRequires for LISP packages
- emacs package does in a separate RPM file
- produce xemacs package in addition to emacs one (in the same RPM)
- maxima.el modified to remove "\r" on xemacs maxima-mode
- changed %postun to %preun for info install
- changed /usr/local/info to /usr/share/info in maxima.el
- load correct index info file in maxima.el (-16 rather than -15)
* Sat Jan 4 2003 James Amundson
- Added doc files
- Added explicit clisp version
- Added conditional to postun
- Renamed exec_* packages to exec-*
- Use rpm macros instead of hard-coded paths
- Thanks to Rex Dieter for helpful suggestions
* Sun Sep 8 2002 James Amundson =20
- Initial build.