graphviz/graphviz.spec

267 lines
7.5 KiB
RPMSpec
Raw Normal View History

#
# spec file for package graphviz
#
# Copyright (c) 2014 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
# 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 http://bugs.opensuse.org/
#
#name of the plugin config file that dot creates
%define config_file config6
Name: graphviz
Version: 2.36.0
Release: 0
Summary: Graph Visualization Tools
License: EPL-1.0
Group: Applications/Productivity
Url: http://www.graphviz.org/
Source: http://www.graphviz.org/pub/graphviz/ARCHIVE/%{name}-%{version}.tar.gz
Source2: graphviz-rpmlintrc
Patch2: graphviz-fix-pkgIndex.patch
#PATCH-FIX-UPSTREAM There are too many type-punnings in the vmalloc sources
Patch3: graphviz-no_strict_aliasing.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bison
BuildRequires: fdupes
BuildRequires: flex
BuildRequires: freetype2-devel >= 2
BuildRequires: gcc-c++
BuildRequires: libXaw-devel
BuildRequires: libexpat-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: libstdc++-devel
BuildRequires: libtool
BuildRequires: zlib-devel
BuildRequires: pkgconfig(fontconfig)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(ice)
BuildRequires: pkgconfig(sm)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xext)
Requires(pre): /bin/cat
Requires(pre): /bin/rm
Recommends: graphviz-gd = %{version}
Recommends: graphviz-gnome = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%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).
%package devel
Summary: Graphiviz development package
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
Requires: expat
Requires: fontconfig-devel
Requires: freetype2-devel
Requires: glibc-devel
Requires: libjpeg-devel
Requires: libpng-devel
Requires: libstdc++-devel
Requires: libtool
Requires: perl
Requires: tcl-devel
Requires: tk-devel
Requires: zlib-devel
%description devel
The graphviz-devel package contains all that's necessary for developing
programs that use the graphviz libraries including man3 pages.
Note: If you need output in png format you also need to install
graphviz-gnome.
%prep
%setup -q
%patch2
%patch3
rm -f contrib/gprof2dot.awk
# Fix path in generated man pages
sed -e 's$@LIB_DIR@$%{_libdir}$g' tclpkg/gv/gv_doc_langs.tcl >tclpkg/gv/gv_doc_langs.tcl.new && mv tclpkg/gv/gv_doc_langs.tcl.new tclpkg/gv/gv_doc_langs.tcl
%build
autoreconf -fi
WARN_FLAGS="-W -Wall -Wno-unused-parameter -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith"
CFLAGS="%{optflags} $WARN_FLAGS"
%ifarch %ix86 x86_64
CFLAGS="$CFLAGS -ffast-math"
%endif
export CFLAGS="$CFLAGS"
export CPPFLAGS="%{optflags}"
%configure \
--with-x \
--with-mylibgd \
--disable-static \
--enable-ltdl-install=no \
--with-ipsepcola \
--without-ming \
--disable-io \
--disable-silent-rules \
--with-mylibgd=no \
--with-libgd=no
make %{?_smp_mflags} DESTDIR=%{buildroot}
%install
make install \
DESTDIR=%{buildroot} \
docdir=%{buildroot}%{_docdir}/%{name} \
pkgconfigdir=%{_libdir}/pkgconfig
find %{buildroot} -type f -name "*.la" -print0 | xargs -0 rm -f
mkdir -p %{buildroot}/%{_docdir}
mkdir -p %{buildroot}%{_datadir}/%{name}
rm -f %{buildroot}/%{_libdir}/%{name}/pkgIndex.tcl
chmod -x %{buildroot}%{_datadir}/%{name}/lefty/*
cp -a %{buildroot}%{_datadir}/%{name}/doc __doc
rm -rf %{buildroot}%{_datadir}/%{name}/doc
mkdir -p %{buildroot}%{_libdir}/graphviz
touch %{buildroot}%{_libdir}/graphviz/config
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d/
cat <<EOF >%{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}.conf
%{_libdir}/%{name}
%{_libdir}/%{name}/sharp
%{_libdir}/%{name}/java
%{_libdir}/%{name}/perl
%{_libdir}/%{name}/php
%{_libdir}/%{name}/ocaml
%{_libdir}/%{name}/python
%{_libdir}/%{name}/lua
%{_libdir}/%{name}/tcl
%{_libdir}/%{name}/guile
%{_libdir}/%{name}/ruby
EOF
#Correct the path to the shared library
for manfile in $(find %{buildroot} -name \*.man); do
sed -e 's$/usr/lib/graphviz$%{_libdir}/%{name}$g' $manfile > ${manfile}.new && mv ${manfile}.new ${manfile}
done
rm -f %{buildroot}%{_libdir}/graphviz/libgvplugin_gd.*
rm -f %{_libdir}/graphviz/libgvplugin_pango*
rm -f %{_libdir}/graphviz/libgvplugin_gdk_pixbuf*
rm -f %{_libdir}/graphviz/libgvplugin_gtk*
%post
/sbin/ldconfig
# run "dot -c" to generate plugin config %%{_libdir}/graphviz/config
dot -c
test -s %{_libdir}/graphviz/%{config_file} || echo "%{_libdir}/graphviz/%{config_file} doesn't exist! Check installation."
%postun
/sbin/ldconfig
if ! test -x $RPM_INSTALL_PREFIX0/bin/dot; then rm -f $RPM_INSTALL_PREFIX0/%{_lib}/graphviz/%{config_file}; fi
%files
%defattr(-,root,root)
%doc doc/FAQ.html AUTHORS COPYING README NEWS ChangeLog
%{_bindir}/acyclic
%{_bindir}/bcomps
%{_bindir}/ccomps
%{_bindir}/circo
%{_bindir}/cluster
%{_bindir}/dijkstra
%{_bindir}/dot
%{_bindir}/dot2gxl
%{_bindir}/dot_builtins
%{_bindir}/dotty
%{_bindir}/fdp
%{_bindir}/gc
%{_bindir}/gml2gv
%{_bindir}/graphml2gv
%{_bindir}/gv2gml
%{_bindir}/gv2gxl
%{_bindir}/gvcolor
%{_bindir}/gvgen
%{_bindir}/gvmap
%{_bindir}/gvmap.sh
%{_bindir}/gvpack
%{_bindir}/gvpr
%{_bindir}/gxl2dot
%{_bindir}/gxl2gv
%{_bindir}/lefty
%{_bindir}/lneato
%{_bindir}/mm2gv
%{_bindir}/neato
%{_bindir}/nop
%{_bindir}/osage
%{_bindir}/patchwork
%{_bindir}/prune
%{_bindir}/sccmap
%{_bindir}/sfdp
%{_bindir}/tred
%{_bindir}/twopi
%{_bindir}/unflatten
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/lefty
%{_datadir}/%{name}/graphs
%dir %{_datadir}/%{name}/gvpr
%{_datadir}/%{name}/gvpr/addranks
%{_datadir}/%{name}/gvpr/addrings
%{_datadir}/%{name}/gvpr/anon
%{_datadir}/%{name}/gvpr/attr
%{_datadir}/%{name}/gvpr/bb
%{_datadir}/%{name}/gvpr/bbox
%{_datadir}/%{name}/gvpr/cliptree
%{_datadir}/%{name}/gvpr/col
%{_datadir}/%{name}/gvpr/collapse
%{_datadir}/%{name}/gvpr/color
%{_datadir}/%{name}/gvpr/dechain
%{_datadir}/%{name}/gvpr/deghist
%{_datadir}/%{name}/gvpr/deledges
%{_datadir}/%{name}/gvpr/delmulti
%{_datadir}/%{name}/gvpr/delnodes
%{_datadir}/%{name}/gvpr/depath
%{_datadir}/%{name}/gvpr/dijkstra
%{_datadir}/%{name}/gvpr/flatten
%{_datadir}/%{name}/gvpr/get-layers-list
%{_datadir}/%{name}/gvpr/group
%{_datadir}/%{name}/gvpr/indent
%{_datadir}/%{name}/gvpr/knbhd
%{_datadir}/%{name}/gvpr/maxdeg
%{_datadir}/%{name}/gvpr/path
%{_datadir}/%{name}/gvpr/rotate
%{_datadir}/%{name}/gvpr/scale
%{_datadir}/%{name}/gvpr/scalexy
%{_datadir}/%{name}/gvpr/span
%{_datadir}/%{name}/gvpr/topon
%{_datadir}/%{name}/gvpr/treetoclust
%{_datadir}/%{name}/gvpr/chkclusters
%{_datadir}/%{name}/gvpr/cycle
%doc %{_mandir}/man1/*.1*
%doc %{_mandir}/man7/*.7*
%dir %{_libdir}/%{name}
%{_libdir}/*.so.*
%{_libdir}/graphviz/*.so*
%config %{_sysconfdir}/ld.so.conf.d/graphviz.conf
%ghost %{_libdir}/graphviz/config
%files devel
%defattr(-,root,root)
%{_includedir}/graphviz
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_mandir}/man3/*.3.gz
%changelog