From 5c46d395b8cee25d3631f215d13b4277b63ba9aa Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Mon, 15 Feb 2010 20:42:51 +0000 Subject: [PATCH] - Update to 0.9rc4 - Enable grib, udunits2, and wxWidgets support - Build python module and add sub-package for it - Use %global instead of %define --- .cvsignore | 2 +- gdl-0.9rc2-20090504-antlr-auto.patch | 37 ---------- gdl-0.9rc4-GDLLexer.patch | 11 +++ gdl-0.9rc4-antlr-auto.patch | 40 +++++++++++ gdl-0.9rc4-python.patch | 28 ++++++++ gdl-0.9rc4-wx-config.patch | 27 ++++++++ gdl-0.9rc4-wx.patch | 11 +++ gdl.spec | 100 +++++++++++++++++++++------ makecvstarball | 6 +- sources | 2 +- 10 files changed, 201 insertions(+), 63 deletions(-) delete mode 100644 gdl-0.9rc2-20090504-antlr-auto.patch create mode 100644 gdl-0.9rc4-GDLLexer.patch create mode 100644 gdl-0.9rc4-antlr-auto.patch create mode 100644 gdl-0.9rc4-python.patch create mode 100644 gdl-0.9rc4-wx-config.patch create mode 100644 gdl-0.9rc4-wx.patch diff --git a/.cvsignore b/.cvsignore index d05b492..2585ff6 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -gdl-0.9rc3.tar.gz +gdl-0.9rc4.tar.gz diff --git a/gdl-0.9rc2-20090504-antlr-auto.patch b/gdl-0.9rc2-20090504-antlr-auto.patch deleted file mode 100644 index 4d9b349..0000000 --- a/gdl-0.9rc2-20090504-antlr-auto.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- gdl-0.9rc2-20090504/configure.in.antlr-auto 2009-04-30 16:07:55.000000000 -0600 -+++ gdl-0.9rc2-20090504/configure.in 2009-05-04 16:17:25.000000000 -0600 -@@ -842,7 +842,7 @@ - dnl perform program name transformation - dnl AC_ARG_PROGRAM - --AC_CONFIG_FILES(Makefile src/Makefile src/antlr/Makefile) -+AC_CONFIG_FILES(Makefile src/Makefile) - - AC_OUTPUT - ---- gdl-0.9rc2-20090504/src/Makefile.am.antlr-auto 2009-03-03 16:32:14.000000000 -0700 -+++ gdl-0.9rc2-20090504/src/Makefile.am 2009-05-04 16:17:18.000000000 -0600 -@@ -1,6 +1,5 @@ - # set the include path found by configure - INCLUDES = $(EXT_INCLUDES) $(all_includes) --SUBDIRS = antlr - noinst_HEADERS = gdlwidget.hpp prognode.hpp prognodeexpr.hpp - - cpp_hpp_files = accessdesc.hpp arrayindex.hpp assocdata.cpp assocdata.hpp \ -@@ -53,7 +52,7 @@ - gdl_CXXFLAGS = $(AM_CXXFLAGS) - # the library search path. - gdl_LDFLAGS = $(all_libraries) --gdl_LDADD = $(top_builddir)/src/antlr/libantlr.a -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 -+gdl_LDADD = -lantlr -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 - endif - - # build as library (for python module) -@@ -69,6 +68,6 @@ - libgdl_la_LDFLAGS = $(all_libraries) -Wl,-z,muldefs - endif - --libgdl_la_LIBADD = $(top_builddir)/src/antlr/libantlr.la -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 -+libgdl_la_LIBADD = -lantlr -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 - endif - diff --git a/gdl-0.9rc4-GDLLexer.patch b/gdl-0.9rc4-GDLLexer.patch new file mode 100644 index 0000000..be0cb25 --- /dev/null +++ b/gdl-0.9rc4-GDLLexer.patch @@ -0,0 +1,11 @@ +--- gdl-0.9rc4/src/widget.cpp.GDLLexer 2010-02-02 11:13:51.000000000 -0700 ++++ gdl-0.9rc4/src/widget.cpp 2010-02-04 08:41:11.835418064 -0700 +@@ -589,7 +589,7 @@ + + RefDNode theAST; + +- GDLLexer lexer(istr, ""); ++ GDLLexer lexer(istr, "", GDLParser::NONE); + GDLParser& parser = lexer.Parser(); + parser.interactive(); + diff --git a/gdl-0.9rc4-antlr-auto.patch b/gdl-0.9rc4-antlr-auto.patch new file mode 100644 index 0000000..18179e2 --- /dev/null +++ b/gdl-0.9rc4-antlr-auto.patch @@ -0,0 +1,40 @@ +diff -up gdl-0.9rc4/configure.in.antlr-auto gdl-0.9rc4/configure.in +--- gdl-0.9rc4/configure.in.antlr-auto 2010-02-03 15:33:19.000000000 -0700 ++++ gdl-0.9rc4/configure.in 2010-02-03 15:34:22.271329291 -0700 +@@ -988,7 +988,7 @@ dnl AC_CHECK_FUNCS(strdup strtod strtol + dnl perform program name transformation + dnl AC_ARG_PROGRAM + +-AC_CONFIG_FILES(Makefile src/Makefile src/antlr/Makefile src/pro/Makefile src/pro/dicom/Makefile testsuite/Makefile doc/Makefile) ++AC_CONFIG_FILES(Makefile src/Makefile src/pro/Makefile src/pro/dicom/Makefile testsuite/Makefile doc/Makefile) + AC_OUTPUT + + dnl == summary table ======================================= +diff -up gdl-0.9rc4/src/Makefile.am.antlr-auto gdl-0.9rc4/src/Makefile.am +--- gdl-0.9rc4/src/Makefile.am.antlr-auto 2010-02-02 11:13:51.000000000 -0700 ++++ gdl-0.9rc4/src/Makefile.am 2010-02-03 15:34:48.470350773 -0700 +@@ -1,6 +1,6 @@ + # set the include path found by configure + INCLUDES = $(EXT_INCLUDES) $(all_includes) +-SUBDIRS = antlr pro ++SUBDIRS = pro + noinst_HEADERS = gdlwidget.hpp prognode.hpp prognodeexpr.hpp + + cpp_hpp_files = accessdesc.hpp arrayindex.hpp assocdata.cpp assocdata.hpp \ +@@ -56,7 +56,7 @@ gdl_SOURCES = $(cpp_hpp_files) gdl.cpp + gdl_CXXFLAGS = $(AM_CXXFLAGS) + # the library search path. + gdl_LDFLAGS = $(all_libraries) +-gdl_LDADD = $(top_builddir)/src/antlr/libantlr.a -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 ++gdl_LDADD = -lantlr -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 + endif + + # build as library (for python module) +@@ -72,6 +72,6 @@ else + libgdl_la_LDFLAGS = $(all_libraries) -Wl,-z,muldefs + endif + +-libgdl_la_LIBADD = $(top_builddir)/src/antlr/libantlr.la -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 ++libgdl_la_LIBADD = -lantlr -L/usr/X11R6/lib64 -L/usr/X11R6/lib -lX11 + endif + diff --git a/gdl-0.9rc4-python.patch b/gdl-0.9rc4-python.patch new file mode 100644 index 0000000..542f20e --- /dev/null +++ b/gdl-0.9rc4-python.patch @@ -0,0 +1,28 @@ +--- gdl-0.9rc4/src/pythongdl.cpp.python 2010-02-02 11:13:51.000000000 -0700 ++++ gdl-0.9rc4/src/pythongdl.cpp 2010-02-04 09:29:30.855905623 -0700 +@@ -176,7 +176,7 @@ + if( kwDict != NULL) + { + PyObject *key, *value; +- int dictPos = 0; ++ Py_ssize_t dictPos = 0; + + int nKW = PyDict_Size( kwDict); + +@@ -242,7 +242,7 @@ + if( kwDict != NULL) + { + PyObject *key, *value; +- int dictPos = 0; ++ Py_ssize_t dictPos = 0; + + int nKW = PyDict_Size( kwDict); + for( SizeT k=0; kOnExit(); // Defined in GDLApp::OnExit() in gdlwidget.cpp ++ if (wxTheApp) wxTheApp->OnExit(); // Defined in GDLApp::OnExit() in gdlwidget.cpp + wxUninitialize(); + #endif + diff --git a/gdl.spec b/gdl.spec index e7199eb..4230220 100644 --- a/gdl.spec +++ b/gdl.spec @@ -1,37 +1,44 @@ -%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Name: gdl Version: 0.9 -Release: 0.9.rc3%{?dist} +Release: 0.10.rc4%{?dist} Summary: GNU Data Language Group: Applications/Engineering License: GPLv2+ URL: http://gnudatalanguage.sourceforge.net/ -Source0: http://downloads.sourceforge.net/gnudatalanguage/%{name}-%{version}rc3.tar.gz -# Made with makecvstarball -#Source0: http://downloads.sourceforge.net/gnudatalanguage/%{name}-%{version}rc2-20090603.tar.bz2 +Source0: http://downloads.sourceforge.net/gnudatalanguage/%{name}-%{version}rc4.tar.gz Source1: gdl.csh Source2: gdl.sh Source3: makecvstarball +Patch0: gdl-0.9rc4-wx-config.patch +Patch1: gdl-0.9rc4-GDLLexer.patch +Patch2: gdl-0.9rc4-python.patch # Build with system antlr library. Request for upstream change here: # https://sourceforge.net/tracker/index.php?func=detail&aid=2685215&group_id=97659&atid=618686 Patch3: gdl-0.9rc3-antlr.patch -Patch4: gdl-0.9rc2-20090504-antlr-auto.patch +Patch4: gdl-0.9rc4-antlr-auto.patch +Patch5: gdl-0.9rc4-wx.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -#RHEL doesn't have the needed antlr version/headers, old plplot +#RHEL doesn't have the needed antlr version/headers, has old plplot %if !0%{?rhel} BuildRequires: antlr -%define plplot_config %{nil} +%global plplot_config %{nil} %else -%define plplot_config --enable-oldplplot +%global plplot_config --enable-oldplplot %endif BuildRequires: readline-devel, ncurses-devel BuildRequires: gsl-devel, plplot-devel, ImageMagick-c++-devel BuildRequires: netcdf-devel, hdf5-devel, libjpeg-devel BuildRequires: python-devel, python-numarray, python-matplotlib -BuildRequires: fftw-devel, hdf-static, hdf-devel, proj-devel +BuildRequires: fftw-devel, hdf-static, proj-devel +BuildRequires: grib_api-static +#TODO - Build with mpi support +#BuildRequires: mpich2-devel +BuildRequires: udunits2-devel +BuildRequires: wxGTK-devel BuildRequires: autoconf, automake, libtool # Needed to pull in drivers Requires: plplot @@ -57,12 +64,28 @@ BuildArch: noarch Common files for GDL +%package python +Summary: GDL python module +Group: Applications/Engineering +# Needed to pull in drivers +Requires: plplot +Requires: %{name}-common = %{version}-%{release} +Provides: %{name}-runtime = %{version}-%{release} + +%description python +%{summary}. + + %prep -%setup -q -n %{name}-%{version}rc3 +%setup -q -n %{name}-%{version}rc4 +%patch0 -p1 -b .wx-config +%patch1 -p1 -b .GDLLexer +%patch2 -p1 -b .python %if !0%{?rhel} -%patch3 -p1 -b .antlr +#patch3 -p1 -b .antlr %patch4 -p1 -b .antlr-auto %endif +%patch5 -p1 -b .wx %if !0%{?rhel} rm -rf src/antlr %endif @@ -70,23 +93,47 @@ rm ltmain.sh autoreconf --install +%global _configure ../configure +%global configure_opts \\\ + --disable-dependency-tracking --disable-static \\\ + --with-fftw \\\ + --with-udunits \\\ + --with-grib \\\ + --with-wxWidgets \\\ + %{plplot_config} \\\ + INCLUDES="-I%{_includedir}/udunits2" \\\ + LIBS="-L%{_libdir}/hdf -ldl" \\\ +%{nil} +# TODO - build an mpi version +# INCLUDES="-I/usr/include/mpich2" \ +# --with-mpich=%{_libdir}/mpich2 \ + %build export CPPFLAGS="-DH5_USE_16_API" -%configure --disable-dependency-tracking --disable-static --with-fftw \ - %{plplot_config} \ - INCLUDES="-I/usr/include/netcdf -I/usr/include/hdf" \ - LIBS="-L%{_libdir}/hdf" +mkdir build build-python +#Build the standalone executable +pushd build +%configure %{configure_opts} make %{?_smp_mflags} +popd +#Build the python module +pushd build-python +%configure %{configure_opts} --enable-python_module +make %{?_smp_mflags} +popd %install rm -rf $RPM_BUILD_ROOT +pushd build make install DESTDIR=$RPM_BUILD_ROOT rm -r $RPM_BUILD_ROOT%{_libdir} +popd -# Install the library -install -d -m 0755 $RPM_BUILD_ROOT/%{_datadir} -cp -r src/pro $RPM_BUILD_ROOT/%{_datadir}/gdl +# Install the python module +install -d -m 0755 $RPM_BUILD_ROOT/%{python_sitearch} +install -m 0755 build-python/src/.libs/libgdl.so.0.0.0 \ + $RPM_BUILD_ROOT/%{python_sitearch}/GDL.so # Install the profile file to set GDL_PATH install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/profile.d @@ -96,7 +143,7 @@ install -m 0644 %SOURCE2 $RPM_BUILD_ROOT/%{_sysconfdir}/profile.d %check cd testsuite -echo ".r test_suite" | ../src/gdl +echo ".r test_suite" | ../build/src/gdl %clean @@ -108,13 +155,24 @@ rm -rf $RPM_BUILD_ROOT %doc AUTHORS ChangeLog COPYING HACKING NEWS README TODO %config(noreplace) %{_sysconfdir}/profile.d/gdl.*sh %{_bindir}/gdl +%{_mandir}/man1/gdl.1* %files common %defattr(-,root,root,-) -%{_datadir}/gdl/ +%{_datadir}/gnudatalanguage/ + +%files python +%defattr(-,root,root,-) +%{python_sitearch}/GDL.so %changelog +* Wed Feb 15 2010 Orion Poplawski - 0.9-0.10.rc4 +- Update to 0.9rc4 +- Enable grib, udunits2, and wxWidgets support +- Build python module and add sub-package for it +- Use %%global instead of %%define + * Tue Dec 8 2009 Michael Schwendt - 0.9-0.9.rc3 - Explicitly BR hdf-static in accordance with the Packaging Guidelines (hdf-devel is still static-only). diff --git a/makecvstarball b/makecvstarball index 263f312..00f9bf9 100755 --- a/makecvstarball +++ b/makecvstarball @@ -1,9 +1,9 @@ #!/bin/sh -if [ -n "$" ] +if [ -n "$1" ] then date=$1 else date=`date +%Y%m%d` fi -cvs -z3 -d :pserver:anonymous@gnudatalanguage.cvs.sourceforge.net:/cvsroot/gnudatalanguage export -D ${date} -d gdl-0.9rc2-${date} gdl -tar cjf gdl-0.9rc2-${date}.tar.bz2 gdl-0.9rc2-${date} +cvs -z3 -d :pserver:anonymous@gnudatalanguage.cvs.sourceforge.net:/cvsroot/gnudatalanguage export -D ${date} -d gdl-0.9rc4-${date} gdl +tar cjf gdl-0.9rc4-${date}.tar.bz2 gdl-0.9rc4-${date} diff --git a/sources b/sources index e95bc5b..f7a4204 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -94a29e13ec5d71e664659b32e421b02e gdl-0.9rc3.tar.gz +dcef0d75308a13856a799d12755c80a3 gdl-0.9rc4.tar.gz