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: 21%{?dist}
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-%(%{__id_u} -n)

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
Patch4: Macaulay2-0.9.2-gcc34.patch
Patch5: Macaulay2-0.9.2-gcc4.patch

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

Obsoletes: %{name}-emacs < %{version}-%{release}
Provides:  %{name}-emacs = %{version}-%{release}

%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: %{name} documentation
Group: Documentation
Requires: %{name} = %{version}
Requires: htmlview
%description doc
%{name} documentation.


%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
# fc4/gcc4 fix
%patch5 -p1 -b .gcc4


%build

%configure  \
  --disable-dumpdata \
  --disable-optimize 

#TODO: --with-lapacklibs 

make 


%check || :
# NOTE: util/screen dies on fc5/buildsystem (could not open pty)
#make check ||:


%install
%makeinstall

# Fix locations
sed -i -e "s@M2HOME=.*@M2HOME=%{m2home}@" $RPM_BUILD_ROOT%{_bindir}/M2
sed -i -e "s@M2HOME=.*@M2HOME=%{m2home}@" $RPM_BUILD_ROOT%{_bindir}/M2-help
sed -i -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 -m644 -D %{SOURCE1} \
  $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/apps/32x32/Macaulay2.png

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

## Unpackaged files
rm -f $RPM_BUILD_ROOT%{m2home}/setup
# %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 ||:

%post
touch --no-create %{_datadir}/icons/hicolor ||:
gtk-update-icon-cache -q %{_datadir}/icons/hicolor 2> /dev/null ||:

%postun
touch --no-create %{_datadir}/icons/hicolor ||:
gtk-update-icon-cache -q %{_datadir}/icons/hicolor 2> /dev/null ||:


%files
%defattr(-,root,root,-)
%doc Macaulay2/README Macaulay2/CHANGES
%{_bindir}/M2
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/*/*/*
%dir %{m2home}
%{m2home}/cache/
%{m2home}/libexec/
%{m2home}/m2/
%{m2home}/packages/
# emacs bits
%{m2home}/emacs/
%{_datadir}/emacs/site-lisp/

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


%changelog
* Thu Mar 30 2006 Rex Dieter <rexdieter[AT]users.sf.net> 0.9.2-21
- *really* disable %%check (fails on fc5+ anyway) 

* Fri Jan 20 2006 Rex Dieter <rexdieter[AT]users.sf.net> 0.9.2-20
- .desktop: drop Category=Development
- app icon: follow icon spec
- drop -emacs subpkg (in main now) 

* Fri Sep 16 2005 Rex Dieter <rexdieter[AT]users.sf.net> - 0.9.2-19
- disable 'make check' (fc5/buildsystem error), besides, we get a 
  good consistency check when M2 builds all the doc examples.

* Wed Sep 14 2005 Rex Dieter <rexdieter[AT]users.sf.net> - 0.9.2-18
- rebuild against gc-6.6

* Thu May 26 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 0.9.2-17
- rebuild (build system x86_64 repository access failed for 0.9.2-16)
- fix build for GCC 4 (#156223)

* Thu Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 0.9.2-15
- rebuilt

* 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