2018-01-26 21:30:13 +02:00
fromdos ./debian/*
2021-02-16 22:48:27 +02:00
chmod ugo-x ./debian/*
2018-11-18 21:12:55 +02:00
cp -r ./debian ./debian_backup
2018-11-18 21:11:04 +02:00
2022-08-08 08:31:21 +02:00
BuildVersion = ${ dependent_build_number :- 4 .10.0.999 }
BuildBranch = ${ dependent_build_branch :- main }
2018-11-18 21:12:55 +02:00
BootstrapVersion = ` echo " $BuildVersion " | cut -d. -f1,2,3`
BootstrapUpdater = "BuiltIn"
PackageUpdater = "apt"
2018-11-18 21:11:04 +02:00
echo Version: " $BuildVersion " Branch: " $BuildBranch "
2018-01-26 21:30:13 +02:00
rm -r ./sonarr_bin/Sonarr.Update
2018-11-10 02:24:42 +02:00
chmod -R ugo-x,ugo+rwX,go-w ./sonarr_bin/*
2018-01-26 21:30:13 +02:00
2018-11-18 21:11:04 +02:00
echo Updating changelog for $BuildVersion
sed -i " s:{version}: $BuildVersion :g; s:{branch}: $BuildBranch :g; " debian/changelog
2018-11-18 21:12:55 +02:00
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
2020-05-07 11:59:03 +02:00
echo " # Do Not Edit\nPackageVersion= $BuildVersion \nPackageAuthor=[Team Sonarr](https://sonarr.tv)\nReleaseVersion= $BuildVersion \nUpdateMethod= $PackageUpdater \nBranch= $BuildBranch " > package_info
2018-01-26 21:30:13 +02:00
2018-11-18 21:11:04 +02:00
echo Running debuild for $BuildVersion
2019-07-14 21:35:16 +02:00
if [ -z " ${ TEST_OUTPUT } " ] ; then
debuild -b
else
debuild -us -uc -b
fi
2018-01-26 21:30:13 +02:00
2018-11-18 21:12:55 +02:00
# 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
2020-05-07 11:59:03 +02:00
echo " # Do Not Edit\nPackageVersion= $BootstrapVersion \nPackageAuthor=[Team Sonarr](https://sonarr.tv)\nReleaseVersion= $BuildVersion \nUpdateMethod= $BootstrapUpdater \nBranch= $BuildBranch " > package_info
2018-11-18 21:12:55 +02:00
echo Running debuild for $BootstrapVersion
2019-07-14 21:35:16 +02:00
if [ -z " ${ TEST_OUTPUT } " ] ; then
debuild -b
else
debuild -us -uc -b
fi
2018-11-18 21:12:55 +02:00
2018-01-26 21:30:13 +02:00
echo Moving stuff around
mv ../sonarr_*.deb ./
mv ../sonarr_*.changes ./
rm ../sonarr_*.build
2019-07-14 21:35:16 +02:00
if [ -z " ${ TEST_OUTPUT } " ] ; then
echo Signing Package
dpkg-sig -k 884589CE --sign builder " sonarr_ ${ BuildVersion } _all.deb "
dpkg-sig -k 884589CE --sign builder " sonarr_ ${ BootstrapVersion } _all.deb "
2018-01-26 21:30:13 +02:00
2019-07-14 21:35:16 +02:00
echo running alien
alien -r -v ./*.deb
else
echo " Exporting packages to ${ TEST_OUTPUT } "
dpkg -e " sonarr_ ${ BuildVersion } _all.deb " ${ TEST_OUTPUT } /sonarr-build
dpkg -e " sonarr_ ${ BootstrapVersion } _all.deb " ${ TEST_OUTPUT } /sonarr-release
cp *.deb ${ TEST_OUTPUT } /
fi