diff --git a/gnuplot-4.4.1.dif b/gnuplot-4.4.1.dif index 7fca079..38c2e11 100644 --- a/gnuplot-4.4.1.dif +++ b/gnuplot-4.4.1.dif @@ -156,7 +156,7 @@ + char hfile[64]; + struct stat buf; + -+ strcpy (hfile, "/usr/share/gnuplot/4.0/gnuplot-"); ++ sprintf(hfile, "/usr/share/gnuplot/%s/gnuplot-", gnuplot_version); + strncat(hfile, msg, 2); + strcat (hfile, ".gih"); + if (stat(hfile, &buf) == 0) diff --git a/gnuplot-lua.diff b/gnuplot-lua.diff new file mode 100644 index 0000000..609c9bf --- /dev/null +++ b/gnuplot-lua.diff @@ -0,0 +1,108 @@ + Support lua 5.2, based on Rev. 1.17.2.1 from the + gnuplot branch-4-6-stable. + Cf. http://gnuplot.cvs.sourceforge.net/viewvc/gnuplot/gnuplot/term/lua.trm?view=log + +--- term/lua.trm.orig 2012-02-09 20:16:56.000000000 +0100 ++++ term/lua.trm 2012-02-09 20:17:07.000000000 +0100 +@@ -113,6 +113,41 @@ + */ + static char last_error_msg[MAX_LINE_LEN+1] = ""; + ++#if LUA_VERSION_NUM > 501 ++/* ++ * two helper functions to ease transitioning to lua 5.2 ++ */ ++ ++/* ++ * same as lua_getfield(L, LUA_GLOBALINDEXS, f) in lua 5.1 ++ */ ++static void LUA_getfield_global(lua_State *L, const char *f) ++{ ++ lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS); ++ lua_getfield(L, -1, f); ++ lua_replace(L, -2); ++} ++/* ++ * approximately the same as luaL_register(L, libname, l) in lua 5.1 ++ */ ++static void LUA_register(lua_State *L, const char *libname, const luaL_Reg *l) ++{ ++ if (!libname) ++ luaL_setfuncs(L, l, 0); ++ else { ++ LUA_getfield_global(L, "package"); ++ lua_getfield(L, -1, "loaded"); ++ lua_newtable(L); ++ luaL_setfuncs(L, l, 0); ++ lua_pushvalue(L, -1); ++ lua_setglobal(L, libname); ++ lua_setfield(L, -2, libname); ++ lua_pop(L, 2); ++ lua_getglobal(L, libname); ++ } ++} ++#endif /* LUA_VERSION_NUM > 501 */ ++ + /* + * Handle Lua functions + */ +@@ -378,8 +413,11 @@ + return(1); + } + +- ++#if LUA_VERSION_NUM > 500 ++static const luaL_Reg gp_methods[] = { ++#else + static const luaL_reg gp_methods[] = { ++#endif + {"write", LUA_GP_write}, + {"int_error", LUA_GP_int_error}, + {"int_warn", LUA_GP_int_warn}, +@@ -395,7 +433,11 @@ + static void + LUA_register_gp_fnc () + { ++#if LUA_VERSION_NUM > 501 ++ LUA_register(L, LUA_GP_FNC, gp_methods); ++#else + luaL_register(L, LUA_GP_FNC, gp_methods); ++#endif + } + + +@@ -524,7 +566,11 @@ + */ + if (L) + lua_close(L); ++#if LUA_VERSION_NUM > 500 ++ L = luaL_newstate(); ++#else + L = lua_open(); ++#endif + + luaL_openlibs(L); /* Load Lua libraries */ + luaopen_debug(L); +@@ -571,14 +617,22 @@ + sf = lua_gettop(L); + + /* lua_settop(L, 0);*/ /* clear stack */ ++#if LUA_VERSION_NUM > 501 ++ LUA_getfield_global(L, "debug"); ++#else + lua_getfield(L, LUA_GLOBALSINDEX, "debug"); ++#endif + lua_getfield(L, -1, "traceback"); + lua_remove(L, -2); /* rm debug */ + tb = lua_gettop(L); /* store "traceback" */ + /* create table `term' */ + lua_newtable(L); + lua_setglobal(L, "term"); ++#if LUA_VERSION_NUM > 501 ++ LUA_getfield_global(L, "term"); ++#else + lua_getfield(L, LUA_GLOBALSINDEX, "term"); ++#endif + luaterm = lua_gettop(L); /* store `term' */ + + /* register gp functions */ diff --git a/gnuplot.changes b/gnuplot.changes index f5263fc..0fe650a 100644 --- a/gnuplot.changes +++ b/gnuplot.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Wed Feb 13 15:03:20 UTC 2012 - burnus@net-b.de + +- Make gnuplot build with newer LUA version. + +------------------------------------------------------------------- +Mon Feb 13 11:46:11 UTC 2012 - werner@suse.de + +- Fix version control of further help messages, fix done + by Dieter Jurzitza (bnc#746299) + +------------------------------------------------------------------- +Fri Feb 10 19:05:08 CET 2012 - sbrabec@suse.cz + +- Fix libdir x libexecdir clash (bnc#744835). +- Use %configure macro. + ------------------------------------------------------------------- Tue Dec 13 08:33:16 UTC 2011 - cfarrell@suse.com @@ -654,7 +671,7 @@ Thu Oct 23 13:59:59 MET DST 1997 - werner@suse.de Mon Feb 3 23:03:09 MET 1997 - werner@suse.de - Update auf Version 3.5-beta-3.6pl319 - - Diese Version hat splines und bezier zum Fit für + - Diese Version hat splines und bezier zum Fit für von Messdaten. - verschoben von ap1 -> xap1 @@ -662,7 +679,7 @@ Mon Feb 3 23:03:09 MET 1997 - werner@suse.de Wed Nov 13 23:06:41 MET 1996 - werner@suse.de - Neu Erstellen des Paketes: - Mit vollständiger Dokumentation und Beispielen + Mit vollständiger Dokumentation und Beispielen unter /usr/doc/packages/gnuplot/ - fig und bfig (xfig-Format 2.1) wird von xfig in xfig-Format 3.2 konvertiert. diff --git a/gnuplot.spec b/gnuplot.spec index 133325c..24c59a4 100644 --- a/gnuplot.spec +++ b/gnuplot.spec @@ -1,7 +1,7 @@ # # spec file for package gnuplot # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,6 +15,7 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + Name: gnuplot BuildRequires: automake BuildRequires: cairo-devel @@ -48,11 +49,11 @@ BuildRequires: plotutils-devel BuildRequires: plotutils %endif Url: http://www.gnuplot.info/ -License: SUSE-Gnuplot and GPL-2.0+ -Group: Productivity/Graphics/Visualization/Graph Version: 4.4.4 Release: 0 Summary: GNUplot a Function Plotting Utility +License: SUSE-Gnuplot and GPL-2.0+ +Group: Productivity/Graphics/Visualization/Graph Source0: gnuplot-%{version}.tar.bz2 Source2: gnuplot-fr.doc.bz2 Source3: README.whynot @@ -61,6 +62,7 @@ Patch1: gnuplot-4.4.0-x11ovf.dif Patch2: gnuplot-4.4.0-fonts.dif Patch4: gnuplot-4.4.0-demo.dif Patch6: gnuplot-4.2.5-fix-format-errors.dif +Patch7: gnuplot-lua.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %{expand: %%global _exec_prefix %(type -p pkg-config &>/dev/null && pkg-config --variable prefix x11 || echo /usr/X11R6)} %if "%_exec_prefix" == "/usr/X11R6" @@ -89,6 +91,7 @@ and can easily be extended to include new devices. %package doc Summary: Documentation of GNUplot +Group: Productivity/Graphics/Visualization/Graph Requires: %{name} Requires(post): %install_info_prereq Requires(postun): %install_info_prereq @@ -113,6 +116,7 @@ test $? -eq 0 || exit 1 %patch -P 2 -p 0 -b .font %patch -P 4 -p 0 %patch -P 6 -p 0 +%patch -P 7 -p 0 %patch -P 0 -p 0 %build @@ -133,12 +137,7 @@ test $? -eq 0 || exit 1 aclocal -I m4 autoconf %endif - ./configure \ - --prefix=%{_prefix} \ - --mandir=%{_mandir} \ - --infodir=%{_infodir} \ - --libexecdir=%{_libdir} \ - --datadir=%{_datadir} \ + %configure \ --with-gcc \ --with-x \ --x-includes=%{_x11inc} \ @@ -212,7 +211,7 @@ test $? -eq 0 || exit 1 %files %defattr(-,root,root) %{_bindir}/gnuplot -%{_libdir}/gnuplot +%{_libexecdir}/gnuplot %{_datadir}/gnuplot %{_datadir}/texmf/tex/latex/gnuplot/ %{_datadir}/emacs/site-lisp/