#Added by slkbuild 0.7.3
dotnew() {
        NEW="${1}.new"
        OLD="$1"
        if [ ! -e $OLD ]; then
                mv $NEW $OLD
        elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
                rm $NEW
        fi
}
dotnew etc/rc.d/rc.subsonic
doinst() {
  for app in lame ffmpeg flac faad oggdec oggenc; do
    [ ! -e var/subsonic/transcode/$app ] && ln -sf /usr/bin/$app var/subsonic/transcode/
  done
  [ -e var/subsonic/jetty ] && rm -rf var/subsonic/jetty
}
doinst
( cd usr/bin ; rm -rf subsonic )
( cd usr/bin ; ln -sf /usr/share/subsonic/subsonic.sh subsonic )
