# -*- rpm-spec -*-
# $Id: scilab,v 1.11 2002/10/07 12:24:50 lioka Exp $

Name: scilab
Version: 2.7
Release: alt1

Summary: A high-level language for numerical computations
License: INRIA
Group: Sciences/Mathematics
Obsoletes:%name-doc

Source:ftp://ftp.inria.fr/INRIA/Projects/Meta2/Scilab/distributions/%name-%version.src.tar.bz2

Url: http://www-rocq.inria.fr/%name
AutoReq: yes, noshell

BuildPreReq: XFree86 tk-devel >= 8.4.0-alt1
BuildRequires: XFree86-devel XFree86-libs Xaw3d-devel gcc-g77 libg2c-devel libtinfo-devel

%description
Scilab is a high-level language, primarily intended for numerical
computations.  Scilab includes a number of toolboxes and on-line
documentation.

%prep
%setup -q

%build
%define _configure_target %{_arch}-pc-linux-gnu
%configure --enable-shared --enable-static=no --with-xaw3d --with-tk

find . -type f -name 'Makefile.incl'|xargs subst  's|termcap|tinfo|'

make all
make tarbindist 

%install
mkdir -p $RPM_BUILD_ROOT/usr/{bin,lib}
mkdir -p $RPM_BUILD_ROOT%_libdir/X11/app-defaults

(cd $RPM_BUILD_ROOT%_libdir; tar xf %_builddir/%name-%version/%name-%version-bin.tar)

# Nuke dependencies on /bin/SCILABGS
(cd $RPM_BUILD_ROOT%_libdir/%name-%version
 chmod -x ./scripts/scilab.g
 %__subst s+/bin/sh5+/bin/sh+ ./bin/dold
) 
	                                                                                       
# Nuke attempts to setenv SCI from build directory.
( cd $RPM_BUILD_ROOT%_libdir/%name-%version
for F in `find util/ bin/ -type f`
do
    %__subst "s+%_builddir+%_libdir+" ${F}
done                                      
)

#Add  symlinks
( cd $RPM_BUILD_ROOT%_bindir
  ln -s %_libdir/%name-%version/bin/%name %name
  ln -s %_libdir/%name-%version/bin/xless xless
)

# Make X11 resource database available at the rigth place
(cd  $RPM_BUILD_ROOT%_libdir/X11/app-defaults
ln -s %_libdir/%name-%version/X11_defaults/Xscilab Xscilab
)

# get rid of those nasty dependecies due to executable Makefiles
find  $RPM_BUILD_ROOT%_libdir/%name-%version -type f -name Make\* -exec chmod -x {} \;

%files
%_bindir/*
%_libdir/%name-*
%_libdir/X11/app-defaults/Xscilab
%doc ACKNOWLEDGEMENTS CHANGES

%changelog
* Tue Apr 08 2003 Stanislav Ievlev <inger@altlinux.ru> 2.7-alt1
- 2.7

* Mon Oct  7 2002 Sergey Bolshakov <s.bolshakov@belcaf.com> 2.6-alt8
- rebuilt with tcl 8.4

* Wed Sep 18 2002 Stanislav Ievlev <inger@altlinux.ru> 2.6-alt7
- rebuild with new XFree86

* Wed Sep 04 2002 Stanislav Ievlev <inger@altlinux.ru> 2.6-alt6
- rebuild with gcc3
- termcap -> terminfo

* Sat Jun 15 2002 Sergey Bolshakov <s.bolshakov@belcaf.com> 2.6-alt5
- rebuilt in new env

* Mon Dec 24 2001 Stanislav Ievlev <inger@altlinux.ru> 2.6-alt4
- fix links in app-defaults

* Thu Oct 11 2001 Stanislav Ievlev <inger@altlinux.ru> 2.6-alt3
- MDK merges

* Fri May 25 2001 Stanislav Ievlev <inger@altlinux.ru> 2.6-alt2
- path bugfix. Remove doc package.

* Thu Apr 12 2001 Stanislav Ievlev <inger@altlinux.ru> 2.6-alt1
- Up to 2.6. spec clean up and bugfix

* Thu Jan 09 2001 AEN <aen@logic.ru>
- adopted for RE

* Sun Oct 22 2000 Fernando M. Roxo da Motta <roxo@conectiva.com.br>
- inserted documentation package

* Fri Oct 20 2000 Fernando M. Roxo da Motta <roxo@conectiva.com.br>
- Fixed hardwired PATH's

* Wed Oct 18 2000 Fernando M. Roxo da Motta <roxo@conectiva.com.br>
- Packaged for Conectiva Linux
- Fixed a lot of macros

* Tue Sep 26 2000 Lenny Cartier <lenny@mandrakesoft.com> 2.4.1-3mdk
- build release
- macros
- menu

* Wed May 03 2000 Lenny Cartier <lenny@mandrakesoft.com> 2.4.1-2mdk
- bzip2 patches
- fix group

* Tue Dec 30 1999 Lenny Cartier <lenny@mandrakesoft.com>
- new in contribs
- bz2 archive

* Wed Aug 18 1999 Tim Powers <timp@redhat.com>
- exludearch alpha

* Wed Jul 21 1999 Tim Powers <timp@redhat.com>
- rebuilt for 6.1

* Wed May 12 1999 Bill Nottingham <notting@redhat.com>
- clean up dependencies

* Wed May 05 1999 Bill Nottingham <notting@redhat.com>
- update to 2.4.1

* Fri Oct 23 1998 Jeff Johnson <jbj@redhat.com>
- Upgrade to 2.4.

* Thu Oct 22 1998 Jeff Johnson <jbj@redhat.com>
- Fixes to permit compile on alpha.
- Eliminate lurking dependencies on /bin/sh5 and SCILABGS.
- Modify default value of SCI variable to be correct for users.
- Add /usr/bin/scilab symlink.

* Sat Jul 11 1998 Jeff Johnson <jbj@redhat.com>
- Create powertools package.

