graphviz/graphviz.spec

356 lines
9.5 KiB
RPMSpec
Raw Normal View History

2019-12-31 15:12:54 +08:00
%bcond_with php
%if "%{php_version}" < "5.6"
%global ini_name %{name}.ini
%else
%global ini_name 40-%{name}.ini
%endif
%global pluginsver 6
%global php_extdir %(php-config --extension-dir 2>/dev/null || echo %{_libdir}/php4)
%ifarch loongarch64
%global OCAML 0
%else
%global OCAML 1
%endif
2019-12-31 15:12:54 +08:00
Name: graphviz
2023-09-07 09:03:17 +08:00
Version: 8.1.0
Release: 1
2019-12-31 15:12:54 +08:00
Summary: Graph Visualization Tools
2021-12-27 18:17:14 +08:00
License: EPL-1.0
2019-12-31 15:12:54 +08:00
URL: http://www.graphviz.org/
2020-07-24 09:56:51 +08:00
Source0: https://gitlab.com/graphviz/graphviz/-/archive/%{version}/graphviz-%{version}.tar.gz
2019-12-31 15:12:54 +08:00
2023-09-07 09:03:17 +08:00
Patch6000: backport-graphviz-4.0.0-gvpack-neato-static.patch
2021-05-11 14:36:12 +08:00
2021-05-26 18:20:47 +08:00
BuildRequires: gcc-g++
BuildRequires: ksh bison m4 flex ruby automake perl-Carp autoconf libtool qpdf urw-base35-fonts, perl-ExtUtils-Embed, perl-generators, librsvg2-devel swig >= 1.3.33
2019-12-31 15:12:54 +08:00
BuildRequires: zlib-devel libpng-devel libjpeg-devel expat-devel tk-devel fontconfig-devel libtool-ltdl-devel ruby-devel guile-devel freetype-devel >= 2 tcl-devel >= 8.3
BuildRequires: python3-devel libXaw-devel libSM-devel libXext-devel java-devel pango-devel gmp-devel lua-devel gtk2-devel cairo-devel >= 1.1.10
2021-12-27 18:17:14 +08:00
BuildRequires: ghostscript libgs-devel gd-devel perl-devel chrpath
2019-12-31 15:12:54 +08:00
%if %{OCAML}
BuildRequires: ocaml
%endif
2019-12-31 15:12:54 +08:00
%if %{with php}
BuildRequires: php-devel
%endif
Requires: urw-base35-fonts xorg-x11-fonts-ISO8859-1-100dpi guile glibc
Requires(post): glibc
Requires(postun): glibc
%description
Graphviz is open source graph visualization software. Graph visualization is a way of representing structural
information as diagrams of abstract graphs and networks. It has important applications in networking, bioinformatics,
software engineering, database and web design, machine learning, and in visual interfaces for other technical domains.
%package devel
Summary: Development headers and libraries for interfacing to the graphviz
Requires: %{name} = %{version}-%{release} pkgconfig
%description devel
Header files for using the graphviz libraries. The
libdhcpctl and libomapi static libraries are also included in this package.
%package docs
Summary: Documentation files for graphviz
%description docs
The docs package contains documentation files.
2021-12-27 18:17:14 +08:00
%package gd
Summary: Graphviz plugin for renderers based on gd
Requires: %{name} = %{version}-%{release}
Requires(post): %{_bindir}/dot /sbin/ldconfig
Requires(postun): %{_bindir}/dot /sbin/ldconfig
%description gd
Graphviz plugin for renderers based on gd. (Unless you absolutely have to use
GIF, you are recommended to use the PNG format instead because of the better
quality anti-aliased lines provided by the cairo+pango based renderer.)
%package graphs
Summary: Demo graphs for graphviz
%description graphs
Some demo graphs for graphviz.
%package guile
Summary: Guile extension for graphviz
Requires: %{name} = %{version}-%{release} guile
%description guile
Guile extension for graphviz.
2019-12-31 15:12:54 +08:00
%package java
Summary: Java extension for graphviz
Requires: %{name} = %{version}-%{release}
%description java
Java extension for graphviz.
%package lua
Summary: Lua extension for graphviz
Requires: %{name} = %{version}-%{release} lua
%description lua
Lua extension for graphviz.
%if %{OCAML}
2019-12-31 15:12:54 +08:00
%package ocaml
Summary: Ocaml extension for graphviz
Requires: %{name} = %{version}-%{release} ocaml
%description ocaml
Ocaml extension for graphviz.
%endif
2019-12-31 15:12:54 +08:00
%package perl
Summary: Perl extension for graphviz
Requires: %{name} = %{version}-%{release} perl
%description perl
Perl extension for graphviz.
%package ruby
Summary: Ruby extension for graphviz
Requires: %{name} = %{version}-%{release} ruby
%description ruby
Ruby extension for graphviz.
%ifnarch loongarch64
2019-12-31 15:12:54 +08:00
%package tcl
Summary: Tcl extension & tools for graphviz
Requires: %{name} = %{version}-%{release} tcl >= 8.3 tk
%description tcl
Various tcl packages (extensions) for the graphviz tools.
%endif
2019-12-31 15:12:54 +08:00
%if %{with php}
%package php
Summary: PHP extension for graphviz
Requires: %{name} = %{version}-%{release} php-common php
%description php
PHP extension for graphviz.
%endif
%package python3
Summary: Python 3 extension for graphviz
Requires: %{name} = %{version}-%{release}
2021-12-27 18:17:14 +08:00
Provides: python3dist(gv) = %{version} %{python3_version}dist(gv) = %{version}
2019-12-31 15:12:54 +08:00
%description python3
Python 3 extension for graphviz.
%prep
%autosetup -n graphviz-%{version} -p1
find -type f -regex '.*\.\(c\|h\)$' -exec chmod a-x {} ';'
%build
./autogen.sh
sed -i '/JavaVM.framework/!s/JAVA_INCLUDES=/JAVA_INCLUDES=\"_MY_JAVA_INCLUDES_\"/g' configure
sed -i 's|_MY_JAVA_INCLUDES_|-I%{java_home}/include/ -I%{java_home}/include/linux/|g' configure
sed -i -e 's|expand(|expand(RbConfig::|' -e 's|sitearchdir|vendorarchdir|' config/config_ruby.rb
export CPPFLAGS=-I`ruby -e "puts File.join(RbConfig::CONFIG['includedir'], RbConfig::CONFIG['sitearch'])" || echo /dev/null`
%configure --with-x --disable-static --disable-dependency-tracking \
--without-mylibgd --with-ipsepcola --with-pangocairo \
--with-gdk-pixbuf --with-visio --disable-silent-rules \
--without-lasi --without-gts --disable-sharp --without-ming \
%if !%{OCAML}
--disable-ocaml \
%endif
2019-12-31 15:12:54 +08:00
--disable-r --without-devil --without-qt
2021-12-27 18:17:14 +08:00
# drop rpath
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
2020-06-23 13:16:20 +08:00
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fno-strict-overflow %{?FFSTORE}" \
2019-12-31 15:12:54 +08:00
CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fno-strict-overflow %{?FFSTORE}" \
2020-06-23 13:16:20 +08:00
PYTHON_INCLUDES=`python3-config --includes` PYTHON_LIBS=`python3-config --libs` \
2019-12-31 15:12:54 +08:00
PYTHON_INSTALL_DIR=%{python3_sitearch} PYTHON=%{__python3}
%install
2021-12-27 18:17:14 +08:00
rm -rf %{buildroot}
2023-09-07 09:03:17 +08:00
%make_install docdir=%{_docdir}/%{name} \
pkgconfigdir=%{_libdir}/pkgconfig
2019-12-31 15:12:54 +08:00
%delete_la
%if %{with php}
%{__mkdir_p} %{buildroot}%{_sysconfdir}/php.d
%{__cat} << __EOF__ > %{buildroot}%{_sysconfdir}/php.d/%{ini_name}
; Enable %{name} extension module
extension=gv.so
__EOF__
%endif
find $RPM_BUILD_ROOT%{_datadir}/%{name}/demo -type f -exec chmod a-x {} ';'
# python 3
pushd tclpkg/gv
2020-10-29 16:40:38 +08:00
install -pD .libs/libgv_python3.so $RPM_BUILD_ROOT%{python3_sitearch}/_gv.so
2019-12-31 15:12:54 +08:00
install -p gv.py $RPM_BUILD_ROOT%{python3_sitearch}/gv.py
popd
rm -rf $RPM_BUILD_ROOT%{_libdir}/graphviz/python
2021-12-27 18:17:14 +08:00
chrpath -d $RPM_BUILD_ROOT%{_bindir}/gvpack
mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
echo "%{_libdir}/graphviz" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf
2019-12-31 15:12:54 +08:00
touch $RPM_BUILD_ROOT%{_libdir}/graphviz/config%{pluginsver}
%ifarch loongarch64
mkdir -p $RPM_BUILD_ROOT/%{_libdir}/lua/5.4/
mv $RPM_BUILD_ROOT/usr/lib/lua/5.4/gv.so $RPM_BUILD_ROOT/usr/lib64/lua/5.4/gv.so
%endif
2019-12-31 15:12:54 +08:00
%check
%if %{with php}
LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir} \
php --no-php-ini --define extension_dir=$RPM_BUILD_ROOT%{_libdir}/graphviz/php/ \
--define extension=libgv_php.so --modules | grep gv
%endif
%pre
%preun
%post
/sbin/ldconfig
%{_bindir}/dot -c
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
2023-09-07 09:03:17 +08:00
%doc %{_docdir}/%{name}
2019-12-31 15:12:54 +08:00
%{_bindir}/*
%dir %{_libdir}/graphviz
%{_libdir}/*.so.*
%{_libdir}/graphviz/*.so.*
%dir %{_datadir}/graphviz
%{_datadir}/graphviz/
%ghost %{_libdir}/graphviz/config%{pluginsver}
%exclude %{_bindir}/dot_builtins
2021-12-27 18:17:14 +08:00
%config(noreplace) /etc/ld.so.conf.d/*
2019-12-31 15:12:54 +08:00
%if %{with php}
%files php
2021-12-27 18:17:14 +08:00
%config(noreplace)
%{_sysconfdir}/php.d/%{ini_name}
2019-12-31 15:12:54 +08:00
%{_libdir}/graphviz/php/
%{php_extdir}/gv.so
%{_datadir}/php*/*
%endif
2021-12-27 18:17:14 +08:00
%exclude %{_libdir}/graphviz/*/*
%exclude %{_libdir}/graphviz/libgvplugin_gd.*
2023-09-07 09:03:17 +08:00
2019-12-31 15:12:54 +08:00
%files devel
%{_includedir}/graphviz
%{_libdir}/*.so
%{_libdir}/graphviz/*.so
%{_libdir}/pkgconfig/*.pc
2023-09-07 09:03:17 +08:00
2019-12-31 15:12:54 +08:00
%files docs
%defattr(644,root,root)
2023-09-07 09:03:17 +08:00
%doc %{_docdir}/%{name}/*.html
%doc %{_docdir}/%{name}/*.pdf
2019-12-31 15:12:54 +08:00
%doc %{_datadir}/%{name}/demo
%{_mandir}/man1/*
%{_mandir}/man3/*
%{_mandir}/man7/*
2023-09-07 09:03:17 +08:00
2021-12-27 18:17:14 +08:00
%files gd
%{_libdir}/graphviz/libgvplugin_gd.so.*
%files graphs
%dir %{_datadir}/graphviz
%{_datadir}/graphviz/graphs
%files guile
%{_libdir}/graphviz/guile/
2019-12-31 15:12:54 +08:00
%files java
%{_libdir}/graphviz/java/
%files lua
%{_libdir}/graphviz/lua/
%{_libdir}/lua*/*
%if %{OCAML}
2019-12-31 15:12:54 +08:00
%files ocaml
%{_libdir}/graphviz/ocaml/
%endif
2019-12-31 15:12:54 +08:00
%files perl
%{_libdir}/graphviz/perl/
%{_libdir}/perl*/*
%files python3
%{python3_sitearch}/*
2020-07-24 14:22:30 +08:00
%{_libdir}/graphviz/python3/*
2019-12-31 15:12:54 +08:00
%files ruby
%{_libdir}/graphviz/ruby/
%{_libdir}/*ruby*/*
%ifnarch loongarch64
2019-12-31 15:12:54 +08:00
%files tcl
%{_libdir}/graphviz/tcl/
%{_libdir}/tcl*/*
%endif
2019-12-31 15:12:54 +08:00
%changelog
2023-09-07 09:03:17 +08:00
* Thu Sep 07 2023 yaoxin <yao_xin001@hoperun.com> - 8.1.0-1
- Update to 8.1.0
* Mon Nov 21 2022 huajingyun <huajingyun@loongson.cn> - 2.48.0-3
- add loongarch support
2022-06-08 06:11:22 +00:00
* Sat Jan 8 2022 wuchaochao <wuchaochao4@huawei.com> - 2.48.0-2
2022-01-08 18:04:54 +08:00
- delete redundant Provides and Obsoletes
2021-12-27 18:17:14 +08:00
* Wed Dec 15 2021 wuchaochao <wuchaochao4@huawei.com> - 2.48.0-1
- update version to 2.48.0
2021-05-26 18:20:47 +08:00
* Wed May 26 2021 liuyumeng <liuyumeng5@huawei.com> -2.44.1-4
- Add a BuildRequires for gcc-g++
2021-05-11 14:36:12 +08:00
* Tue May 11 2021 wangkerong <wangkerong@huawei.com> - 2.44.1-3
- Type:CVE
- ID:CVE-2020-18032
- SUG:NA
- DESC:fix cve-2020-18032
2020-10-29 16:40:38 +08:00
* Wed Oct 21 2020 jinzhimin<jinzhimin2@huawei.com> - 2.44.1-2
- remove graphviz-python2 subpackage
2020-07-24 09:56:51 +08:00
* Fri Jul 24 2020 hanhui <hanhui15@huawei.com> - 2.44.1-1
- update to 2.44.1
2020-06-23 13:16:20 +08:00
* Tue Jun 23 2020 xinghe <xinghe1@huawei.com> - 2.40.1-39
- Type:bugfix
- ID:NA
- SUG:NA
2020-06-23 13:27:32 +08:00
- DESC:Repair compilation failure
2020-06-23 13:16:20 +08:00
2019-12-31 15:12:54 +08:00
* Tue Dec 31 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.40.1-38
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:optimization the spec
* Thu Sep 19 2019 hufeng <solar.hu@huawei.com> - 2.40.1-37
2020-07-24 09:56:51 +08:00
-Create spec