3fa7871
%{!?octave_api:%global octave_api %(octave-config -p API_VERSION || echo 0)}
3fa7871
Name: mathgl
3fa7871
Version: 1.9
bdff646
Release: 8%{?dist}
3fa7871
Summary: Cross-platform library for making high-quality scientific graphics
3fa7871
Summary(ru): MathGL - это библиотека для осуществления высококачественной визуализации данных
3fa7871
License: GPLv2+
3fa7871
Group: Development/Libraries
3fa7871
Url: http://mathgl.sourceforge.net
3fa7871
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tgz
3fa7871
3fa7871
#Fix missing default parameter in hdf5 code 
fdfed3e
#Patch0: %{name}-io.patch
3fa7871
#Patch to fix parallel build issue (from debian pts)
3fa7871
Patch1: %{name}-png.patch
3fa7871
#Uncomment mathgl dif listing (fix warning) also from pts
3fa7871
Patch2: %{name}-info.patch
3fa7871
#Remove empty libmgl-wx from compilation
3fa7871
Patch3: %{name}-no-mglwx.patch
fdfed3e
#Allow autoconf 2.59 to work
fdfed3e
Patch4: %{name}-allow-autoconf-2p59.patch
9909405
#disable texi2html (which crashes, newer texinfo (at least F10+) is OK)
9909405
Patch5: %{name}-notexinfo.patch
3fa7871
3fa7871
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
3fa7871
3fa7871
# mandatory packages
3fa7871
BuildRequires: gsl-devel libpng-devel libtool-ltdl-devel libtool 
fdfed3e
#BuildRequires: swig 
3fa7871
3fa7871
# optional packages
3fa7871
BuildRequires: freeglut-devel hdf5-devel libjpeg-devel libtiff-devel fltk-devel qt4-devel
3fa7871
BuildRequires: wxGTK-devel giflib-devel octave-devel
3fa7871
3fa7871
#For autoreconf (required for patch1, libtool)
3fa7871
BuildRequires:	autoconf
3fa7871
BuildRequires:	automake
3fa7871
BuildRequires:	libtool
3fa7871
3fa7871
Requires(post): info
3fa7871
Requires(preun): info
3fa7871
3fa7871
Requires: octave(api) = %{octave_api}
3fa7871
3fa7871
%description
3fa7871
Mathgl is a cross-platform library for making high-quality scientific
3fa7871
graphics. It provides fast data plotting and handling of large data
3fa7871
arrays, as well as  window and console modes and for easy embedding
3fa7871
into other programs. Mathgl integrates into fltk, qt and
3fa7871
opengl applications
3fa7871
3fa7871
%package devel
3fa7871
Summary: Libraries and header files for %{name} library
3fa7871
Group: Development/Libraries
3fa7871
Requires: %{name} = %{version}-%{release}
3fa7871
3fa7871
%description devel
3fa7871
The %{name}-devel package contains libraries and header files for
3fa7871
developing applications that use %{name}.
3fa7871
3fa7871
%description devel -l ru
3fa7871
Пакет %{name}-devel содержит библиотеки и файлы заголовков необходимые 
3fa7871
для разработки приложений с использованием %{name}.
3fa7871
9909405
#Doc package disabled pedning texi2html update to non-crashing version
9909405
#%package doc
9909405
#Group:		Documentation
9909405
#Summary:	HTML documentation and tutorial for the %{name} applications
9909405
#
9909405
#BuildArch:	noarch
9909405
#BuildRequires:	texi2html texinfo-tex	
9909405
#
9909405
#
9909405
#%description doc
9909405
#This package contains the documentation in the HTML format of the %{name}
9909405
#package.
3fa7871
3fa7871
%prep
3fa7871
%setup -q
3fa7871
3fa7871
#convert EOL encodings, maintaining timestames
3fa7871
for file in AUTHORS ChangeLog.txt README COPYRIGHT; do
3fa7871
	sed 's/\r//' $file > $file.new && \
3fa7871
	touch -r $file $file.new && \
3fa7871
	mv $file.new $file
3fa7871
done
3fa7871
fdfed3e
#%patch0
3fa7871
%patch1
3fa7871
%patch2
3fa7871
%patch3
3fa7871
fdfed3e
#EPEL specific patches
fdfed3e
%patch4
fdfed3e
%patch5
fdfed3e
3fa7871
autoreconf
3fa7871
3fa7871
3fa7871
%build
bdff646
QMAKE=%{_libdir}/qt4/bin/qmake
bdff646
LUPDATE=%{_libdir}/qt4/bin/lupdate
bdff646
LRELEASE=%{_libdir}/qt4/bin/lrelease
bdff646
PATH=$PATH:%{_libdir}/qt4/bin/
3fa7871
3fa7871
%configure	--disable-static \
3fa7871
		--enable-shared \
bdff646
		--enable-all --disable-rpath --with-qt=%{_libdir}/qt4/
3fa7871
3fa7871
#Force strip rpath
3fa7871
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
3fa7871
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
3fa7871
3fa7871
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/widgets/.libs/:`pwd`/mgl/.libs
3fa7871
3fa7871
make %{?_smp_mflags} 
3fa7871
3fa7871
%install
3fa7871
rm -rf $RPM_BUILD_ROOT
3fa7871
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
3fa7871
3fa7871
#Trash the .la files that get generated anyway (faulty configure? Doesn't appear up without --disable-ltdtl-install)
3fa7871
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
3fa7871
9909405
#OCTAVE IS DISABLED pending EPEL SWIG support (eg 1.3.39)
9909405
#====
9909405
9909405
##Fix up octave .oct file install
9909405
#mkdir -p temp-octave
9909405
#
9909405
#pushd .
9909405
#cd temp-octave
9909405
##Decompress tarballed "oct" file and remove tarball
9909405
#tar -zxf $RPM_BUILD_ROOT/%{_datadir}/%{name}/octave/%{name}.tar.gz
9909405
#rm $RPM_BUILD_ROOT/%{_datadir}/%{name}/octave/%{name}.tar.gz
9909405
#
9909405
##Copy the .oct file and supporting files to octave packages dir
9909405
#mkdir -p $RPM_BUILD_ROOT/%{_prefix}/libexec/octave/packages/%{name}-1.9.0/
9909405
##Remove empty INDEX file
9909405
#rm %{name}/INDEX
9909405
#
9909405
##We cannot use version macro with octave package search,
9909405
## as pkg.m assumes a x.y.z format for packages. Failing
9909405
## to do this renders the plugin inoperable
9909405
#cp -pR %{name}/inst/* $RPM_BUILD_ROOT/%{_prefix}/libexec/octave/packages/%{name}-1.9.0/
9909405
#
9909405
##packinfo dir is required, or octave will not find the dir in recursive search
9909405
#mkdir -p $RPM_BUILD_ROOT/%{_datadir}/octave/packages/%{name}-1.9.0/packinfo
9909405
#cp -p %{name}/[A-Z]* $RPM_BUILD_ROOT/%{_datadir}/octave/packages/%{name}-1.9.0/packinfo
9909405
#
9909405
#popd
9909405
#=====
9909405
9909405
9909405
#DOCS disabled pending texinfo update
9909405
#====
9909405
#pushd .
9909405
##Lets build a "docs" dir to maintain the dir relationships needed for html files
9909405
#mkdir -p  texinfo/docs
9909405
#cd texinfo/docs/
9909405
#cp -pr ../mathgl.html .
9909405
#cp -pr ../png_static .
9909405
#cp -pr ../png/ .
9909405
#
9909405
##remove zero length faux PNG file
9909405
#rm -f png/all.png
9909405
#
9909405
#popd
9909405
#
9909405
#====
3fa7871
3fa7871
#remove installed docs, which we are installing via doc macro
3fa7871
rm -rf $RPM_BUILD_ROOT/%{_docdir}/%{name}
3fa7871
3fa7871
#remove misplaced info "dir" file
3fa7871
rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
3fa7871
3fa7871
%post 
3fa7871
/sbin/ldconfig
3fa7871
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :
3fa7871
octave -q -H --no-site-file --eval "pkg('rebuild');"
3fa7871
3fa7871
%preun
3fa7871
if [ $1 = 0 ] ; then
3fa7871
	/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
3fa7871
fi
3fa7871
3fa7871
%postun
3fa7871
/sbin/ldconfig
3fa7871
octave -q -H --no-site-file --eval "pkg('rebuild');"
3fa7871
3fa7871
%clean
3fa7871
rm -rf $RPM_BUILD_ROOT
3fa7871
3fa7871
3fa7871
%files
3fa7871
%defattr(-,root,root,-)
3fa7871
%doc AUTHORS ChangeLog.txt README COPYING COPYRIGHT NEWS TODO
3fa7871
%{_libdir}/*.so.*
3fa7871
%{_bindir}/mgl*
3fa7871
%{_datadir}/%{name}/
9909405
#%{_prefix}/libexec/octave/packages/%{name}-1.9.0/
9909405
#%{_datadir}/octave/packages/%{name}-1.9.0/
9909405
#%{_infodir}/%{name}.*.gz
3fa7871
3fa7871
3fa7871
%files devel
3fa7871
%defattr(-,root,root,-)
3fa7871
%{_includedir}/mgl/
3fa7871
%{_libdir}/*.so
3fa7871
9909405
#%files doc
9909405
#%defattr(-,root,root,-)
9909405
#%doc texinfo/docs/*
9909405
#
3fa7871
%changelog
bdff646
* Mon Oct 12 2009 <mycae(a!t)yahoo.com> 1.9-8
bdff646
- Fixed x86_64 QT paths
bdff646
9909405
* Mon Oct 12 2009 <mycae(a!t)yahoo.com> 1.9-7
9909405
- Fixed EPEL 5 build by disabling octave (swig too old) and texi generation
9909405
3fa7871
* Mon Sep 14 2009 <mycae(a!t)yahoo.com> 1.9-6
3fa7871
- Add COPYING to doc
3fa7871
3fa7871
* Sat Sep 12 2009 <mycae(a!t)yahoo.com> 1.9-5
3fa7871
- Removed the word "static" from devel description, as doesn't have static
3fa7871
- Fonts now owned at datadir/name level
3fa7871
- Added COPYRIGHT NEWS and TODO
3fa7871
3fa7871
* Sat Aug 15 2009 <mycae(a!t)yahoo.com> 1.9-4
3fa7871
- Fix octave installation method
3fa7871
- Remove wx lib, which doesn't have meaningful code.
3fa7871
3fa7871
* Sun Aug 02 2009  <mycae(a!t)yahoo.com> 1.9-3
3fa7871
- Fix texinfo install (mv to main & add pre/post)
3fa7871
- Remove chrpath, as we now autoreconf
3fa7871
- Add octave pkg rebuild commands
3fa7871
3fa7871
* Tue Jul 21 2009  <mycae(a!t)yahoo.com> 1.9-2 
3fa7871
- Fix rpath for build on x86_64. 
3fa7871
- remove unrecognized configure options: --enable-tiff, --disable-ltdl-install
3fa7871
- Switch to --enable-all --enable-octave
3fa7871
- Add hdf5 patch
3fa7871
- Add doc subpackage
3fa7871
3fa7871
* Thu Jul 09 2009 <mycae(a!t)yahoo.com> 1.9-1
3fa7871
- Update to 1.9
3fa7871
- Drop explicit Requires
3fa7871
- Perserve timestamps on EOL conversion
3fa7871
- Added patch to disable unused gsl cblas link
3fa7871
3fa7871
* Fri May 02 2009 <mycae(a!t)yahoo.com> 1.8.1-1
3fa7871
- Update to 1.8.1
3fa7871
3fa7871
* Wed Jan 28 2009 <mycae(a!t)yahoo.com> 1.8-3
3fa7871
- Ensure timestamps are preserved during make install
3fa7871
- Modify defattr
3fa7871
- Remove UDAV from package summary
3fa7871
3fa7871
* Mon Dec 29 2008 <mycae(a!t)yahoo.com> 1.8-2
3fa7871
- Remove redundant and erroneous licence field in devel section
3fa7871
- Fix files from mgl/*h to mgl/
3fa7871
- Removed Requires, per bugzilla recommendation.
3fa7871
- Disabled static library generation
3fa7871
- Removed libltdl from build 
3fa7871
- Added libtool-ltdl as BuildRequires
3fa7871
3fa7871
* Mon Dec 29 2008 <mycae(a!t)yahoo.com> 1.8-1
3fa7871
- Updated to version 1.8
3fa7871
- Added QT env. vars for fedora
3fa7871
- Cleaned up description
3fa7871
- Change licence field from GPL to GPLv2
3fa7871
3fa7871
* Wed Jun 4 2008 Nik <niktr@mail.ru> 
3fa7871
- disabled hdf5 support according to developer request
3fa7871
3fa7871
* Tue Jun 3 2008 Nik <niktr@mail.ru> 
3fa7871
- updated to version 1.7.1
3fa7871
3fa7871
* Sun Jun 2 2008 Nik <niktr@mail.ru> 
3fa7871
- updated to version 1.7
3fa7871
3fa7871
* Sat Apr 5 2008 Nik <niktr@mail.ru> 
3fa7871
- updated to version 1.6.2
3fa7871
3fa7871
* Thu Mar 13 2008 Nik <niktr@mail.ru>
3fa7871
- updated to version 1.6
3fa7871
- added fltk(-devel) to requres list
3fa7871
3fa7871
* Tue Mar 11 2008 Nik <niktr@mail.ru>
3fa7871
- tiff bug fixed
3fa7871
- enable-all option added
3fa7871
3fa7871
* Sat Mar 1 2008 Nik <niktr@mail.ru>
3fa7871
- spec cleanup
3fa7871
- --enable(jpeg, tiff, hdf5) features added
3fa7871
- enable-tiff leads to make error, submitted to author. Feature disabled.
3fa7871
3fa7871
* Fri Feb 29 2008 Nik <niktr@mail.ru>
3fa7871
- initial build of version 1.5
3fa7871
3fa7871