# # spec file # # Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" != "" %define psuffix -%{flavor} %else %define psuffix %{nil} %endif #fixes build failure caused by new .debug files, not sure how to fix correctly %define mname graphviz # name of the plugin config file that dot creates %define config_file config6 %if "%{flavor}" == "addons" %define phpconf_dir %{_sysconfdir}/php%{php_version}/conf.d %define phpext_dir %(%{__php_config} --extension-dir) %define ruby_version $(pkg-config --variable=RUBY_API_VERSION %{_libdir}/pkgconfig/ruby-*.pc) # PHP8 requires swig >= 4.1.0, https://github.com/swig/swig/commit/56d74355735f3661406d69d04d89d1bdb4ca96f9 %if 0%{?suse_version} >= 1599 %define php_version 8 %else %define php_version 7 %endif %endif # No pkgconfig(gts) in sle12 GA or SPx, but in sle15 %if 0%{?suse_version} == 1315 && !0%{?is_opensuse} %bcond_with gts %else %bcond_without gts %endif %define cdt_soversion 5 %define cgraph_soversion 6 %define gvc_soversion 6 %define gvpr_soversion 2 %define lab_gamut_soversion 1 %define pathplan_soversion 4 %define xdot_soversion 4 # Java and ocaml are not in ring1, thus this gets overriden in staging # Also, both install into generic locations instead of a language # specific prefix, disable both %bcond_with java %bcond_with ocaml Name: graphviz%{psuffix} Version: 2.49.3 Release: 0 Summary: Graph Visualization Tools License: EPL-1.0 Group: Productivity/Graphics/Visualization/Graph URL: https://www.graphviz.org/ Source0: https://gitlab.com/graphviz/graphviz/-/archive/%version/graphviz-%{version}.tar.bz2 Source1: graphviz-rpmlintrc #PATCH-FIX-UPSTREAM add flags to also link against libGLU and libGL Patch0: graphviz-smyrna-link_against_glu.patch Patch1: graphviz-fix-pkgIndex.patch #PATCH-FIX-UPSTREAM Off-by-one bug Patch2: graphviz-array_overflow.patch Patch3: graphviz-2.20.2-interpreter_names.patch #PATCH-FIX-UPSTREAM Don't warn about harmless issues with swig generated code Patch4: graphviz-useless_warnings.patch Patch5: graphviz-no_strict_aliasing.patch Patch6: graphviz-no_php_extra_libs.patch # https://gitlab.com/graphviz/graphviz/-/issues/2303 Patch7: swig-4.1.0.patch #PATCH-FIX-UPSTREAM gvc: detect plugin installation failure and display an error Patch8: gvc-detect-plugin-installation-failure-and-display-an-error.patch #PATCH-FIX-OPENSUSE Bug 1225776 - Flavor addons of package graphviz does not build with gcc14 Patch9: graphviz-2.49.3-boo1225776-gcc14.patch #PATCH-FIX-UPSTREAM Patch10: graphviz-87cc546.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: bison BuildRequires: fdupes BuildRequires: flex BuildRequires: gcc-c++ BuildRequires: groff BuildRequires: guile-devel BuildRequires: libstdc++-devel BuildRequires: libtool BuildRequires: pkgconfig BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(zlib) Requires: bitstream-vera-fonts Requires: graphviz-plugins-core = %{version} Recommends: graphviz-gd = %{version} %if %{with gts} BuildRequires: pkgconfig(gts) %endif %if "%{flavor}" == "addons" BuildRequires: freeglut-devel BuildRequires: ghostscript BuildRequires: libjpeg-devel BuildRequires: libpng-devel BuildRequires: libwebp-devel BuildRequires: perl BuildRequires: ruby-devel BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(freetype2) >= 2 BuildRequires: pkgconfig(gdlib) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(glu) BuildRequires: pkgconfig(gtkglext-1.0) BuildRequires: pkgconfig(ice) BuildRequires: pkgconfig(ijs) BuildRequires: pkgconfig(libglade-2.0) BuildRequires: pkgconfig(librsvg-2.0) BuildRequires: pkgconfig(lua) BuildRequires: pkgconfig(pango) BuildRequires: pkgconfig(python3) BuildRequires: pkgconfig(sm) BuildRequires: pkgconfig(tcl) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xaw7) BuildRequires: pkgconfig(xext) %if %{php_version} == 8 BuildRequires: php8-devel BuildRequires: swig >= 4.1.0 %else BuildRequires: php7-devel BuildRequires: swig >= 3.0.11 %endif %if %{with java} BuildRequires: java-devel >= 1.6.0 %endif %if %{with ocaml} BuildRequires: ocaml %endif %endif %if "%{flavor}" == "qt5" BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5PrintSupport) BuildRequires: pkgconfig(Qt5Widgets) %endif %description A collection of tools and tcl packages for the manipulation and layout of graphs (as in nodes and edges, not as in bar charts). %if "%{flavor}" == "qt5" %package -n graphviz-gvedit Summary: Graph editor based on Qt Group: Productivity/Graphics/Visualization/Graph Requires: graphviz %description -n graphviz-gvedit The Qt5 graph editor included with graphviz. %endif %package -n graphviz-smyrna Summary: Large graph viewer Group: Productivity/Graphics/Visualization/Graph Requires: graphviz %description -n graphviz-smyrna Experimental large graph viewer using graphviz %package -n graphviz-gnome Summary: Graphviz plugins that use gtk/GNOME Group: Productivity/Graphics/Visualization/Graph Requires(post): graphviz = %{version} Supplements: (graphviz and xorg-x11-fonts-core) %description -n graphviz-gnome Graphviz plugins that use gtk/GNOME. %package -n graphviz-gd Summary: Graphviz plugin for renderers based on gd Group: Productivity/Graphics/Visualization/Graph Requires(post): graphviz >= %{version} %description -n graphviz-gd The graphviz-gd package contains the gd extensions for the graphviz tools. %package -n graphviz-guile Summary: Graph Visualization Tools Group: Productivity/Graphics/Visualization/Graph Requires: graphviz = %{version} Requires: guile %description -n graphviz-guile A collection of tools and tcl packages for the manipulation and layout of graphs (as in nodes and edges, not as in bar charts). %package -n graphviz-java Summary: Graph Visualization Tools Group: Productivity/Graphics/Visualization/Graph Requires: graphviz = %{version} Requires: java %description -n graphviz-java A collection of tools and tcl packages for the manipulation and layout of graphs (as in nodes and edges, not as in bar charts). %package -n graphviz-x11 Summary: Graph editors based on X11 Group: Productivity/Graphics/Visualization/Graph Requires: graphviz %description -n graphviz-x11 The lefty/dotty/lneato X11 graph editors included with graphviz. %package -n graphviz-lua Summary: Lua extension for graphviz Group: Productivity/Graphics/Visualization/Graph Requires: graphviz = %{version} Requires: lua %description -n graphviz-lua The graphviz-lua package contains the lua extension for the graphviz tools. %package -n graphviz-ocaml Summary: OCAML extension for graphviz Group: Productivity/Graphics/Visualization/Graph Requires: graphviz = %{version} Requires: ocaml %description -n graphviz-ocaml The graphviz-ocaml package contains the Objective Caml extension for the graphviz tools. %package -n graphviz-perl Summary: Perl extension for Graphviz Group: Productivity/Graphics/Visualization/Graph Requires: graphviz = %{version} Requires: perl = %{perl_version} %description -n graphviz-perl The graphviz-perl package contains the Perl extension for the graphviz tools. %package -n graphviz-php Summary: PHP Extension for Graphviz Group: Productivity/Graphics/Visualization/Graph Requires: graphviz = %{version} Requires: php%{php_version} Requires: php(api) = %{php_core_api} Requires: php(zend-abi) = %{php_zend_api} %description -n graphviz-php The graphviz-php package contains the PHP extension for the graphviz tools. %package -n python3-gv Summary: Python 3 Extension for Graphviz Group: Productivity/Graphics/Visualization/Graph Requires: graphviz = %{version} %description -n python3-gv The package contains the Python extension for the graphviz tools. %package -n graphviz-ruby Summary: Ruby Extension for Graphviz Group: Productivity/Graphics/Visualization/Graph Requires: graphviz = %{version} Requires: ruby %description -n graphviz-ruby The graphviz-ruby package contains the ruby extension for the graphviz tools. %package -n graphviz-tcl Summary: Tcl extension tools for graphviz Group: Development/Libraries/Tcl Requires: graphviz = %{version} Requires: tcl >= 8.3 Requires: tk %description -n graphviz-tcl The graphviz-tcl package contains the various tcl packages (extensions) for the graphviz tools. %package -n graphviz-webp Summary: WebP support for graphviz Group: Productivity/Graphics/Visualization/Graph Requires: graphviz = %{version} # depends on cairo in libgvplugin_pango Requires: graphviz-gnome = %{version} Requires(post): graphviz >= %{version} %description -n graphviz-webp The graphviz-webp package contains files needed for the support of WebP images %package -n graphviz-doc Summary: Documentation for graphviz Group: Documentation/Howto %description -n graphviz-doc Provides some additional PDF and HTML documentation for graphviz. %package -n libcdt%{cdt_soversion} Summary: Container data types for Graphviz Group: System/Libraries %description -n libcdt%{cdt_soversion} Library providing container data types for Graphviz. %package -n libcgraph%{cgraph_soversion} Summary: Library for graph programming Group: System/Libraries %description -n libcgraph%{cgraph_soversion} Libcgraph supports graph programming by maintaining graphs in memory and reading and writing graph files. Graphs are composed of nodes, edges, and nested subgraphs. These graph objects may be attributed with string name-value pairs and programmer-defined records. %package -n libgvc%{gvc_soversion} Summary: Graphviz context library Group: System/Libraries Provides: libgraphviz6:%{_libdir}/libgvc.so.6 Obsoletes: libgraphviz6 < %{version}-%{release} %description -n libgvc%{gvc_soversion} libgvc provides a context for applications wishing to manipulate and render graphs. It provides a command line parsing, common rendering code, and a plugin mechanism for renderers. %package -n libgvpr%{gvpr_soversion} Summary: Library for graph filtering Group: System/Libraries Provides: libgraphviz6:%{_libdir}/libgvpr.so.2 Obsoletes: libgraphviz6 < %{version}-%{release} %description -n libgvpr%{gvpr_soversion} The gvpr library allows an application to perform general-purpose graph manipulation and filtering based on an awk-like language %package -n libpathplan%{pathplan_soversion} Summary: Library for finding smooth shortest paths Group: System/Libraries Provides: libgraphviz6:%{_libdir}/libpathplan.so.4 Obsoletes: libgraphviz6 < %{version}-%{release} %description -n libpathplan%{pathplan_soversion} The pathplan library contains functions for finding shortest paths in polygons in fitting bezier curves to those paths. %package -n libxdot%{xdot_soversion} Summary: Library for parsing and deparsing of xdot operations Group: System/Libraries Provides: libgraphviz6:%{_libdir}/libxdot.so.4 Obsoletes: libgraphviz6 < %{version}-%{release} %description -n libxdot%{xdot_soversion} The libxdot library provides support for parsing and deparsing graphical operations specified by the xdot language. %package -n liblab_gamut%{lab_gamut_soversion} Summary: Library containing a rich set of graph drawing tools Group: System/Libraries Provides: libgraphviz6:%{_libdir}/liblab_gamut.so.1 Obsoletes: libgraphviz6 < %{version}-%{release} %description -n liblab_gamut%{lab_gamut_soversion} The lab_gamut library contains a rich set of graph drawing tools. %package plugins-core Summary: Core plugins for graphviz Group: Productivity/Graphics/Visualization/Graph # Needed for dot binary Requires(post): %{mname} %description plugins-core Core plugins for graphviz: * libgvplugin_core * libgvplugin_dot_layout * libgvplugin_neato_layout %package devel Summary: Graphviz development package Group: Development/Libraries/C and C++ Requires: %{mname} = %{version} Requires: libcdt%{cdt_soversion} = %{version} Requires: libcgraph%{cgraph_soversion} = %{version} Requires: libgvc%{gvc_soversion} = %{version} Requires: libgvpr%{gvpr_soversion} = %{version} Requires: liblab_gamut%{lab_gamut_soversion} = %{version} Requires: libpathplan%{pathplan_soversion} = %{version} Requires: libxdot%{xdot_soversion} = %{version} %description devel The graphviz-devel package contains all that's necessary for developing programs that use the graphviz libraries including man3 pages. %prep #autosetup breaks graphviz-addons %setup -q -n %{mname}-%{version} %patch -P 0 %patch -P 1 %patch -P 2 %patch -P 3 %patch -P 4 %patch -P 5 -p1 %patch -P 6 %patch -P 7 -p1 %patch -P 8 -p1 %patch -P 9 %patch -P 10 # pkg-config returns 0 (TRUE) when guile-2.2 is present if pkg-config --atleast-version=2.2 guile-2.2; then sed "s/guile-2.0/guile-2.2/" -i configure.ac fi rm -f contrib/gprof2dot.awk # Fix path for lua/php install sed -i \ -e 's@LUA_INSTALL_DIR="/usr.*@LUA_INSTALL_DIR=%{lua_archdir}@' \ -e 's@\(PHP_INSTALL_DIR=.*\)/php/modules@\1/php%{php_version}/extensions@' \ -e 's@\(PHP_INSTALL_DATADIR=.*\)/php@\1/php%{php_version}@' \ configure.ac %build ./autogen.sh RUBY_VER=%{?ruby_version} CFLAGS="%{optflags} -ffast-math -fno-strict-aliasing -fno-strict-overflow -fPIC" %if "%{flavor}" == "addons" CFLAGS="$CFLAGS -I/usr/include/ruby-%{ruby_version}.0 -fpermissive" #seems to be broken? gives -I/usr/lib64/ruby/2.6.0/x86_64-linux-gnu, ruby.h is in /usr/lib64/ruby/2.6.0 #CFLAGS="$CFLAGS $(pkg-config --cflags ruby-$(echo {rb_ver} | sed 's|\.[^.]*$||'))" %endif export CFLAGS="$CFLAGS" export CPPFLAGS="$CFLAGS" export LDFLAGS="-pie" %configure \ --disable-static \ --without-included-ltdl \ --disable-ltdl-install \ --with-ipsepcola \ --without-ming \ --disable-io \ --without-visio \ %if "%{flavor}" == "addons" --with-x \ --enable-lefty \ --with-smyrna \ RUBY_VER=%{ruby_version} \ %endif %if "%{flavor}" == "qt5" --with-qt \ %endif %if "%{flavor}" == "" --without-mylibgd \ --without-libgd \ %endif --disable-silent-rules make %{?_smp_mflags} %install make install \ DESTDIR=%{buildroot} \ docdir=%{buildroot}%{_docdir}/%{mname} \ pkgconfigdir=%{_libdir}/pkgconfig find %{buildroot} -type f -name "*.la" -delete -print # Unversioned symlinks for plugins are pointless, and # break shared library packaging policy find %{buildroot}/%{_libdir}/graphviz/ -name "libgvplugin_*.so" -print -delete mkdir -p %{buildroot}/%{_docdir} mkdir -p %{buildroot}%{_datadir}/%{nmame} rm -f %{buildroot}/%{_libdir}/%{mname}/pkgIndex.tcl chmod -x %{buildroot}%{_datadir}/%{mname}/lefty/* mkdir -p %{buildroot}%{_libdir}/graphviz touch %{buildroot}%{_libdir}/graphviz/%{config_file} #Correct the path to the shared library for manfile in $(find %{buildroot} -name \*.man); do sed -i \ -e 's$%{_prefix}/lib/graphviz$%{_libdir}/%{mname}$g' \ $manfile done # There are no such binaries distributed by us rm -f %{buildroot}%{_mandir}/man1/mingle.1 %if "%{flavor}" == "addons" mkdir -p %{buildroot}/%{phpconf_dir} cat > %{buildroot}%{phpconf_dir}/gv.ini <