1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-25 17:27:18 +00:00
Sonarr/distribution/debian.sh

48 lines
1.8 KiB
Bash
Raw Normal View History

2018-01-26 19:30:13 +00:00
fromdos ./debian/*
cp -r ./debian ./debian_backup
2018-11-18 19:11:04 +00:00
BuildVersion=${dependent_build_number:-3.10.0.999}
BuildBranch=${dependent_build_branch:-master}
BootstrapVersion=`echo "$BuildVersion" | cut -d. -f1,2,3`
BootstrapUpdater="BuiltIn"
PackageUpdater="apt"
2018-11-18 19:11:04 +00:00
echo Version: "$BuildVersion" Branch: "$BuildBranch"
2018-01-26 19:30:13 +00:00
rm -r ./sonarr_bin/Sonarr.Update
chmod -R ugo-x,ugo+rwX,go-w ./sonarr_bin/*
2018-01-26 19:30:13 +00:00
2018-11-18 19:11:04 +00:00
echo Updating changelog for $BuildVersion
sed -i "s:{version}:$BuildVersion:g; s:{branch}:$BuildBranch:g;" debian/changelog
sed -i "s:{version}:$BuildVersion:g; s:{updater}:$PackageUpdater:g" debian/preinst debian/postinst debian/postrm
sed -i '/#BEGIN BUILTIN UPDATER/,/#END BUILTIN UPDATER/d' debian/preinst debian/postinst debian/postrm
echo "# Do Not Edit\nPackageVersion=$BuildVersion\nReleaseVersion=$BuildVersion\nUpdateMethod=$PackageUpdater\nBranch=$BuildBranch" > package_info
2018-01-26 19:30:13 +00:00
2018-11-18 19:11:04 +00:00
echo Running debuild for $BuildVersion
2018-01-26 19:30:13 +00:00
debuild -b
# Restore debian directory to the original files
rm -rf ./debian
mv ./debian_backup ./debian
echo Updating changelog for $BootstrapVersion
sed -i "s:{version}:$BootstrapVersion:g; s:{branch}:$BuildBranch:g;" debian/changelog
sed -i "s:{version}:$BuildVersion:g; s:{updater}:$BootstrapUpdater:g" debian/preinst debian/postinst debian/postrm
sed -i '/#BEGIN BUILTIN UPDATER/d; /#END BUILTIN UPDATER/d' debian/preinst debian/postinst debian/postrm
echo "# Do Not Edit\nPackageVersion=$BootstrapVersion\nReleaseVersion=$BuildVersion\nUpdateMethod=$BootstrapUpdater\nBranch=$BuildBranch" > package_info
echo Running debuild for $BootstrapVersion
debuild -b
2018-01-26 19:30:13 +00:00
echo Moving stuff around
mv ../sonarr_*.deb ./
mv ../sonarr_*.changes ./
rm ../sonarr_*.build
echo Signing Package
2018-11-18 19:11:04 +00:00
dpkg-sig -k 884589CE --sign builder "sonarr_${BuildVersion}_all.deb"
dpkg-sig -k 884589CE --sign builder "sonarr_${BootstrapVersion}_all.deb"
2018-01-26 19:30:13 +00:00
echo running alien
alien -r -v ./*.deb