Added support for python3

This commit is contained in:
Jaroslav Škarvada 2018-05-02 18:25:52 +02:00
parent 43bd022feb
commit 2ec89c2f7b

View File

@ -49,7 +49,7 @@
Name: graphviz Name: graphviz
Summary: Graph Visualization Tools Summary: Graph Visualization Tools
Version: 2.40.1 Version: 2.40.1
Release: 23%{?dist} Release: 24%{?dist}
License: EPL License: EPL
URL: http://www.graphviz.org/ URL: http://www.graphviz.org/
Source0: http://www.graphviz.org/pub/graphviz/ARCHIVE/%{name}-%{version}.tar.gz Source0: http://www.graphviz.org/pub/graphviz/ARCHIVE/%{name}-%{version}.tar.gz
@ -57,7 +57,7 @@ Patch0: graphviz-2.40.1-visio.patch
BuildRequires: zlib-devel, libpng-devel, libjpeg-devel, expat-devel, freetype-devel >= 2 BuildRequires: zlib-devel, libpng-devel, libjpeg-devel, expat-devel, freetype-devel >= 2
BuildRequires: ksh, bison, m4, flex, tk-devel, tcl-devel >= 8.3, swig BuildRequires: ksh, bison, m4, flex, tk-devel, tcl-devel >= 8.3, swig
BuildRequires: fontconfig-devel, libtool-ltdl-devel, ruby-devel, ruby, guile-devel, python2-devel BuildRequires: fontconfig-devel, libtool-ltdl-devel, ruby-devel, ruby, guile-devel, python2-devel
BuildRequires: libXaw-devel, libSM-devel, libXext-devel, java-devel BuildRequires: python3-devel, libXaw-devel, libSM-devel, libXext-devel, java-devel
BuildRequires: cairo-devel >= 1.1.10, pango-devel, gmp-devel, lua-devel, gtk2-devel BuildRequires: cairo-devel >= 1.1.10, pango-devel, gmp-devel, lua-devel, gtk2-devel
BuildRequires: gd-devel, perl-devel, swig >= 1.3.33, automake, autoconf, libtool, qpdf BuildRequires: gd-devel, perl-devel, swig >= 1.3.33, automake, autoconf, libtool, qpdf
# Temporary workaound for perl(Carp) not pulled # Temporary workaound for perl(Carp) not pulled
@ -213,6 +213,16 @@ Obsoletes: python2-%{name} < %{version}-%{release}
%description python2 %description python2
Python extension for graphviz. Python extension for graphviz.
%package python3
Summary: Python 3 extension for graphviz
Requires: %{name} = %{version}-%{release}
# Manually add provides that would be generated automatically if .egg-info was present
Provides: python3dist(gv) = %{version}
Provides: python%{python3_version}dist(gv) = %{version}
%description python3
Python 3 extension for graphviz.
%if %{ARRRR} %if %{ARRRR}
%package R %package R
Summary: R extension for graphviz Summary: R extension for graphviz
@ -291,9 +301,20 @@ export CPPFLAGS=-I`ruby -e "puts File.join(RbConfig::CONFIG['includedir'], RbCon
--without-qt \ --without-qt \
%endif %endif
# python3
cp -a tclpkg/gv tclpkg/gv.python3
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fno-strict-overflow %{?FFSTORE}" \ make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fno-strict-overflow %{?FFSTORE}" \
CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fno-strict-overflow %{?FFSTORE}" CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fno-strict-overflow %{?FFSTORE}"
# python3
pushd tclpkg/gv.python3
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fno-strict-overflow %{?FFSTORE}" \
CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fno-strict-overflow %{?FFSTORE}" \
PYTHON_INCLUDES=-I/usr/include/python%{python3_version}m PYTHON_LIBS="-lpython%{python3_version}m" \
PYTHON_INSTALL_DIR=%{python3_sitearch} libgv_python.la
popd
%install %install
rm -rf %{buildroot} rm -rf %{buildroot}
make DESTDIR=%{buildroot} \ make DESTDIR=%{buildroot} \
@ -342,6 +363,13 @@ do
mv -f $f.pdf.$$ $f.pdf mv -f $f.pdf.$$ $f.pdf
fi fi
done done
popd
# python3
pushd tclpkg/gv.python3
install -pD .libs/libgv_python.so %{buildroot}%{python3_sitearch}/_gv.so
install -p gv.py %{buildroot}%{python3_sitearch}/gv.py
popd
# Ghost plugins config # Ghost plugins config
touch %{buildroot}%{_libdir}/graphviz/config%{pluginsver} touch %{buildroot}%{_libdir}/graphviz/config%{pluginsver}
@ -494,7 +522,11 @@ php --no-php-ini \
%files python2 %files python2
%{_libdir}/graphviz/python/ %{_libdir}/graphviz/python/
%{_libdir}/python*/* %{python2_sitearch}/*
%{_mandir}/man3/gv.3python*
%files python3
%{python3_sitearch}/*
%{_mandir}/man3/gv.3python* %{_mandir}/man3/gv.3python*
%if %{ARRRR} %if %{ARRRR}
@ -522,6 +554,9 @@ php --no-php-ini \
%{_mandir}/man3/*.3tcl* %{_mandir}/man3/*.3tcl*
%changelog %changelog
* Wed May 2 2018 Jaroslav Škarvada <jskarvad@redhat.com> - 2.40.1-24
- Added support for python3
* Thu Apr 26 2018 Richard W.M. Jones <rjones@redhat.com> - 2.40.1-23 * Thu Apr 26 2018 Richard W.M. Jones <rjones@redhat.com> - 2.40.1-23
- OCaml 4.07.0-beta2 rebuild. - OCaml 4.07.0-beta2 rebuild.