#!/bin/sh
# Copyright 2009 Saravana Kannan
# <sarav dot devel [ignore this] at gmail period com>
#
# This file is part of syno-packager.
#
# syno-packager is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# syno-packager is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with syno-packager.  If not, see <http://www.gnu.org/licenses/>.


syno3rdpty=/usr/syno/synoman/webman/3rdparty

mkdir -p /usr/local/bin
mkdir -p /usr/local/etc
mkdir -p /usr/local/share/transmission
ln -s $SYNOPKG_PKGDEST/usr/local/bin/transmission-daemon /usr/local/bin/transmission-daemon
ln -s $SYNOPKG_PKGDEST/usr/local/share/transmission/web /usr/local/share/transmission/web
ln -s $SYNOPKG_PKGDEST/extra/transmission-adduser /usr/local/bin/transmission-adduser
ln -s $SYNOPKG_PKGDEST/extra/transmission-deluser /usr/local/bin/transmission-deluser
ln -s $SYNOPKG_PKGDEST/extra/transmission-setting /usr/local/bin/transmission-setting
ln -s $SYNOPKG_PKGDEST/extra/transmission-wrapper /usr/local/bin/transmission-wrapper
if [ -d $syno3rdpty ]; then
	mkdir -p $syno3rdpty/transmission
	ln -s $SYNOPKG_PKGDEST/extra/application.cfg $syno3rdpty/transmission/application.cfg
fi
echo "Run transmission-adduser as root to add Transmission usage privileges to a user" > $SYNOPKG_TEMP_LOGFILE
echo "User Home service must be enabled to use Transmission." >> $SYNOPKG_TEMP_LOGFILE

exit 0
