Blob Blame History Raw
# busted on x86_64 -- Rex
# define m2home %{_libdir}/%{name}-%{version}
# Makefiles hardcode "%prefix/lib" instead, ok?  -- Rex
%define m2home %{_prefix}/lib/%{name}-%{version}
 
Summary: System for algebraic geometry and commutative algebra
Name:    Macaulay2
Version: 0.9.2
Release: 14%{?dist_tag}
License: GPL
Group:   Applications/Engineering
URL:     http://www.math.uiuc.edu/Macaulay2/
Source:  http://www.math.uiuc.edu/Macaulay2/ftp-site/Macaulay2-0.9.2-src.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

Source1: Macaulay2.png
Source2: Macaulay2.desktop

Patch0: Macaulay2-0.9-optimize.patch
Patch1: Macaulay2-0.9-htmlview.patch
Patch2: Macaulay2-0.9.2-static.patch
Patch3: Macaulay2-0.9.2-gcc3.patch
# See http://bugzilla.fedora.us/attachment.cgi?id=877&action=view
Patch4: Macaulay2-0.9.2-gcc34.patch

BuildRequires: desktop-file-utils
BuildRequires: gc-devel >= 6.3
BuildRequires: factory-devel >= 2.0.5
BuildRequires: libfac-devel >= 2.0.5
BuildRequires: gdbm-devel
BuildRequires: time

%description
Macaulay 2 is a new software system devoted to supporting research in
algebraic geometry and commutative algebra written by Daniel R. Grayson
and Michael E. Stillman

%package doc
Summary: Macaulay2 documentation
Group: Documentation
Requires: %{name} = %{version}
Requires: htmlview
Summary: Macaulay2 documentation
%description doc
Macaulay2 documentation.

%package emacs
Summary: Macaulay2 emacs mode
Group: Applications/Editors
Requires: emacs
Requires: %{name} = %{version}
%description emacs
Macaulay2 emacs mode.



%prep
%setup -q

%patch0 -p1 -b .opt
%patch1 -p1 -b .htmlview
%patch2 -p1 -b .static
# fix gcc3 blocker, some warnings about use of deprecated headers
%patch3 -p1 -b .gcc3
# fc3/gcc34 fix
%patch4 -p1 -b .gcc34


%build
%configure  \
  --enable-gc-for-new \
  --disable-dumpdata \
  --disable-optimize \
  --disable-static \
  %{?debug_package:--disable-strip}

# not smp-safe
make

# Takes a *long* time, default off
%check || :
%{?_with_check:make check }


%install
%makeinstall

# Fix locations
perl -pi -e "s@M2HOME=.*@M2HOME=%{m2home}@" \
	$RPM_BUILD_ROOT%{_bindir}/M2
perl -pi -e "s@M2HOME=.*@M2HOME=%{m2home}@" \
	$RPM_BUILD_ROOT%{_bindir}/M2-help
perl -pi -e "s@$RPM_BUILD_ROOT@@g" $RPM_BUILD_ROOT%{m2home}/emacs/*

## emacs files
install -d      $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp
cp -alf	$RPM_BUILD_ROOT%{m2home}/emacs/*.el \
	$RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/

# app img
install -p -D -m644 %{SOURCE1}      $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png

mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/applications
desktop-file-install \
  --vendor fedora \
  --dir ${RPM_BUILD_ROOT}%{_datadir}/applications \
  --add-category "X-Fedora" \
  %{SOURCE2}

## Unpackaged files
# %doc stuff, no need to dup in appdir
rm -f $RPM_BUILD_ROOT%{m2home}/{README,CHANGES,COPYING}
# created by make check
find $RPM_BUILD_ROOT%{m2home} \( -name test.out -o -name test.out*.trim \) -exec rm -v {} \;
# .cvsignore
find $RPM_BUILD_ROOT%{m2home} -name .cvsignore -exec rm -v {} \;
# unuseful files outside of build environment
find  $RPM_BUILD_ROOT%{m2home}/packages -name "Makefile*" -exec rm -v {} \;


%clean
rm -rf $RPM_BUILD_ROOT


%preun
# Handle possibly existing dumpdata
rm -f %{m2home}/libexec/Macaulay2-*-data ||:


%files
%defattr(-,root,root)
%doc Macaulay2/README Macaulay2/CHANGES
%{_bindir}/M2
%{_datadir}/applications/*.desktop
%{_datadir}/pixmaps/*.png
%dir %{m2home}
%{m2home}/cache
%{m2home}/libexec
%{m2home}/m2
%{m2home}/packages
# Not needed/wanted
%exclude %{m2home}/setup

%files emacs
%defattr(-,root,root)
%dir %{m2home}/emacs
%doc %{m2home}/emacs/*.m2
%doc %{m2home}/emacs/*.txt
%doc %{m2home}/emacs/README
%{m2home}/emacs/*.el
%{_datadir}/emacs/site-lisp/*.el

%files doc
%defattr(-,root,root)
%{_bindir}/M2-help
%{m2home}/html
%{m2home}/tutorial


%changelog
* Mon Feb 21 2005 Rex Dieter <rexdieter[AT]users.sf.net> 0:0.9.2-14
- x86_64 issues (%%_libdir -> %%_prefix/lib )
- remove desktop_file macro usage

* Sat Oct 23 2004 Rex Dieter <rexdieter at sf.net> 0:0.9.2-0.fdr.13
- BR: time (again)
- omit m2_dir/setup (not needed/wanted)

* Mon Oct 18 2004 Rex Dieter <rexdieter at sf.net> 0:0.9.2-0.fdr.12
- actually *apply* gcc34 patch this time.

* Mon Oct 18 2004 Rex Dieter <rexdieter at sf.net> 0:0.9.2-0.fdr.11
- gcc34 patch

* Fri Oct 1 2004 Rex Dieter <rexdieter at sf.net> 0:0.9.2-0.fdr.10
- explicit BR versions for gc-devel, libfac-devel, factory-devel

* Tue Aug 10 2004 Rex Dieter <rexdieter at sf.net> 0:0.9.2-0.fdr.9
- BR: time

* Thu Jun 03 2004 Rex Dieter <rexdieter at sf.net> 0:0.9.2-0.fdr.8
- .desktop: remove Terminaloptions to be desktop agnostic
- .desktop: Categories += Education;Math;Development (Devel only
  added so it shows *somewhere* in gnome menus)

* Tue Jun 01 2004 Rex Dieter <rexdieter at sf.net> 0:0.9.2-0.fdr.7
- disable default 'make check' (util/screen fails on fc2)

* Tue Mar 30 2004 Rex Dieter <rexdieter at sf.net> 0:0.9.2-0.fdr.6
- desktop-file is now on by default
- use separate (not inline) .desktop file

* Mon Jan 05 2004 Rex Dieter <rexdieter at sf.net> 0:0.9.2-0.fdr.5
- fix BuildRequires: desktop-file-utils to satisfy rpmlint.
- put emacs files in emacs subdir too (to follow supplied docs)
- *really* nuke .cvsignore files
- fix desktop-file-install --add-cateagories usage

* Tue Dec 23 2003 Rex Dieter <rexdieter at sf.net> 0:0.9.2-0.fdr.4
- -emacs: use %%defattr
- -emacs: fix M2-init.el

* Mon Nov 17 2003 Rex Dieter <rexdieter at sf.net> 0:0.9.2-0.fdr.3
- update/simplify macros
- desktop_file support.
- emacs subpkg.
- relax Req's on subpkgs to just: Requires: %%name = %%epoch:%%version
- use non-versioned BuildRequires
- remove redundant BuildRequires: gmp-devel
- remove gc patch, no longer needed.
- delete/not-package a bunch of unuseful files.
- use --disable-strip when debug_package is in use.

* Thu Nov 13 2003 Rex Dieter <rexdieter at sf.net> 0:0.9.2-0.fdr.2
- no longer explictly Requires: emacs

* Wed Nov 05 2003 Rex Dieter <rexdieter at sf.net> 0:0.9.2-0.fdr.1
- missing Epoch: 0

* Fri Sep 12 2003 Rex Dieter <rexdieter at sf.net> 0.9.2-0.fdr.0
- fedora'ize