Blob Blame History Raw
Summary:       Small, portable symbolic math program
Name:          mathomatic
Version:       14.1.4
Release:       1%{?dist} 
License:       LGPLv2
Group:         Applications/Engineering
URL:           http://www.mathomatic.org/
Source0:       http://www.panix.com/~gesslein/%{name}-%{version}.tar.bz2
Patch0:        mathomatic-14.1.4-build.patch
BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: desktop-file-utils readline-devel

%description
Mathomatic is a small, portable symbolic math program that can
automatically solve, simplify, differentiate, combine, and compare
algebraic equations, perform polynomial and complex arithmetic,
etc. It was written by George Gesslein II and has been under
development since 1986.

%package tools
Summary:  Various small math tools from mathomatic
Group:    Applications/Engineering
Requires: %{name} = %{version}-%{release}

%description tools
This package contains small math tools from mathomatic to
 - calculate Pascal's triangle
 - compute any number of consecutive prime numbers
 - find the minimum number of positive integers that when squared 
   and added together, equal the given number

%prep
%setup -q
%patch0 -p1

%build
%{__make} %{?_smp_mflags} OPTFLAGS='%{optflags}' READLINE=1 prefix=%{_prefix} 

pushd primes
%{__make} %{?_smp_mflags} prefix=%{_prefix} CFLAGS="%{optflags}"

%install
%{__rm} -rf %{buildroot}
%{__make} install prefix=%{buildroot}%{_prefix} mandir=%{buildroot}%{_mandir}
%{__rm} -rf %{buildroot}%{_datadir}/doc/%{name}
desktop-file-install --delete-original \
    --dir %{buildroot}%{_datadir}/applications  \
    %{buildroot}%{_datadir}/applications/%{name}.desktop

pushd primes
%{__make} install prefix=%{buildroot}%{_prefix} mandir=%{buildroot}%{_mandir}

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-, root, root, -)
%doc AUTHORS COPYING README.txt changes.txt doc
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop

%files tools
%defattr(-, root, root, -)
%{_bindir}/matho-pascal
%{_bindir}/matho-primes
%{_bindir}/matho-sumsq
%{_mandir}/man1/matho-pascal.1*
%{_mandir}/man1/matho-primes.1*
%{_mandir}/man1/matho-sumsq.1*

%changelog
* Fri Aug 22 2008 Terje Rosten <terje.rosten@ntnu.no> - 14.1.4-1
- 14.1.4
- add build patch (add optflags, dont strip)

* Wed Jun  4 2008 Terje Rosten <terje.rosten@ntnu.no> - 14.0.4-1
- 14.0.4

* Wed May 21 2008 Terje Rosten <terje.rosten@ntnu.no> - 14.0.3-1
- 14.0.3
- cleanup
- build with readline support
- add tools subpackage

* Mon Nov  5 2007 Dries Verachtert - 12.7.9-1
- Updated to release 12.7.9.

* Tue Apr 27 2004 Dries Verachtert - 11.0e-1
- Initial package.