tdesktop/Telegram/PrepareLinux.sh

52 lines
1.8 KiB
Bash
Raw Normal View History

2014-11-22 10:21:50 +00:00
AppVersion=`./Version.sh | awk -F " " '{print $1}'`
AppVersionStr=`./Version.sh | awk -F " " '{print $2}'`
2015-02-05 15:03:03 +00:00
DevChannel=`./Version.sh | awk -F " " '{print $3}'`
DevPostfix=''
DevParam=''
if [ "$DevChannel" != "0" ]; then
DevPostfix='.dev'
DevParam='-dev'
fi
if [ -d "./../Linux/Release/deploy/$AppVersionStr.dev" ]; then
echo "Deploy folder for version $AppVersionStr.dev already exists!"
exit 1
fi
2014-07-14 05:16:21 +00:00
if [ -d "./../Linux/Release/deploy/$AppVersionStr" ]; then
2014-07-14 05:16:21 +00:00
echo "Deploy folder for version $AppVersionStr already exists!"
exit 1
fi
if [ -f "./../Linux/Release/tlinuxupd$AppVersion" ]; then
2014-07-14 05:16:21 +00:00
echo "Update file for version $AppVersion already exists!"
exit 1
fi
if [ ! -f "./../Linux/Release/Telegram" ]; then
2014-07-14 05:16:21 +00:00
echo "Telegram not found!"
exit 1
fi
if [ ! -f "./../Linux/Release/Updater" ]; then
2014-07-14 05:16:21 +00:00
echo "Updater not found!"
exit 1
fi
2015-02-05 15:03:03 +00:00
echo "Preparing version $AppVersionStr$DevPostfix, executing Packer.."
cd ./../Linux/Release && ./Packer -path Telegram -path Updater -version $AppVersion $DevParam && cd ./../../Telegram
2014-07-14 05:16:21 +00:00
echo "Packer done!"
if [ ! -d "./../Linux/Release/deploy" ]; then
mkdir "./../Linux/Release/deploy"
2014-07-14 05:16:21 +00:00
fi
2015-02-05 15:03:03 +00:00
echo "Copying Telegram, Updater and tlinuxupd$AppVersion to deploy/$AppVersionStr$DevPostfix..";
mkdir "./../Linux/Release/deploy/$AppVersionStr$DevPostfix"
mkdir "./../Linux/Release/deploy/$AppVersionStr$DevPostfix/Telegram"
mv ./../Linux/Release/Telegram ./../Linux/Release/deploy/$AppVersionStr$DevPostfix/Telegram/
mv ./../Linux/Release/Updater ./../Linux/Release/deploy/$AppVersionStr$DevPostfix/Telegram/
mv ./../Linux/Release/tlinuxupd$AppVersion ./../Linux/Release/deploy/$AppVersionStr$DevPostfix/
cd ./../Linux/Release/deploy/$AppVersionStr$DevPostfix && tar -cJvf tsetup.$AppVersionStr$DevPostfix.tar.xz Telegram/ && cd ./../../../../Telegram
echo "Version $AppVersionStr$DevPostfix prepared!";
2014-07-14 05:16:21 +00:00