# Make a symlink to /var/rarian since some
# packages may use this instead of /var/lib/rarian
if [ -L var/lib/rarian ]; then
  ( cd var ; rm -rf lib/rarian )
fi

( cd var ; mkdir -p lib/rarian )

if [ -d var/rarian -a ! -L var/rarian ]; then
  ( cd var ; mv rarian/* lib/rarian )
fi

( cd var ; rm -rf rarian )
( cd var ; ln -sf lib/rarian rarian )

( cd usr/bin ; rm -rf scrollkeeper-config )
( cd usr/bin ; ln -sf rarian-sk-config scrollkeeper-config )
( cd usr/bin ; rm -rf scrollkeeper-get-toc-from-docpath )
( cd usr/bin ; ln -sf rarian-sk-get-scripts scrollkeeper-get-toc-from-docpath )
( cd usr/bin ; rm -rf scrollkeeper-get-cl )
( cd usr/bin ; ln -sf rarian-sk-get-cl scrollkeeper-get-cl )
( cd usr/bin ; rm -rf scrollkeeper-uninstall )
( cd usr/bin ; ln -sf rarian-sk-install scrollkeeper-uninstall )
( cd usr/bin ; rm -rf scrollkeeper-install )
( cd usr/bin ; ln -sf rarian-sk-install scrollkeeper-install )
( cd usr/bin ; rm -rf scrollkeeper-get-content-list )
( cd usr/bin ; ln -sf rarian-sk-get-content-list scrollkeeper-get-content-list )
( cd usr/bin ; rm -rf scrollkeeper-get-extended-content-list )
( cd usr/bin ; ln -sf rarian-sk-get-extended-content-list scrollkeeper-get-extended-content-list )
( cd usr/bin ; rm -rf scrollkeeper-update )
( cd usr/bin ; ln -sf rarian-sk-update scrollkeeper-update )
( cd usr/bin ; rm -rf scrollkeeper-preinstall )
( cd usr/bin ; ln -sf rarian-sk-preinstall scrollkeeper-preinstall )
( cd usr/bin ; rm -rf scrollkeeper-get-toc-from-id )
( cd usr/bin ; ln -sf rarian-sk-get-scripts scrollkeeper-get-toc-from-id )
( cd usr/bin ; rm -rf scrollkeeper-rebuilddb )
( cd usr/bin ; ln -sf rarian-sk-rebuild scrollkeeper-rebuilddb )
( cd usr/bin ; rm -rf scrollkeeper-extract )
( cd usr/bin ; ln -sf rarian-sk-extract scrollkeeper-extract )
( cd usr/bin ; rm -rf scrollkeeper-gen-seriesid )
( cd usr/bin ; ln -sf rarian-sk-gen-uuid scrollkeeper-gen-seriesid )
( cd usr/bin ; rm -rf scrollkeeper-get-index-from-docpath )
( cd usr/bin ; ln -sf rarian-sk-get-scripts scrollkeeper-get-index-from-docpath )
( cd usr/lib ; rm -rf librarian.so )
( cd usr/lib ; ln -sf librarian.so.0.0.0 librarian.so )
( cd usr/lib ; rm -rf librarian.so.0 )
( cd usr/lib ; ln -sf librarian.so.0.0.0 librarian.so.0 )
