( cd usr/bin ; rm -rf circo )
( cd usr/bin ; ln -sf dot circo )
( cd usr/bin ; rm -rf dot2gxl )
( cd usr/bin ; ln -sf gxl2gv dot2gxl )
( cd usr/bin ; rm -rf fdp )
( cd usr/bin ; ln -sf dot fdp )
( cd usr/bin ; rm -rf gv2gxl )
( cd usr/bin ; ln -sf gxl2gv gv2gxl )
( cd usr/bin ; rm -rf gxl2dot )
( cd usr/bin ; ln -sf gxl2gv gxl2dot )
( cd usr/bin ; rm -rf neato )
( cd usr/bin ; ln -sf dot neato )
( cd usr/bin ; rm -rf osage )
( cd usr/bin ; ln -sf dot osage )
( cd usr/bin ; rm -rf patchwork )
( cd usr/bin ; ln -sf dot patchwork )
( cd usr/bin ; rm -rf sfdp )
( cd usr/bin ; ln -sf dot sfdp )
( cd usr/bin ; rm -rf twopi )
( cd usr/bin ; ln -sf dot twopi )
( cd usr/doc/graphviz-12.0.0 ; rm -rf circo.1.pdf )
( cd usr/doc/graphviz-12.0.0 ; ln -sf dot.1.pdf circo.1.pdf )
( cd usr/doc/graphviz-12.0.0 ; rm -rf dot2gxl.1.pdf )
( cd usr/doc/graphviz-12.0.0 ; ln -sf gxl2gv.1.pdf dot2gxl.1.pdf )
( cd usr/doc/graphviz-12.0.0 ; rm -rf fdp.1.pdf )
( cd usr/doc/graphviz-12.0.0 ; ln -sf dot.1.pdf fdp.1.pdf )
( cd usr/doc/graphviz-12.0.0 ; rm -rf gv2gml.1.pdf )
( cd usr/doc/graphviz-12.0.0 ; ln -sf gml2gv.1.pdf gv2gml.1.pdf )
( cd usr/doc/graphviz-12.0.0 ; rm -rf gv2gxl.1.pdf )
( cd usr/doc/graphviz-12.0.0 ; ln -sf gxl2gv.1.pdf gv2gxl.1.pdf )
( cd usr/doc/graphviz-12.0.0 ; rm -rf gxl2dot.1.pdf )
( cd usr/doc/graphviz-12.0.0 ; ln -sf gxl2gv.1.pdf gxl2dot.1.pdf )
( cd usr/doc/graphviz-12.0.0 ; rm -rf neato.1.pdf )
( cd usr/doc/graphviz-12.0.0 ; ln -sf dot.1.pdf neato.1.pdf )
( cd usr/doc/graphviz-12.0.0 ; rm -rf sfdp.1.pdf )
( cd usr/doc/graphviz-12.0.0 ; ln -sf dot.1.pdf sfdp.1.pdf )
( cd usr/doc/graphviz-12.0.0 ; rm -rf twopi.1.pdf )
( cd usr/doc/graphviz-12.0.0 ; ln -sf dot.1.pdf twopi.1.pdf )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_core.so )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_core.so.6.0.0 libgvplugin_core.so )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_core.so.6 )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_core.so.6.0.0 libgvplugin_core.so.6 )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_dot_layout.so )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_dot_layout.so.6.0.0 libgvplugin_dot_layout.so )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_dot_layout.so.6 )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_dot_layout.so.6.0.0 libgvplugin_dot_layout.so.6 )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_gd.so )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_gd.so.6.0.0 libgvplugin_gd.so )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_gd.so.6 )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_gd.so.6.0.0 libgvplugin_gd.so.6 )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_gdk.so )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_gdk.so.6.0.0 libgvplugin_gdk.so )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_gdk.so.6 )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_gdk.so.6.0.0 libgvplugin_gdk.so.6 )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_gs.so )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_gs.so.6.0.0 libgvplugin_gs.so )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_gs.so.6 )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_gs.so.6.0.0 libgvplugin_gs.so.6 )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_kitty.so )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_kitty.so.6.0.0 libgvplugin_kitty.so )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_kitty.so.6 )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_kitty.so.6.0.0 libgvplugin_kitty.so.6 )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_neato_layout.so )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_neato_layout.so.6.0.0 libgvplugin_neato_layout.so )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_neato_layout.so.6 )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_neato_layout.so.6.0.0 libgvplugin_neato_layout.so.6 )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_pango.so )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_pango.so.6.0.0 libgvplugin_pango.so )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_pango.so.6 )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_pango.so.6.0.0 libgvplugin_pango.so.6 )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_poppler.so )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_poppler.so.6.0.0 libgvplugin_poppler.so )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_poppler.so.6 )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_poppler.so.6.0.0 libgvplugin_poppler.so.6 )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_rsvg.so )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_rsvg.so.6.0.0 libgvplugin_rsvg.so )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_rsvg.so.6 )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_rsvg.so.6.0.0 libgvplugin_rsvg.so.6 )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_vt.so )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_vt.so.6.0.0 libgvplugin_vt.so )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_vt.so.6 )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_vt.so.6.0.0 libgvplugin_vt.so.6 )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_webp.so )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_webp.so.6.0.0 libgvplugin_webp.so )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_webp.so.6 )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_webp.so.6.0.0 libgvplugin_webp.so.6 )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_xlib.so )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_xlib.so.6.0.0 libgvplugin_xlib.so )
( cd usr/lib64/graphviz ; rm -rf libgvplugin_xlib.so.6 )
( cd usr/lib64/graphviz ; ln -sf libgvplugin_xlib.so.6.0.0 libgvplugin_xlib.so.6 )
( cd usr/lib64/graphviz/lua ; rm -rf gv.so )
( cd usr/lib64/graphviz/lua ; ln -sf libgv_lua.so gv.so )
( cd usr/lib64/graphviz/python3 ; rm -rf _gv.so )
( cd usr/lib64/graphviz/python3 ; ln -sf libgv_python3.so _gv.so )
( cd usr/lib64 ; rm -rf libcdt.so )
( cd usr/lib64 ; ln -sf libcdt.so.5.0.0 libcdt.so )
( cd usr/lib64 ; rm -rf libcdt.so.5 )
( cd usr/lib64 ; ln -sf libcdt.so.5.0.0 libcdt.so.5 )
( cd usr/lib64 ; rm -rf libcgraph.so )
( cd usr/lib64 ; ln -sf libcgraph.so.6.0.0 libcgraph.so )
( cd usr/lib64 ; rm -rf libcgraph.so.6 )
( cd usr/lib64 ; ln -sf libcgraph.so.6.0.0 libcgraph.so.6 )
( cd usr/lib64 ; rm -rf libgvc.so )
( cd usr/lib64 ; ln -sf libgvc.so.6.0.0 libgvc.so )
( cd usr/lib64 ; rm -rf libgvc.so.6 )
( cd usr/lib64 ; ln -sf libgvc.so.6.0.0 libgvc.so.6 )
( cd usr/lib64 ; rm -rf libgvpr.so )
( cd usr/lib64 ; ln -sf libgvpr.so.2.0.0 libgvpr.so )
( cd usr/lib64 ; rm -rf libgvpr.so.2 )
( cd usr/lib64 ; ln -sf libgvpr.so.2.0.0 libgvpr.so.2 )
( cd usr/lib64 ; rm -rf libpathplan.so )
( cd usr/lib64 ; ln -sf libpathplan.so.4.0.0 libpathplan.so )
( cd usr/lib64 ; rm -rf libpathplan.so.4 )
( cd usr/lib64 ; ln -sf libpathplan.so.4.0.0 libpathplan.so.4 )
( cd usr/lib64 ; rm -rf libxdot.so )
( cd usr/lib64 ; ln -sf libxdot.so.4.0.0 libxdot.so )
( cd usr/lib64 ; rm -rf libxdot.so.4 )
( cd usr/lib64 ; ln -sf libxdot.so.4.0.0 libxdot.so.4 )
( cd usr/man/man1 ; rm -rf circo.1.gz )
( cd usr/man/man1 ; ln -sf dot.1.gz circo.1.gz )
( cd usr/man/man1 ; rm -rf dot2gxl.1.gz )
( cd usr/man/man1 ; ln -sf gxl2gv.1.gz dot2gxl.1.gz )
( cd usr/man/man1 ; rm -rf fdp.1.gz )
( cd usr/man/man1 ; ln -sf dot.1.gz fdp.1.gz )
( cd usr/man/man1 ; rm -rf gv2gml.1.gz )
( cd usr/man/man1 ; ln -sf gml2gv.1.gz gv2gml.1.gz )
( cd usr/man/man1 ; rm -rf gv2gxl.1.gz )
( cd usr/man/man1 ; ln -sf gxl2gv.1.gz gv2gxl.1.gz )
( cd usr/man/man1 ; rm -rf gxl2dot.1.gz )
( cd usr/man/man1 ; ln -sf gxl2gv.1.gz gxl2dot.1.gz )
( cd usr/man/man1 ; rm -rf neato.1.gz )
( cd usr/man/man1 ; ln -sf dot.1.gz neato.1.gz )
( cd usr/man/man1 ; rm -rf sfdp.1.gz )
( cd usr/man/man1 ; ln -sf dot.1.gz sfdp.1.gz )
( cd usr/man/man1 ; rm -rf twopi.1.gz )
( cd usr/man/man1 ; ln -sf dot.1.gz twopi.1.gz )

config() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "$(cat $OLD|md5sum)" = "$(cat $NEW|md5sum)" ]; then
    # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}

config etc/php.d/graphviz.ini.new

# Configure plugins
# (writes /usr/lib*/graphviz/config6 with available plugin information)
chroot . /usr/bin/dot -c
