Summary: The open source platform for numerical computation
Summary(ja): オープンソースの数値計算システム
Name: scilab
Version: 4.1.2
Release: 2%{?_dist_release}
License: INRIA
Group: Applications/Engineering
URL: http://scilabsoft.inria.fr/

Source: http://scilabsoft.inria.fr/download/stable/scilab-%{version}-src.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-root

BuildRequires: tcl tk perl Xaw3d-devel libpng-devel
BuildRequires: gtkhtml2-devel gtk2-devel
BuildRequires: libxslt vte-devel readline-devel
BuildRequires: gcc-c++
%if %{?_dist_release}!="vl4"
BuildRequires: gcc-gfortran 
%else
BuildRequires: gcc-g77
%endif
BuildRequires: pkgconfig

%description
Scilab a numerical computation system similiar to matlab or simulink. Scilab
includes hundreds of mathematical functions, and programs from various
languages (such as C or Fortran) can be added interactively. It has
sophisticated data structures (including lists, polynomials, rational
functions, and linear systems), an interpreter, and a high-level programming
language. Scilab has been designed to be an open system where the user can
define new data types and operations on these data types by using
overloading. A number of toolboxes are available with the system. 

%prep
%setup -q

%build
perl -pi.orig -e 's|-fwritable-strings||g;' configure
%configure \
	--with-gcc \
	--with-gfortran \
	--with-gnu \
	--with-gtk2 \
	--with-x \
	--without-java \
	--with-tcl-library="%{_libdir}"
# ../include/pvmtev.h nodig in pvm3/src/global.h
(echo '#include "../include/pvmtev.h"'; cat pvm3/src/global.h) > pvm3/src/global.h.temp
mv pvm3/src/global.h.temp pvm3/src/global.h
#make %{?_smp_mflags} all
make all

%install
rm -rf %{buildroot}
install -d %{buildroot}%{_libdir} \
	%{buildroot}%{_bindir}
perl -pi.orig -e '
	s|/usr/bin|%{buildroot}%{_bindir}|g;
	s|ln -fs \$\(PREFIX\)/lib|ln -fs %{_libdir}|g;
	' Makefile

perl -pi -e '
	s|/bin/sh5|/bin/sh|g;
	' bin/dold

%makeinstall PREFIX=%{buildroot}%{_prefix} LIBPREFIX=%{buildroot}%{_libdir}

perl -pi -e '
	s|%{buildroot}||g;
	' %{buildroot}%{_libdir}/scilab-%{version}/bin/* \
	config/configuration \
	util/Blatdoc* Makefile* Path.incl


%clean
rm -rf %{buildroot}

%files
%doc ACKNOWLEDGEMENTS CHANGES README_Unix Version.incl licence.txt
%defattr(-, root, root, 0755)
%{_bindir}/*
#%{_libdir}/scilab-%{version}/
#%exclude %{_libdir}/scilab-%{version}/examples/mex-examples/mexglx
%{_prefix}/lib/scilab-%{version}/
%exclude %{_prefix}/lib/scilab-%{version}/examples/mex-examples/mexglx

%changelog
* Tue Jul 14 2009 Shu KONNO <owa@bg.wakwak.com> 4.1.2-2
- fix %%files: %%{_libdir}/scilab... to %%{_prefix}/lib/scilab...

* Tue Apr 14 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.1.2-1
- applied new versioning policy
- updated to 4.1.2

* Sun Jun 03 2007 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 4.1.1-0vl2
- don't use smp_mflags on compilation

* Sun Jun  3 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.1.1-0vl1
- new upstream release
- rebuilt with gfortran

* Thu Jul 27 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.1.1-2vl3
- rebuilt with Xaw3d-1.5-17vl3

* Wed Apr 26 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.1.1-2vl2
- rebuilt with readline 5.1

* Sun Sep 25 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.1.1-2vl1
- update to 3.1.1 based on DAG packages
  (http://dag.wieers.com/packages/scilab/)
  * Mon Aug 01 2005 Dries Verachtert <dries@ulyssis.org> - 3.1.1-2 - 3450/dries
  - Rebuild.
  * Thu Jun 09 2005 Dries Verachtert <dries@ulyssis.org> - 3.1.1-1
  - Update to release 3.1.1.
  * Wed Jul 14 2004 Dries Verachtert <dries@ulyssis.org> - 3.0-1
  - Initial package.

* Fri May  2 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.7-0vl1
- update to 2.7
- dropped scilab-2.6-ppc.patch 

* Fri Mar 22 2002 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 2.6-0vl2
- removed obsolete ppc patch

* Sun Mar  3 2002 Jun Nishii <jun@vinelinux.org> 2.6-0v1
- ver.up

* Wed Sep 27 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
- 2.4.1-4vl2
- added a patch for ppc archtecture

* 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.
