File graphviz.spec of Package graphviz

#
# spec file for package graphviz (Version 2.12)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

Name:           graphviz
BuildRequires:  libexpat-devel libjpeg-devel libpng-devel zlib-devel
BuildRequires:  freetype2-devel >= 2 gcc-c++ ksh libstdc++-devel
BuildRequires:  bison flex glib2-devel xorg-x11-devel
BuildRequires:  xorg-x11-libICE-devel xorg-x11-libSM-devel xorg-x11-libXpm-devel
BuildRequires:  xorg-x11-libX11-devel xorg-x11-libXext-devel xorg-x11-libXmu-devel xorg-x11-libXt-devel
Version:        2.12
Release:        35
Autoreqprov:    on
Summary:        Graph Visualization Tools
Group:          Productivity/Graphics/Visualization/Graph
Source:         http://www.graphviz.org/pub/graphviz/ARCHIVE/%{name}-%{version}.tar.bz2
Patch0:         graphviz-fix-pkgIndex.patch
Patch1:         graphviz-aliasing-fixes.patch
Patch3:         graphviz-fix_swig_template.patch
Patch4:         graphviz-neato_splines.patch
Patch7:         graphviz-strcmp_fix.patch
# This fix will be in 2.13
Patch8:         graphviz-2.11-php_check.patch
Patch9:         graphviz-no_libtool_patching.patch
Patch10:        graphviz-fix_manpages.patch
Patch11:        graphviz-gv_aliasing.patch
Patch12:        graphviz-codecleanup.patch
URL:            http://www.graphviz.org/
License:        IBM Public License
Prefix:         /usr
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
PreReq:         /bin/cat

%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).



Authors:
--------
    David Dobkin <dpd@cs.princeton.edu>
    John Ellson  <ellson@graphviz.org>
    Emden Gansner <erg@research.att.com>
    Eleftherios Koutsofios <ek@research.att.com>
    Stephen North <north@research.att.com>
    Kiem-Phong Vo <kpv@research.att.com>
    Gordon Woodhull <gmcw@worldnet.att.net>

%package devel
Group:          Development/Libraries/C and C++
Summary:        Graphiviz development package
Requires:       %{name} = %{version}
Requires:       glibc-devel tcl-devel fontconfig-devel expat freetype2-devel 
Requires:       libjpeg-devel libpng-devel zlib-devel libtool perl 
Requires:       libstdc++-devel tk-devel

%description devel
The graphviz-devel package contains all that's necessary for developing
programs that use the graphviz libraries including man3 pages.



Authors:
--------
    David Dobkin <dpd@cs.princeton.edu>
    John Ellson  <ellson@graphviz.org>
    Emden Gansner <erg@research.att.com>
    Eleftherios Koutsofios <ek@research.att.com>
    Stephen North <north@research.att.com>
    Kiem-Phong Vo <kpv@research.att.com>
    Gordon Woodhull <gmcw@worldnet.att.net>

%prep
%setup -q
%patch
%patch1
%patch3
%patch4
%patch7
%patch8
%patch9
%patch10
%patch11
%patch12
# 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
./autogen.sh
touch tclpkg/gv/gv.i
WARN_FLAGS="-W -Wall -Wno-unused-parameter -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith"
CFLAGS="$RPM_OPT_FLAGS $WARN_FLAGS"
%ifarch %ix86 x86_64
CFLAGS="$CFLAGS -ffast-math"
%endif
CC=gcc
RANLIB=:
export CC RANLIB
export CFLAGS="$CFLAGS"
export CPPFLAGS="%optflags"
./configure \
      --prefix=%{_prefix} \
      --bindir=%{_bindir} \
      --libdir=%{_libdir} \
      --includedir=%{_includedir} \
      --datadir=%{_datadir} \
      --mandir=%{_mandir} \
      --with-x \
      --with-mylibgd \
      --disable-static \
      --disable-dependency-tracking \
      --with-ipsepcola \
      --without-ming \
      --disable-io
make DESTDIR=%buildroot

%install
make install \
	DESTDIR=%{buildroot} \
	docdir=%{buildroot}%{_docdir}/%{name} \
	pkgconfigdir=%{_libdir}/pkgconfig
find ${RPM_BUILD_ROOT} -type f -name "*.la" -exec rm -f {} ';'
#rm -rf %{buildroot}/usr/%{_lib}/pkgconfig  # ?
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}/usr/lib/graphviz
touch %{buildroot}/usr/lib/graphviz/config
mkdir -p %{buildroot}/etc/ld.so.conf.d/
cat <<EOF >%{buildroot}/etc/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

%clean
rm -rf %buildroot

%post
# run "dot -c" to generate plugin config in %{_libdir}/graphviz/config
%{_bindir}/dot -c
test -s %{_libdir}/graphviz/config || exit 1
%run_ldconfig
# if there is no dot after everything else is done, the remove config

%postun
if ! test -x $RPM_INSTALL_PREFIX0/bin/dot; then rm -f $RPM_INSTALL_PREFIX0/%{_lib}/graphviz/config; fi

%files
%defattr(-,root,root)
#%doc %{_docdir}/graphviz/
%doc doc/FAQ.html AUTHORS COPYING README NEWS ChangeLog
%attr(755,root,root) %{_bindir}/*
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/lefty
%{_datadir}/%{name}/graphs
%{_mandir}/man1/*.1*
%dir %{_libdir}/%{name}
%dir %{_prefix}/lib/%{name}
%{_libdir}/*.so.*
%{_libdir}/graphviz/*.so.*
/etc/ld.so.conf.d/graphviz.conf
%ghost /usr/lib/graphviz/config
%exclude %{_libdir}/graphviz/*/*
%exclude %{_libdir}/graphviz/libgvplugin_gd.*

%files devel
%defattr(-,root,root)
%{_includedir}/graphviz
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_mandir}/man3/*.3.gz
%exclude %{_libdir}/graphviz/*/*
%exclude %{_libdir}/graphviz/libgvplugin*
%exclude %{_libdir}/graphviz/*.so

%changelog
* Mon Aug 13 2007 - pth@suse.de
- lib/sfio/sfhdr.h(SFSETLOCALE): fix test for null pointer.
- use -fno-strict-aliasing for gv_php
* Fri May 11 2007 - ro@suse.de
- added get_release_number.sh to sync rel-number between
  graphviz and graphviz-plugins
* Thu May 10 2007 - ro@suse.de
- split off plugins to separate specfile to break build cycles
* Tue May 08 2007 - pth@suse.de
- Update to 2.12
  - PostScript output had an extraneous '%%' character on the first line,
  which would cause printing to fail.
  - Text handling, during both sizing and layout, incorrectly handled
  empty lines such as label="\nabc".
  - HTML-like tables had been changed to use too much vertical space,
  to possibly use the wrong font in calculating the height of a line,
  and to use the wrong offset when moving the baseline from one line to
  the next.
  - dot - New pango+cairo renderer plugin (was in separate graphviz-cairo tree).
      -- -Tpng now uses cairo   (-Tpng:gd for old gd based renderer)
      -- -Tpdf now available
      -- -Tps:cairo now available (-Tps is a direct ps renderer not based on
  cairo)
      -- -Tsvg:cairo now available (-Tsvg is a direct svg renderer not based
  on cairo)
      -- -Txlib now available -- "dot -Tx11 foo.dot"  watches foo.dot with
  inotify and updates
      -- -Tgtk now available -- eventually to provide a graph editing capability
          - not fully working
      -- -Tswf "Flash" now available using the ming library. Currently has
  incomplete font support and not yet in Fedora rpms because ming not
  yet available as rpm.
  - remove hard gd dependencies from dot.  gd renderers now provided
  as optional plugin.   Deprecated, but required for -Tjpg, -Tgif and -Tvrml.
  - gvpr - Add kindOf function, plus functions to set and get default values
  - dot - Implement esep attribute to allow graph to specify room
  around nodes for spline routing.
  - neato - add vpsc library and DIGCOLA
  - neato - add IPSEPCOLA additions from Tim Dwyer
  - move: -Tps, -Tfig, -Tsvg, -Timap/ismap/cmap/cmapx, -Tdot/xdot,
  from codegens to a "core" plugin.
  - dot - new usershape plugin mechanism potentially supporting
  a wider range of input shape format -> output format combinations.
  display on changes
  - dot - new -O switch to automatically generate output file
  names based on the input filename and the -T value.
  e.g.  "dot -Tpng -O *.dot"
  Also works for case of multiple graphs in a single input file.
  - add support for "Brewer" color nameset
  - move reusable .so libraries to $PREFIX/lib per frequent request
  from Debian community.   Plugin .so's remain in $PREFIX/lib/graphviz.
  - (POTENTIAL INCOMPATIBILITY) The default input scaling, in the
  absence of a "-s" switch, has been changed from inches to points.
  The new behavior of "neato" is equivalent to "neato -s72".
  The old behavior can be restored with "neato -s1".
  The purpose of this change is to avoid a Frequently-Made-Mistake
  when using "neato -n" to process a previously generated layout.
  Previously it was necessary to use "neato -n -s72", but with this
  change the default matches dot's output and the "-s72" is not required.
  - Added pseudo layout engines: "dot -Knop" and dot -Knop1" equivalent
  to "neato -n"
  - Added pseodo layout engine: "dot -Knop2" equivalent to "neato -n2"
  - Add support for color namespaces; add Brewer color data
  - Add support for simulated duplex edges using parallel edges:
  head arrow takes first color, tail arrow takes second color.
  - Add a small pad region around graph renderings to allow for finite
  penwidths at the drawing edges
  - Add protonode(g) and E=protoedge(g) functions to simplify language
  bindings.
  - Add special purpose code to deal with html labels from language
  bindings.
- Split off language support into subpackages.
- build php,ruby,C#,python,guile and java support in addition to tcl
- swig >= 1.3.21 differentiates between php4 and php5, so adapt
  configure test.
- Don't move tcl libraries to _libdir but instead add the graphviz
  sublibrary paths via /etc/ld.so.conf.d
- Use SONAMEs to generate pkgIndex.tcl. That way tcl can actually
  load the libraries via 'package require'
- Don't compare pointer with string literal.
* Thu May 03 2007 - prusnak@suse.cz
- changed expat to libexpat-devel in [Build]Requires
* Thu Mar 29 2007 - aj@suse.de
- Add bison to BuildRequires.
* Fri Aug 11 2006 - pth@suse.de
- Adapt to new X11 paths.
* Mon Apr 03 2006 - pnemec@suse.cz
- add pkgconfig files to devel package
* Sun Feb 19 2006 - aj@suse.de
- Reduce BuildRequires.
* Thu Feb 09 2006 - pth@suse.de
- Fix segfault in neato when using splines (#144275)
* Fri Feb 03 2006 - pth@suse.de
- Fix swig template to include declaration.
- Fix BuildRequires
- Fix dependencies for -devel package
* Thu Nov 24 2005 - agruen@suse.de
- Add missing plugin config file.
- Fix gcc aliasing bugs.
* Mon Aug 29 2005 - agruen@suse.de
- Update to version 2.6: numerous bugfixes.
* Tue Aug 09 2005 - agruen@suse.de
- fix-pkgIndex.diff: Fix tcl library search for "package require
  Tkspline" and similar statements by (a) moving the tcl/tk
  libraries from _libdir/graphviz/ to _libdir/, and removing
  path names from library names in pkgIndex.tcl so that 32bit
  and 64bit libraries are searched as appropriate.
* Tue Aug 02 2005 - ro@suse.de
- move pkgIndex.tcl to /usr/share
* Thu Feb 10 2005 - agruen@suse.de
- Update to version 2.2.
- Drop graphviz-graphs subpackage.
* Sun Aug 29 2004 - garloff@suse.de
- Drop EULA notification message.
* Sat Mar 27 2004 - sndirsch@suse.de
- update to graphviz-1.12
  * general
    - rename bcc -> bcomps to avoid name conflict with
  "Bruce's C Compiler" on Redhat distributions.
    - all build without X11 (fix problem in lefty tree)
    - remove from distribution:
  dag, fdp, geo, grid, incr, shape, tcldgr, tcldgl
  * dotneato
    - fix "brown-bag" problem resulting in PNG and JPEG errors on
  RH8 and RH9.
- removed hunks for dag, fdp, grid, tcldgl from codecleanup patch;
  directories were dropped upstream (see 1.12 changelog above)
- no need to rename bcc any longer (see 1.12 changelog above)
- removed libtcldgl/libtcldgr (see 1.12 changelog above)
* Tue Mar 09 2004 - garloff@suse.de
- Rename bcc to bcc-graphviz due to conflict with bcc from dev86.
* Mon Mar 01 2004 - garloff@suse.de
- Update to graphviz-1.11:
  * Drop lots of patches (merged upstream) ;-)
  * dotneato: add -Gviewport, fix memleak in gdft, clean up calc
  of whitespace around labels
* Wed Feb 25 2004 - garloff@suse.de
- Update to graphviz-1.10:
  * enhanced gpr: string matching, lock primitive to save graphs
  * zoomable 2 1/2 D graph viewer (Java)
  * neato -gpack
* Fri Jan 16 2004 - meissner@suse.de
- Change freetype detection to new one, so the internal libGD is build
  against it again.
* Sat Jan 10 2004 - adrian@suse.de
- build as user
* Mon Oct 06 2003 - kukuk@suse.de
- Remove curl (source code does not use it) and lynx from
  neededforbuild.
* Mon Jul 28 2003 - ro@suse.de
- updated neededforbuild
* Tue May 13 2003 - pthomas@suse.de
- Add hacks to work around problems with libtool 1.5.
* Mon Apr 14 2003 - pthomas@suse.de
- Get rid of nearly all compiler warnings.
* Mon Apr 07 2003 - pthomas@suse.de
- Use posix-2001 conforming syntax for sort.
* Fri Feb 07 2003 - pthomas@suse.de
- Update to 1.9
- Split off subpackages devel, graphs and tcl like
  it's done in the specfile included with graphviz.
- remove obsolete patches
* Wed Jan 29 2003 - ro@suse.de
- fix png library detection in configure
- removed perl-GD and blt from neededforbuild
* Thu Jan 09 2003 - ro@suse.de
- fixed configure.in
* Thu Nov 14 2002 - tcrhak@suse.cz
- fixed for new bison: end rules with semicolons
* Tue Aug 20 2002 - mmj@suse.de
- Correct PreReq
* Sat Aug 10 2002 - aj@suse.de
- Fix typo in license.
* Fri Jul 05 2002 - kukuk@suse.de
- Use %%ix86 macro
* Tue Jul 02 2002 - garloff@suse.de
- Update to 1.8.6:
  * FPU handling fix got included
  * arch independent stuff in /usr/share/graphviz now
  * arrow fixes and improvements and more arrow types
  * new pack option to neato
  * bugfixes
- Change licensor from SuSE GmbH to SuSE Linux AG
* Wed May 22 2002 - garloff@suse.de
- Add prune binary and man page to file list.
* Fri May 10 2002 - garloff@suse.de
- Fix FPU excpetion handling. (Use feenableexcept() rather than
  _FPU_GETCW(), if available.)
* Wed May 08 2002 - garloff@suse.de
- Update to graphviz-1.8.5:
  * fixed various Win and MacOSX probs
  * minimal Type1 font support
  * webdot.cgi perl script accepts same args as webgot.tcl now
  * various SVG enhancements and fixes
  * various portability/64bit fixes
  * various bug fixes
* Fri May 03 2002 - meissner@suse.de
- %%_lib fixes (to find tclConfig.sh and tkConfig.sh)
* Fri Feb 01 2002 - ro@suse.de
- changed neededforbuild <libpng> to <libpng-devel-packages>
* Mon Jan 28 2002 - garloff@suse.de
- Some more missing decls found and fixed.
* Mon Jan 28 2002 - garloff@suse.de
- Added patch to fix lots of warnings (and potential bugs on 64bit
  platforms).
* Mon Jan 28 2002 - garloff@suse.de
- Pass TK_DEFS to gcc for tkspline (which uses tkInt.h)
* Mon Jan 28 2002 - garloff@suse.de
- Update to 1.7.16:
  * Various bug fixes
  * Support for xfig, svgz,
  * Text output improvements
  * New twopi tool
- Drop patches that have been included in official source ball.
* Wed May 23 2001 - garloff@suse.de
- Fix cast warnings on 64bit archs and add missing includes
  where necessary.
* Wed May 09 2001 - garloff@suse.de
- Cleanup patches.
* Tue May 08 2001 - mfabian@suse.de
- bzip2 sources
* Mon Apr 30 2001 - garloff@suse.de
- Update to release 1.7.6 with lots of bugfixes:
  * Lots of font related fixes
  * Fix various bugs WRT labels
  * UTF-8 fixes
  * cluster and neato layout fixes
  * -Timap (mouse sensitive graphs for web pages) fixes
  * PNG by default does white background now instead of transp.
- New features in 1.7.6:
  * New graph processing tools: acyclic, ccomps, colorize, gc,
  gpr, nop, sccmap, tred, unflatten (See ChangeLog for details)
- Spec file: Consistently use %%{prefix}
* Thu Mar 22 2001 - ro@suse.de
- changed neededforbuild to freetype2
- updated to 1.7.5 for freetype2
* Mon Feb 26 2001 - uli@suse.de
- fixed for new glibc
* Fri Jan 19 2001 - garloff@suse.de
- Assorted patches from Stephen C. North to
  * fix runtime error in graphs having multiple nodes in the min
  or max rank set
  * fix layout thinko (mincross)
* Sat Dec 16 2000 - garloff@suse.de
- Update to 1.7.4:
  * various fixes
  * support various linestyles
  * Remove Tcldot dependence on libgdtclft
  * support for long label strings (fixing a reported crash)
* Tue Dec 12 2000 - garloff@suse.de
- Specfile cleanups.
* Mon Dec 11 2000 - garloff@suse.de
- Update to 1.7.3:
  * Better font drawing support
  * Bugfixes
- Removed most explicit Requires: from spec, as AutoReqProv works
  just fine.
- Split off webdot.
* Wed Nov 29 2000 - ro@suse.de
- changed neededforbuild <tcld> to <tcl-devel>
* Wed Nov 08 2000 - ro@suse.de
- fixed neededforbuild gd -> perl-GD
* Wed Nov 01 2000 - garloff@suse.de
- Use %%{?suse_update_config} -> support for S/390 added
* Tue Oct 31 2000 - garloff@suse.de
- Update to 1.7: * dot/neato again separate binaries
  * 64 bit patches integrated
  * Some bugfixes and feature enhancements
* Wed Oct 18 2000 - garloff@suse.de
- Change the wording of the license notification to match the
  wording from the letter from AT&T.
* Tue Sep 19 2000 - garloff@suse.de
- Cleanups for 64 bit archs.
* Mon Sep 18 2000 - garloff@suse.de
- Add a notification for the sysadmin, that (s)he and the users
  need to agree with the license termn in MINTERMS.txt. According
  to "Stephen C. North" <north@research.att.com>, this is all that
  needs to be done to fulfill the license requirements.
* Wed Sep 06 2000 - garloff@suse.de
- LICENSOR is SuSE: Filled in MINTERMS.txt
* Tue Sep 05 2000 - garloff@suse.de
- Creation of package graphviz-1.6
- Fix lneato Makefile to install into $DESTDIR
openSUSE Build Service is sponsored by