File graphviz-smyrna.spec of Package graphviz

# spec file for package graphviz-smyrna
# Copyright (c) 2016 SUSE LINUX 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

%define mname graphviz

Name:           graphviz-smyrna
Version:        2.38.0
Release:        0
Summary:        Glut based graph viewer
License:        EPL-1.0
Group:          Productivity/Graphics/Visualization/Graph
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
Patch4:         graphviz-array_overflow.patch
#PATCH-FIX-UPSTREAM add flags to also link against libGLU and libGL
Patch10:        graphviz-smyrna-link_against_glu.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  bison
BuildRequires:  fdupes
BuildRequires:  flex
BuildRequires:  freeglut-devel
BuildRequires:  freetype2-devel >= 2
BuildRequires:  gcc-c++
BuildRequires:  libXaw-devel
BuildRequires:  libexpat-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  libqt4-devel
BuildRequires:  libstdc++-devel
BuildRequires:  libtool
BuildRequires:  zlib-devel
%if 0%suse_version > 1220
BuildRequires:  freeglut-devel
BuildRequires:  glu-devel
BuildRequires:  gtkglext-devel
BuildRequires:  gts-devel
BuildRequires:  libglade2-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 = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

This is the graph editor included with graphviz, packaged
separately to avoid cycles in the build of the graphviz

%setup -q -n %{mname}-%{version}
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/ && mv tclpkg/gv/ tclpkg/gv/gv_doc_langs.tcl

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"

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}

make install \
	DESTDIR=%{buildroot} \
	docdir=%{buildroot}%{_docdir}/%{mname} \

find %{buildroot} -type f -name "*.la" -print0 | xargs -0 rm -f

mkdir -p %{buildroot}/%{_docdir}
mkdir -p %{buildroot}%{_datadir}/%{mname}

rm -f %{buildroot}/%{_libdir}/%{mname}/pkgIndex.tcl

cp -a %{buildroot}%{_datadir}/%{mname}/doc __doc
rm -rf %{buildroot}%{_datadir}/%{mname}/doc

rm -rf %{buildroot}%{_libdir}

mv %{buildroot}/%{_mandir}/man1/smyrna.1 /tmp/smyrna.1
rm -f %{buildroot}/%{_mandir}/man1/*
rm -rf %{buildroot}/%{_mandir}/man[37]
mv /tmp/smyrna.1 %{buildroot}/%{_mandir}/man1/smyrna.1

mv %{buildroot}/%{_bindir}/smyrna /tmp/smyrna
rm -f %{buildroot}/%{_bindir}/*
mv /tmp/smyrna %{buildroot}/%{_bindir}/smyrna

rm -rf %{buildroot}%{_datadir}/%{mname}/graphs
rm -rf %{buildroot}%{_datadir}/%{mname}/examples
rm -rf %{buildroot}%{_datadir}/%{mname}/gvedit
rm -rf %{buildroot}%{_datadir}/%{mname}/gvpr
rm -rf %{buildroot}%{_datadir}/%{mname}/lefty
rm -rf %{buildroot}%{_includedir}/%{mname}

%attr(755,root,root) %{_bindir}/smyrna
%dir %{_datadir}/%{mname}
%doc %{_mandir}/man1/*.1*

openSUSE Build Service is sponsored by