From af4c414c17a1ef6bdaecc1e224e7e7675641b5e5 Mon Sep 17 00:00:00 2001 From: Dmitrij S. Kryzhevich Date: Dec 09 2015 11:02:08 +0000 Subject: Reenable octave module and] move out qt/wx/fltk widgets --- diff --git a/mathgl-2.3.3-gsl2.patch b/mathgl-2.3.3-gsl2.patch index 09567cf..076badd 100644 --- a/mathgl-2.3.3-gsl2.patch +++ b/mathgl-2.3.3-gsl2.patch @@ -1,7 +1,7 @@ diff -urp mathgl-2.3.3/CMakeLists.txt mathgl-2.3.3-gsl2/CMakeLists.txt ---- mathgl-2.3.3/CMakeLists.txt 2015-06-01 13:29:26.000000000 +0600 -+++ mathgl-2.3.3-gsl2/CMakeLists.txt 2015-11-24 12:10:43.580786919 +0600 -@@ -259,6 +259,13 @@ endif(enable-pthread) +--- mathgl-2.3.3/CMakeLists.txt 2015-12-08 21:39:12.774499940 +0600 ++++ mathgl-2.3.3-gsl2/CMakeLists.txt 2015-12-08 21:39:50.534220640 +0600 +@@ -259,6 +259,16 @@ endif(enable-pthread) if(enable-gsl) set(MGL_HAVE_GSL 1) @@ -11,26 +11,32 @@ diff -urp mathgl-2.3.3/CMakeLists.txt mathgl-2.3.3-gsl2/CMakeLists.txt + if ( NOT ${GSL2_VERSION} LESS 2.0 ) + SET(ISGSL2 1) + endif ( NOT ${GSL2_VERSION} LESS 2.0 ) ++ if ( ${GSL2_VERSION} LESS 1.16 ) ++ SET(ISOLDGSL 1) ++ endif ( ${GSL2_VERSION} LESS 1.16 ) + endif ( GSL2_FOUND ) find_library(GSL_LIB gsl) find_library(GSL_CBLAS_LIB gslcblas) find_path(GSL_INCLUDE_DIR gsl/gsl_fft_complex.h) diff -urp mathgl-2.3.3/src/CMakeLists.txt mathgl-2.3.3-gsl2/src/CMakeLists.txt --- mathgl-2.3.3/src/CMakeLists.txt 2015-06-01 13:29:02.000000000 +0600 -+++ mathgl-2.3.3-gsl2/src/CMakeLists.txt 2015-11-24 12:11:14.494707480 +0600 -@@ -23,6 +23,9 @@ ${MathGL_BINARY_DIR}/include/mgl2/dllexp ++++ mathgl-2.3.3-gsl2/src/CMakeLists.txt 2015-12-08 21:40:21.154183235 +0600 +@@ -23,6 +23,12 @@ ${MathGL_BINARY_DIR}/include/mgl2/dllexp ) add_definitions(-DMGL_SRC) +if(DEFINED ISGSL2) +add_definitions(-DHAVE_GSL_2) +endif(DEFINED ISGSL2) ++if(DEFINED ISOLDGSL) ++add_definitions(-DGSL_DISABLE_DEPRECATED) ++endif(DEFINED ISOLDGSL) if(MGL_HAVE_PNG) set(prc_src prc/PRCbitStream.cc prc/PRCdouble.cc prc/oPRCFile.cc prc/writePRC.cc prc.cpp ) diff -urp mathgl-2.3.3/src/fit.cpp mathgl-2.3.3-gsl2/src/fit.cpp --- mathgl-2.3.3/src/fit.cpp 2015-06-01 13:29:02.000000000 +0600 -+++ mathgl-2.3.3-gsl2/src/fit.cpp 2015-11-24 12:13:39.912670946 +0600 ++++ mathgl-2.3.3-gsl2/src/fit.cpp 2015-12-08 21:41:24.987020578 +0600 @@ -193,7 +193,14 @@ mreal MGL_NO_EXPORT mgl_fit_base(mglFitD } while ( status == GSL_CONTINUE && iter < 500 ); diff --git a/mathgl.spec b/mathgl.spec index 0d16c0d..0d5fc53 100644 --- a/mathgl.spec +++ b/mathgl.spec @@ -1,11 +1,29 @@ %ifnarch s390 s390x %global with_openmpi 1 %endif +%ifnarch ppc64le ppc64 %global with_mpich2 1 +%endif +%global with_doc 1 + +%if 0%{?fedora} >= 21 +%global with_octave 1 +%global octpkg mathgl +# No libharu in RHEL/EPEL +%global with_haru 1 +%endif + +%if 0%{?with_doc} +%global docs on +%else +%global docs off +%endif + + Name: mathgl Version: 2.3.3 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Cross-platform library for making high-quality scientific graphics Summary(de): Plattformübergreifende Bibliothek für hochwertige wissenschaftliche Graphiken Summary(ru): Библиотека для осуществления высококачественной визуализации данных @@ -35,6 +53,9 @@ Patch5: mathgl-2.3.3-x11.patch # Add missing includes Patch6: mathgl-2.3.3-includes.patch +# Let macros to decide how to install octave module +Patch7: mathgl-2.3.3-nooctaveinstall.patch + # Add support for GSL v.2 and above. Sent to upstream Patch50: mathgl-2.3.3-gsl2.patch @@ -53,19 +74,13 @@ BuildRequires: perl(Storable) BuildRequires: freeglut-devel hdf5-devel libjpeg-devel libtiff-devel BuildRequires: fltk-devel qt5-qtbase-devel qt5-qtwebkit-devel BuildRequires: wxGTK-devel giflib-devel libtool-ltdl-devel +%if 0%{?with_haru} BuildRequires: libharu-devel -BuildRequires: swig lua-devel -#Stop for a while. No new SWIG for 3.8 octave -%if 0%{?fedora} < 21 -BuildRequires: octave-devel %endif +BuildRequires: swig lua-devel BuildRequires: libXmu-devel BuildRequires: python2-devel numpy - -Requires(post): info -Requires(preun): info - %description Mathgl is a cross-platform library for making high-quality scientific graphics. It provides fast data plotting and handling of large data @@ -86,6 +101,7 @@ Summary(ru): Библиотеки и файлы заголовков для %{ Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: gsl-devel +Requires: zlib-devel %description devel The %{name}-devel package contains libraries and header files for @@ -95,6 +111,7 @@ developing applications that use serial version of %{name}. Пакет %{name}-devel содержит библиотеки и файлы заголовков, необходимые для разработки приложений с использованием однопоточной версии %{name}. +%if 0%{?with_doc} %package doc Group: Documentation Summary: HTML documentation and tutorial for the %{name} applications @@ -104,6 +121,7 @@ BuildRequires: texi2html texinfo-tex %description doc This package contains the documentation in the HTML and PDF format of the %{name} package. +%endif %package -n udav Summary: Viewer and editor for mathgl graphs @@ -122,11 +140,36 @@ UDAV - это кроссплатформенное приложение для � данных с применением библиотеки MathGL. UDAV, как GUI для MathGL, может быть использован для формирования различного вида научных иллюстраций. +%package mglview +Summary: Execute MathGL scripts and show in an window +Group: Applications/Engineering +Requires: %{name}-qt = %{version}-%{release} + +%description mglview +mglview reads MGL scripts from scriptfile to produce plots of specified +functions or data. The program will create a GUI window showing the script result. + +%if 0%{?with_octave} +%package -n octave-mathgl +Summary: Octave module for MathGL +Group: Applications/Engineering +Requires: %{name} = %{version}-%{release} +Requires: octave >= 2.9.12 +BuildRequires: octave-devel + +%description -n octave-mathgl +%{Summary}. +%endif + %package common Summary: Common files for %{name} Group: Applications/Engineering BuildArch: noarch Requires: %{name} = %{version}-%{release} +%if 0%{?with_doc} +Requires(post): info +Requires(preun): info +%endif %description common %{summary}. @@ -155,11 +198,14 @@ Requires: %{name}-common = %{version}-%{release} Summary: Devel files for OpenMPI version of %{name} library Group: Applications/Engineering Requires: %{name}-openmpi%{_isa} = %{version}-%{release} +Requires: gsl-devel +Requires: zlib-devel %description openmpi-devel %{summary}. %endif +%if 0%{?with_mpich2} %package mpich Summary: MPICH version of %{name} library Group: Applications/Engineering @@ -178,9 +224,64 @@ Group: Applications/Engineering Requires: %{name}-mpich%{_isa} = %{version}-%{release} Provides: %{name}-mpich2-devel = %{version}-%{release} Obsoletes: %{name}-mpich2-devel < 2.1.2-9 +Requires: gsl-devel +Requires: zlib-devel %description mpich-devel %{summary}. +%endif + +%package qt +Summary: Qt widgets of %{name} library +Group: Applications/Engineering +Requires: %{name} = %{version}-%{release} + +%description qt +%{summary}. + +%package qt-devel +Summary: Devel files for qt widgets of %{name} library +Group: Applications/Engineering +Requires: %{name}-devel = %{version}-%{release} +Requires: qt5-qtbase-devel + +%description qt-devel +%{summary}. + +%package fltk +Summary: Fltk widgets of %{name} library +Group: Applications/Engineering +Requires: %{name} = %{version}-%{release} +Requires: fltk-fluid + +%description fltk +%{summary}. + +%package fltk-devel +Summary: Devel files for fltk widgets of %{name} library +Group: Applications/Engineering +Requires: %{name}-devel = %{version}-%{release} +Requires: fltk-devel + +%description fltk-devel +%{summary}. + +%package wx +Summary: wxWidgets widgets of %{name} library +Group: Applications/Engineering +Requires: %{name} = %{version}-%{release} + +%description wx +%{summary}. + +%package wx-devel +Summary: Devel files for wxWidgets widgets of %{name} library +Group: Applications/Engineering +Requires: %{name}-devel = %{version}-%{release} +Requires: wxGTK-devel + +%description wx-devel +%{summary}. %prep %setup -q @@ -197,17 +298,32 @@ done %patch51 -p1 -b .signed_char %patch0 -b .no-hdf4-and-hdf5-simultaneously %patch1 -b .examples +%if 0%{?with_octave} +%patch7 -b .nooctaveinstall +%else %patch2 -b .no_octave +%endif %patch3 -b .fluid %patch4 -b .no_qt4 %patch5 -b .qt5 %patch6 -b .includes +%if 0%{?with_haru} +# desable pdf support. There is no easy way to disable ONLY pdf support. +sed -i -e 's,.*OPTION(enable-pdf.*,SET(enable-pdf OFF),' -e 's,.*OPTION(enable-doc-prc.*,SET(enable-doc-prc OFF),' CMakeLists.txt +%endif + + # Fix hardcoded paths sed -i s,/usr/local/share/doc/mathgl/,%{_docdir}/%{name}/, udav/udav_wnd.h sed -i s,/usr/local/share/udav/,%{_datadir}/udav/, udav/udav_wnd.cpp sed -i s,/usr/local/share/mathgl/fonts/,%{_datadir}/%{name}/fonts/, udav/prop_dlg.cpp +%if 0%{?with_octave} +# Fix octave module version +sed -i -e "s,Version:.*,Version: %{version}," lang/DESCRIPTION +%endif + %build @@ -218,7 +334,14 @@ export OMP_NUM_THREADS BUILD_MPI="-Denable-mpi=on -Denable-all-docs=off" %buildcommon %define building_serial() \ -BUILD_MPI="-Denable-mpi=off -Denable-all-docs=on" %buildcommon +BUILD_MPI="-Denable-mpi=off \ + -Denable-all-docs=%{docs} \ + -Denable-qt4=off \ + -Denable-qt5=on \ + -Denable-all-swig=on \ + -Denable-all-widgets=on \ + -Denable-hdf4=off \ + " %buildcommon %define buildcommon() \ mkdir -p %{_target_platform}_$MPI_COMPILER_NAME; \ @@ -226,12 +349,6 @@ pushd %{_target_platform}_$MPI_COMPILER_NAME; \ %{cmake} \\\ -DMGL_LIB_INSTALL_DIR=%{_libdir} \\\ -Denable-all=on \\\ - -Denable-hdf4=off \\\ - -Denable-qt4=on \\\ - -Denable-qt5=off \\\ - -Denable-octave=off \\\ - -Denable-all-swig=on \\\ - -Denable-all-widgets=on \\\ $BUILD_MPI \\\ ..; \ popd; \ @@ -274,6 +391,13 @@ rm -r %{buildroot}%{_libdir}/$MPI_COMPILER_NAME/usr # Serial make install DESTDIR=%{buildroot} -C %{_target_platform}_serial INSTALL="install -p" +%if 0%{?with_octave} +pushd lang +mkdir -p %{_tmppath}/%{name}-%{version}-%{release}.%{_arch} +cp ../%{_target_platform}_serial/lang/%{octpkg}.tar.gz %{_tmppath}/%{name}-%{version}-%{release}.%{_arch}/%{octpkg}-%{version}.tar.gz +%octave_pkg_install +popd +%endif %if 0%{?with_openmpi} # OpenMPI @@ -298,19 +422,16 @@ rm %{buildroot}/%{_libdir}/*.a # Remove the binary mgl.cgi. Im not convinced about it (eg mem leak in main), and that its really needed # The same with man file for it rm %{buildroot}/%{_datadir}/mathgl/mgl.cgi +%if 0%{?with_doc} rm %{buildroot}/%{_mandir}/man1/mgl.cgi.1* -# Remove bad octave archive -%if 0%{?fedora} < 21 -#rm %{buildroot}%{_datadir}/mathgl/mathgl.tar.gz -%endif - # Prepare for documentation if [ -d _tmp_docdir ] then rm -r _tmp_docdir fi mv %{buildroot}%{_docdir}/mathgl _tmp_docdir +%endif # Check .desktop file desktop-file-validate %{buildroot}%{_datadir}/applications/udav.desktop @@ -325,6 +446,21 @@ rm -r %{buildroot}/%{_libdir}/cmake %post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%post qt -p /sbin/ldconfig + +%postun qt -p /sbin/ldconfig + +%post fltk -p /sbin/ldconfig + +%postun fltk -p /sbin/ldconfig + +%post wx -p /sbin/ldconfig + +%postun wx -p /sbin/ldconfig + +%if 0%{?with_doc} %post common /sbin/install-info %{_infodir}/%{name}_en.info %{_infodir}/dir || : @@ -332,8 +468,7 @@ rm -r %{buildroot}/%{_libdir}/cmake if [ $1 = 0 ] ; then /sbin/install-info --delete %{_infodir}/%{name}_en.info %{_infodir}/dir || : fi - -%postun -p /sbin/ldconfig +%endif %post -n udav /usr/bin/update-desktop-database &> /dev/null || : @@ -341,38 +476,91 @@ fi %postun -n udav /usr/bin/update-desktop-database &> /dev/null || : +%if 0%{?with_octave} +%post -n octave-mathgl +%octave_cmd pkg rebuild + +%preun -n octave-mathgl +%octave_pkg_preun + +%postun -n octave-mathgl +%octave_cmd pkg rebuild +%endif + %files %doc AUTHORS ChangeLog.txt README COPYING README_V2 -%{_libdir}/*.so.* +%{_libdir}/libmgl.so.* %{_libdir}/mgl-lua.so -%{_bindir}/mgl* +%{_bindir}/mglconv %exclude %{_bindir}/mgl_*example +%if 0%{?with_doc} %{_mandir}/man1/mglconv.1.gz -%{_mandir}/man1/mglview.1.gz +%endif %files devel -%{_libdir}/*.so +%{_libdir}/libmgl.so %exclude %{_libdir}/mgl-lua.so %{_includedir}/mgl2/ %{_datadir}/cmake/Modules/FindMathGL2.cmake +%files mglview +%{_bindir}/mglview +%if 0%{?with_doc} +%{_mandir}/man1/mglview.1.gz +%endif + +%files qt +%{_libdir}/libmgl-qt*.so.* +%{_libdir}/libmgl-wnd.so.* + +%files qt-devel +%{_libdir}/libmgl-qt*.so +%{_libdir}/libmgl-wnd.so + +%files wx +%{_libdir}/libmgl-wx.so.* + +%files wx-devel +%{_libdir}/libmgl-wx.so + +%files fltk +%{_libdir}/libmgl-fltk.so.* +%{_libdir}/libmgl-glut.so.* + +%files fltk-devel +%{_libdir}/libmgl-fltk.so +%{_libdir}/libmgl-glut.so + %files -n udav -f udav.lang %{_bindir}/udav +%if 0%{?with_doc} %{_mandir}/man1/udav.1.gz +%endif %{_datadir}/applications/udav.desktop %{_datadir}/mime/packages/mgl.xml %dir %{_datadir}/udav/ %{_datadir}/pixmaps/*.png +%if 0%{?with_octave} +%files -n octave-mathgl +%{octpkglibdir} +%dir %{octpkgdir} +%{octpkgdir}/packinfo +%endif + +%if 0%{?with_doc} %files doc %doc AUTHORS COPYING %doc _tmp_docdir/* +%endif %files common %{python_sitelib}/* %{_datadir}/%{name}/ -%{_infodir}/%{name}*.gz +%if 0%{?with_doc} %{_mandir}/man5/mgl.5.gz +%{_infodir}/%{name}*.gz +%endif %files examples %{_bindir}/mgl_*example @@ -387,6 +575,7 @@ fi %{_includedir}/openmpi-%{_arch}/mgl2/ %endif +%if 0%{?with_mpich2} %files mpich %doc COPYING %{_libdir}/mpich/lib/*.so.* @@ -394,8 +583,16 @@ fi %files mpich-devel %{_libdir}/mpich/lib/*.so %{_includedir}/mpich-%{_arch}/mgl2/ +%endif %changelog +* Sat Dec 09 2015 Dsmitrij S. Kryzhevich - 2.3.3-5 +- Reenable octave module. +- Conditionalize doc and mpich subpackages. +- Conditionalize libharu and octave: only for Fedora. +- Move -qt, -wx and -fltk widgets into seperate subpackages. +- Update gsl patch: manage old version (in epel). + * Thu Nov 26 2015 Dsmitrij S. Kryzhevich - 2.3.3-4 - Fix building on arm (see mathgl-2.3.3-signed_char.patch).