swt2c / rpms / mathgl

Forked from rpms/mathgl 5 years ago
Clone
3fa7871
%{!?octave_api:%global octave_api %(octave-config -p API_VERSION || echo 0)}
3fa7871
Name: mathgl
3fa7871
Version: 1.9
3fa7871
Release: 6%{?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 
3fa7871
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
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 
3fa7871
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
3fa7871
%package doc
3fa7871
Group:		Documentation
3fa7871
Summary:	HTML documentation and tutorial for the %{name} applications
3fa7871
3fa7871
BuildArch:	noarch
3fa7871
BuildRequires:	texi2html texinfo-tex	
3fa7871
3fa7871
3fa7871
%description doc
3fa7871
This package contains the documentation in the HTML format of the %{name}
3fa7871
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
3fa7871
%patch0
3fa7871
%patch1
3fa7871
%patch2
3fa7871
%patch3
3fa7871
3fa7871
autoreconf
3fa7871
3fa7871
3fa7871
%build
3fa7871
#configure looks for * not *-qt4
3fa7871
QMAKE=/usr/bin/qmake-qt4
3fa7871
LUPDATE=/usr/bin/lupdate-qt4
3fa7871
LRELEASE=/usr/bin/lrelease-qt4
3fa7871
3fa7871
%configure	--disable-static \
3fa7871
		--enable-shared \
3fa7871
		--enable-all --enable-octave --disable-rpath
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
3fa7871
3fa7871
#Fix up octave .oct file install
3fa7871
mkdir -p temp-octave
3fa7871
3fa7871
pushd .
3fa7871
cd temp-octave
3fa7871
#Decompress tarballed "oct" file and remove tarball
3fa7871
tar -zxf $RPM_BUILD_ROOT/%{_datadir}/%{name}/octave/%{name}.tar.gz
3fa7871
rm $RPM_BUILD_ROOT/%{_datadir}/%{name}/octave/%{name}.tar.gz
3fa7871
3fa7871
#Copy the .oct file and supporting files to octave packages dir
3fa7871
mkdir -p $RPM_BUILD_ROOT/%{_prefix}/libexec/octave/packages/%{name}-1.9.0/
3fa7871
#Remove empty INDEX file
3fa7871
rm %{name}/INDEX
3fa7871
3fa7871
#We cannot use version macro with octave package search,
3fa7871
# as pkg.m assumes a x.y.z format for packages. Failing
3fa7871
# to do this renders the plugin inoperable
3fa7871
cp -pR %{name}/inst/* $RPM_BUILD_ROOT/%{_prefix}/libexec/octave/packages/%{name}-1.9.0/
3fa7871
3fa7871
#packinfo dir is required, or octave will not find the dir in recursive search
3fa7871
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/octave/packages/%{name}-1.9.0/packinfo
3fa7871
cp -p %{name}/[A-Z]* $RPM_BUILD_ROOT/%{_datadir}/octave/packages/%{name}-1.9.0/packinfo
3fa7871
3fa7871
popd
3fa7871
3fa7871
3fa7871
3fa7871
pushd .
3fa7871
#Lets build a "docs" dir to maintain the dir relationships needed for html files
3fa7871
mkdir -p  texinfo/docs
3fa7871
cd texinfo/docs/
3fa7871
cp -pr ../mathgl.html .
3fa7871
cp -pr ../png_static .
3fa7871
cp -pr ../png/ .
3fa7871
3fa7871
#remove zero length faux PNG file
3fa7871
rm -f png/all.png
3fa7871
3fa7871
popd
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}/
3fa7871
%{_prefix}/libexec/octave/packages/%{name}-1.9.0/
3fa7871
%{_datadir}/octave/packages/%{name}-1.9.0/
3fa7871
%{_infodir}/%{name}.*.gz
3fa7871
3fa7871
3fa7871
%files devel
3fa7871
%defattr(-,root,root,-)
3fa7871
%{_includedir}/mgl/
3fa7871
%{_libdir}/*.so
3fa7871
3fa7871
%files doc
3fa7871
%defattr(-,root,root,-)
3fa7871
%doc texinfo/docs/*
3fa7871
3fa7871
%changelog
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