Summary: A software for drawing scientific graphs
Summary(ja): 2次元グラフ作成プログラム
Name: ngraph
Version: 6.3.30
Release: 2%{?_dist_release}
License: distributable, Copyright(C)Satoshi ISHIZAKA,1997-2004
Group: Applications/Engineering
Source: Ngraph-%{version}-src.tar.gz
Source1: http://www2e.biglobe.ne.jp/~isizaka/bin/ileaf-widgets.tar.Z
Source2: ngraph.sh
Source3: Ngraph-6.3.30-doc.tar.gz
URL: http://www2e.biglobe.ne.jp/~isizaka/
Patch: Ngraph-install.diff
Patch1: Ngraph-6.3.14-lesstif-make.diff
Patch2: Ngraph-6.3.14-lesstif-make-ppc.diff
#Requires: glibc >= 2.2.4, lesstif
#Exclusivearch: i386 ppc

Buildroot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: libICE-devel 
BuildRequires: libSM-devel 
BuildRequires: libX11-devel 
BuildRequires: libXext-devel 
BuildRequires: libXt-devel 
BuildRequires: openMotif-devel 

Vendor: Project Vine
Distribution: Vine Linux


%description
   Ngraph is a software drawing scientific graphs for students, 
researchers, and engineers. Ngraph makes a graph from data  files written
in a general ASCII format. Fitting by a n-th polynomial, user-defined
functionals is available. Furthermore, masking invalid data, evaluation
of plotted data points, a transformation by a mathematical expression are
also available.Ngraph will assist making a scientific graph for the purpose
of your presentation, and also analysing data.Copyright (C) Satoshi ISHIZAKA.
   Motif or Lesstif libraries must be required to build the binaries.
This package include ileaf-widgets.tar.Z (Copyright 1993 Interleaf, Inc.),
codes for ComboBox Widget, which are required when ngraph is build with
Motif 1.2 or Lesstif. The copyright and permission notice of this widget
are written in a document file, TODO.jis.

%description -l ja
  Ngraphは理工系学生、研究者、技術者のために作られた2次元グラフ作成プログ
ラムです。 汎用性のあるASCII形式のテキストファイルから数値デ−タを読み込
みグラフにプロットすることができます。 またn次関数・ユ−ザ定義関数による
最小二乗フィットができるほか、 プロットされたデ−タの評価・マスク・変更も
可能であり、 さらに指定した数式で入力デ−タを加工する高度な数式変換機能な
どを備えるなど、 プレゼンテ−ション用グラフ作成の目的のみに留まらずデ−タ
解析をアシストします。(作者:石坂 智(いしざか さとし)さんのドキュメントより)
  バイナリをビルトするためには Motif または Lesstif を使用します。Motif 1.2
または Lesstif の場合、さらに ComboBox Widget (Copyright 1993 Interleaf,Inc.)
を使用し、このパッケージはこれを含みます。この Widget の著作権や許諾権に
関しては TODO.jis に書かれています。


%prep
%setup -q -a 3 -n Ngraph-%{version}-src
%patch -p1


%build
if [ -n "`rpm -qa | grep lesstif`" ]
then
%ifarch i386
		patch -p0 <%{PATCH1}
%else
		patch -p0 <%{PATCH2}
%endif
	cd combo
	tar -zxf ${RPM_SOURCE_DIR}/ileaf-widgets.tar.Z
	gcc -c -o ComboBox.o ComboBox.c -I/usr/X11R6/include
	cd ..
fi

%ifnarch %{ix86}
sed -e "s/-m486//g" Makefile > Makefile.new
mv -f Makefile.new Makefile
%endif

make


%install
rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}/usr/{lib,bin}
make INSTALLDIR=/usr/lib/Ngraph BINDIR=/usr/bin install
mv $RPM_BUILD_ROOT/usr/bin/ngraph $RPM_BUILD_ROOT/usr/bin/ngraph.exe
install -m 755 %{SOURCE2} $RPM_BUILD_ROOT/usr/bin/ngraph

pushd ${RPM_BUILD_ROOT}/usr/lib/Ngraph
rmdir doc
ln -s /usr/doc/ngraph-%{version}/doc .
popd


%clean
rm -rf ${RPM_BUILD_ROOT}


%files
%defattr(-,root,root)
%doc INSTALL.jis TODO.jis doc/
/usr/bin/ngraph*
/usr/lib/Ngraph/

%changelog
* Sat Sep 20 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 6.3.30-2vl5
- added BuildRequires

* Wed Aug 27 2008 Shu KONNO <owa@bg.wakwak.com> 6.3.30-1vl5
- applied new versioning policy, spec in utf-8

* Sat Oct 21 2006 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 6.3.30-0vl3
- do not pass "-m486" option on non-i386 archtectures

* Sat Oct 21 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 6.3.30-0vl2
- s/Copyright/License/
- built with openMotif instead of lesstif

* Wed Mar 30 2005 Jun Nishii <jun@vinelinux.org> 6.3.30-0vl1
- ver.up

* Wed Mar 27 2002 Jun Nishii <jun@vinelinux.org> 6.3.14-0vl1
- ver.up source and doc
- make symlink to doc from /usr/lib/Ngraph to call Help file

* Sat Sep 30 2000 Jun Nishii <jun@vinelinux.org>
- 6.3.06-0vl1
- added %defattr

* Wed Sep 27 2000 Jun Nishii <jun@vinelinux.org>
- 6.3.06-0vl1

* Tue Jan 11 2000 Amane Tanaka <amane@bd5.so-net.ne.jp>
- Build section was changed to execute correct patch for compiling with
- Lesstif by using S.Sakoda's patch information. Thanks, Mr.Sakoda!

* Sat Jan 8 2000 Amane Tanaka <amane@bd5.so-net.ne.jp>
- Compiled with Motif-2.1.0 on i386 support 
- Packager: Seiji Sakoda <sakoda@cc.nda.ac.jp> --> AT

* Mon Nov 8 1999 Seiji Sakoda <sakoda@cc.nda.ac.jp>
- update to version 6.3.06
- Compiled with Lesstif-0.89.4 with ComboBox support
- Packager: Amane Tanaka <amane@bd5.so-net.ne.jp> ---> SS