diff --git a/mathgl-1.11.3-fltk.patch b/mathgl-1.11.3-fltk.patch deleted file mode 100644 index 4b22336..0000000 --- a/mathgl-1.11.3-fltk.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur mathgl-1.11.0.1.orig/include/mgl/mgl_fltk.h mathgl-1.11.0.1/include/mgl/mgl_fltk.h ---- mathgl-1.11.0.1.orig/include/mgl/mgl_fltk.h 2010-11-13 22:04:11.000000000 +0100 -+++ mathgl-1.11.0.1/include/mgl/mgl_fltk.h 2011-05-31 12:51:46.477338346 +0200 -@@ -29,7 +29,7 @@ - #endif - - #include --#include -+#include - #include - #include - #include diff --git a/mathgl-1.11.3-zlib.patch b/mathgl-1.11.3-zlib.patch deleted file mode 100644 index 25f059a..0000000 --- a/mathgl-1.11.3-zlib.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- mgl/mgl_data_png.cpp -+++ mgl/mgl_data_png.cpp -@@ -20,6 +20,7 @@ - #include - #ifndef NO_PNG - #include -+#include - #endif - #include "mgl/mgl_data.h" - #include "mgl/mgl_c.h" ---- mgl/mgl_export.cpp -+++ mgl/mgl_export.cpp -@@ -25,6 +25,7 @@ - #include - #ifndef NO_PNG - #include -+#include - #endif - #ifdef HAVE_JPEG - extern "C" { diff --git a/mathgl-disable-lib-installdir.patch b/mathgl-disable-lib-installdir.patch new file mode 100644 index 0000000..480d87f --- /dev/null +++ b/mathgl-disable-lib-installdir.patch @@ -0,0 +1,12 @@ +diff -r 2e857844b18d CMakeLists.txt +--- CMakeLists.txt Sun Apr 14 13:42:40 2013 +0100 ++++ CMakeLists.txt Sun Apr 14 13:43:36 2013 +0100 +@@ -13,7 +13,7 @@ + + include(CMakeDependentOption) + +-set(MGL_LIB_INSTALL_DIR "lib" CACHE STRING "Set library install directory") ++#set(MGL_LIB_INSTALL_DIR "lib" CACHE STRING "Set library install directory") + + option(enable-double "Enable double precision in MathGL library" ON) + option(enable-simple "Slightly increase drawing speed but disable mglDataA class") diff --git a/mathgl-fltk-skip-fluid.patch b/mathgl-fltk-skip-fluid.patch new file mode 100644 index 0000000..15b9a11 --- /dev/null +++ b/mathgl-fltk-skip-fluid.patch @@ -0,0 +1,11 @@ +diff -r 58c850552b42 CMakeLists.txt +--- CMakeLists.txt Sun Apr 14 13:20:15 2013 +0100 ++++ CMakeLists.txt Sun Apr 14 13:20:22 2013 +0100 +@@ -235,6 +235,7 @@ + + if((enable-all-widgets OR enable-fltk) AND (NOT enable-lgpl) ) + set(MGL_HAVE_FLTK 1) ++ set(FLTK_SKIP_FLUID 1) + include(FindFLTK) + if(NOT FLTK_FOUND) + message(SEND_ERROR "Couldn't find FLTK library.") diff --git a/mathgl-no-hdf4-and-hdf5-simultaneously.patch b/mathgl-no-hdf4-and-hdf5-simultaneously.patch new file mode 100644 index 0000000..aa19224 --- /dev/null +++ b/mathgl-no-hdf4-and-hdf5-simultaneously.patch @@ -0,0 +1,12 @@ +diff -r 9f8feb3b9d86 CMakeLists.txt +--- a/CMakeLists.txt Sun Apr 14 12:07:59 2013 +0100 ++++ b/CMakeLists.txt Sun Apr 14 12:09:15 2013 +0100 +@@ -121,7 +121,7 @@ + set(MGL_HAVE_PTHREAD 0) + endif(enable-all OR enable-pthread) + +-if((enable-all OR enable-hdf4) AND (NOT enable-lgpl) ) ++if((enable-hdf4 AND (NOT enable-all) ) AND (NOT enable-lgpl) AND (NOT enable-hdf5)) + set(MGL_HAVE_HDF4 1) + find_library(HDF4_LIB df) + find_library(HDF4MF_LIB mfhdf) diff --git a/mathgl.spec b/mathgl.spec index 026304d..930684b 100644 --- a/mathgl.spec +++ b/mathgl.spec @@ -1,5 +1,5 @@ Name: mathgl -Version: 1.11.3 +Version: 2.1.2 Release: 1%{?dist} Summary: Cross-platform library for making high-quality scientific graphics Summary(de): Plattformübergreifende Bibliothek für hochwertige wissenschaftliche Graphiken @@ -9,26 +9,31 @@ Group: Development/Libraries Url: http://mathgl.sourceforge.net Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz -#Fltk uses /usr/include/FL -Patch0: %{name}-%{version}-fltk.patch -#libpng 1.5 no longer include Z_BEST_COMPRESSION, and thus we need to -# include zlib directly -Patch1: %{name}-%{version}-zlib.patch +#Mathgl's enable all tries to use hdf4 and 5 at the same time +Patch0: mathgl-no-hdf4-and-hdf5-simultaneously.patch + +#CMake looks for "FLUID" - the fltk UI designer. +#This is not needed - instruct cmake to skip it at build time +Patch1: mathgl-fltk-skip-fluid.patch + +#Mathgl hardcodes the libdir as lib, then puts it in a var. +# we will simply pass it as an arg to cmake. +Patch2: mathgl-disable-lib-installdir.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # mandatory packages -BuildRequires: gsl-devel libpng-devel libtool-ltdl-devel libtool -BuildRequires: swig +BuildRequires: gsl-devel libpng-devel # optional packages BuildRequires: freeglut-devel hdf-devel hdf5-static libjpeg-devel libtiff-devel fltk-devel qt4-devel BuildRequires: wxGTK-devel giflib-devel +BuildRequires: libharu-devel +BuildRequires: swig octave-devel +BuildRequires: libXmu-devel +BuildRequires: python2-devel numpy +BuildRequires: cmake -#For autoreconf (required for patches, libtool) -BuildRequires: autoconf -BuildRequires: automake -BuildRequires: libtool Requires(post): info Requires(preun): info @@ -57,45 +62,44 @@ developing applications that use %{name}. %package doc Group: Documentation Summary: HTML documentation and tutorial for the %{name} applications - BuildArch: noarch BuildRequires: texi2html texinfo-tex - %description doc This package contains the documentation in the HTML format of the %{name} package. +%package udav +Summary: UDAV viewer and editor for mathgl graphs +Group: Applications/Engineering +Requires: %{name} = %{version}-%{release} + +%description udav +UDAV is cross-platform program for interactive data array visualization +using the MathGL library. UDAV works as a front-end to the mathgl +scripting engine, allowing for the generation of a wide variety of +scientific graph styles. + + %prep %setup -q #convert EOL encodings, maintaining timestames -for file in AUTHORS ChangeLog.txt README COPYRIGHT; do +for file in AUTHORS ChangeLog.txt README ; do sed 's/\r//' $file > $file.new && \ touch -r $file $file.new && \ mv $file.new $file done -%patch0 -p1 +%patch0 %patch1 - +%patch2 %build -#configure looks for * not *-qt4 -QMAKE=/usr/bin/qmake-qt4 -LUPDATE=/usr/bin/lupdate-qt4 -LRELEASE=/usr/bin/lrelease-qt4 - -export LDFLAGS="-L/usr/lib64/hdf/ -L/usr/lib/hdf" -%configure --disable-static \ - --enable-shared \ - --enable-all - -sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool -sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool - -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/widgets/.libs/:`pwd`/mgl/.libs +cmake -DMGL_LIB_INSTALL_DIR=%{_libdir} \ + -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} \ + -Denable-all=on -Denable-hdf4=off -Denable-doc=on -Denable-all-swig=on -Denable-all-widgets=on -Denable-mpi=off make %{?_smp_mflags} @@ -103,39 +107,17 @@ make %{?_smp_mflags} rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" -#Trash the .la files that get generated anyway (faulty configure? Doesn't appear up without --disable-ltdtl-install) -rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la +#Remove symlink to .so file in python dir. Let python find libs normally +unlink $RPM_BUILD_ROOT/%{python_sitelib}/_mathgl.so -pushd . -#Lets build a "docs" dir to maintain the dir relationships needed for html files -mkdir -p texinfo/docs -cd texinfo/docs/ -cp -pr ../mathgl_en.html . -cp -pr ../png/ . +#Remove static libraries generated by cmake +rm ${RPM_BUILD_ROOT}/%{_libdir}/*.a -#remove zero length faux PNG file -rm -f png/all.png - -popd - -#remove installed docs, which we are installing via doc macro -rm -rf $RPM_BUILD_ROOT/%{_docdir}/%{name} - -#remove misplaced info "dir" file -rm -f $RPM_BUILD_ROOT/%{_infodir}/dir - -pushd $RPM_BUILD_ROOT/%{_infodir} - -#move to _en info files -for i in mathgl_en.info*; -do - mv $i `echo $i | sed s/mathgl_en/mathgl/` -done - -rm mgl_*.info* - -popd +#Remove the binary mgl.cgi. Im not convinced about it (eg mem leak in main), and that its really needed +rm ${RPM_BUILD_ROOT}/%{_bindir}/mgl.cgi +#Copy info file which is not otherwise installed +cp texinfo/%{name}_en.info ${RPM_BUILD_ROOT}/%{_infodir}/%{name}.info %post /sbin/ldconfig /sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || : @@ -153,24 +135,38 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -%doc AUTHORS ChangeLog.txt README COPYING COPYRIGHT NEWS TODO +%doc AUTHORS ChangeLog.txt README COPYING README_V2 %{_libdir}/*.so.* %{_bindir}/mgl* %{_datadir}/%{name}/ -%{_infodir}/%{name}.*.gz -%{_infodir}/%{name}_ru.*.gz - +%{python_sitelib}/* +%{_mandir}/man5/mgl.5.gz +%{_mandir}/man1/mglconv.1.gz +%{_mandir}/man1/mglview.1.gz +%{_infodir}/%{name}*.gz + +%files udav +%{_bindir}/udav +%{_mandir}/man1/udav.1.gz +%{_datadir}/applications/udav.desktop +%{_datadir}/udav/ +%{_datadir}/pixmaps/*.png %files devel %defattr(-,root,root,-) -%{_includedir}/mgl/ +%{_includedir}/mgl2/ %{_libdir}/*.so %files doc %defattr(-,root,root,-) -%doc texinfo/docs/* +%doc %{_docdir}/%{name} + %changelog +* Sun Apr 14 2013 2.1.2-1 +- Update to upstream 2.1.2 +- New upstream has entirely different build system + * Fri Dec 07 2012 - 1.11.3-1 - Update to 1.11.3