Updated Debian package

This commit is contained in:
Mark McDowall 2018-01-26 11:30:13 -08:00 committed by Taloth Saldono
parent 07cbc71aa2
commit a17a60f914
16 changed files with 142 additions and 44 deletions

View File

@ -248,7 +248,7 @@ PackageTests()
fi fi
cp $outputFolder/*.dll $testPackageFolder cp $outputFolder/*.dll $testPackageFolder
cp ./*.sh $testPackageFolder cp ./test.sh $testPackageFolder
echo "Creating MDBs for tests" echo "Creating MDBs for tests"
CreateMdbs $testPackageFolder CreateMdbs $testPackageFolder
@ -284,12 +284,21 @@ CleanupWindowsPackage()
PublishArtifacts() PublishArtifacts()
{ {
ProgressStart 'Publishing Artifacts'
# Tests
echo "##teamcity[publishArtifacts '_tests/** => tests.zip']" echo "##teamcity[publishArtifacts '_tests/** => tests.zip']"
# Releases
echo "##teamcity[publishArtifacts '$outputFolder/** => Sonarr.$BRANCH.$BUILD_NUMBER.windows.zip!Sonarr']" echo "##teamcity[publishArtifacts '$outputFolder/** => Sonarr.$BRANCH.$BUILD_NUMBER.windows.zip!Sonarr']"
echo "##teamcity[publishArtifacts '$outputFolderLinux/** => Sonarr.$BRANCH.$BUILD_NUMBER.linux.tar.gz!Sonarr']" echo "##teamcity[publishArtifacts '$outputFolderLinux/** => Sonarr.$BRANCH.$BUILD_NUMBER.linux.tar.gz!Sonarr']"
echo "##teamcity[publishArtifacts '$outputFolderMacOS/** => Sonarr.$BRANCH.$BUILD_NUMBER.macos.tar.gz!Sonarr']" echo "##teamcity[publishArtifacts '$outputFolderMacOS/** => Sonarr.$BRANCH.$BUILD_NUMBER.macos.tar.gz!Sonarr']"
echo "##teamcity[publishArtifacts '$outputFolderMacOSApp/** => Sonarr.$BRANCH.$BUILD_NUMBER.macos.zip']" echo "##teamcity[publishArtifacts '$outputFolderMacOSApp/** => Sonarr.$BRANCH.$BUILD_NUMBER.macos.zip']"
echo "##teamcity[publishArtifacts 'debian => debian.zip/debian']"
# Debian Package
echo "##teamcity[publishArtifacts 'distribution/** => distribution.zip']"
ProgressEnd 'Publishing Artifacts'
} }
# Use mono or .net depending on OS # Use mono or .net depending on OS

5
debian/changelog vendored
View File

@ -1,5 +0,0 @@
nzbdrone {version} {branch}; urgency=low
* Automatic Release.
-- NzbDrone <contact@nzbdrone.com> Mon, 26 Aug 2013 00:00:00 -0700

12
debian/control vendored
View File

@ -1,12 +0,0 @@
Section: web
Priority: optional
Maintainer: Sonarr <contact@nzbdrone.com>
Source: nzbdrone
Homepage: https://sonarr.tv
Vcs-Git: git@github.com:Sonarr/Sonarr.git
Vcs-Browser: https://github.com/Sonarr/Sonarr
Package: nzbdrone
Architecture: all
Depends: libmono-cil-dev (>= 3.2), sqlite3 (>= 3.7), mediainfo (>= 0.7.52)
Description: Sonarr is an internet PVR

1
debian/install vendored
View File

@ -1 +0,0 @@
nzbdrone_bin/* opt/NzbDrone

22
distribution/debian.sh Normal file
View File

@ -0,0 +1,22 @@
fromdos ./debian/*
echo Version: "$dependent_build_number" Branch: "$dependent_build_branch"
rm -r ./sonarr_bin/Sonarr.Update
echo Updating changelog
sed -i "s/{version}/$dependent_build_number/g" debian/changelog
sed -i "s/{branch}/$dependent_build_branch/g" debian/changelog
echo Running debuild
debuild -b
echo Moving stuff around
mv ../sonarr_*.deb ./
mv ../sonarr_*.changes ./
rm ../sonarr_*.build
echo Signing Package
dpkg-sig -k 884589CE --sign builder "sonarr_${dependent_build_number}_all.deb"
echo running alien
alien -r -v ./*.deb

View File

@ -0,0 +1,5 @@
sonarr ({version}) {branch}; urgency=low
* Automatic Release.
-- Sonarr <hello@sonarr.tv> Sun, 28 Jan 2018 00:00:00 -0700

View File

@ -0,0 +1,13 @@
Section: web
Priority: optional
Maintainer: Sonarr <hello@sonarr.tv>
Source: sonarr
Homepage: https://sonarr.tv
Vcs-Git: git@github.com:Sonarr/Sonarr.git
Vcs-Browser: https://github.com/Sonarr/Sonarr
Package: sonarr
Architecture: all
Conflicts: nzbdrone
Depends: libmono-cil-dev (>= 4.6), sqlite3 (>= 3.7), mediainfo (>= 0.7.52)
Description: Internet PVR

2
debian/copyright → distribution/debian/copyright Executable file → Normal file
View File

@ -1,5 +1,5 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: nzbdrone Upstream-Name: sonarr
Source: https://github.com/Sonarr/Sonarr Source: https://github.com/Sonarr/Sonarr
Files: * Files: *

View File

@ -0,0 +1 @@
sonarr_3.0.0.0_all.deb web optional

View File

@ -0,0 +1,2 @@
sonarr_bin/* /opt/sonarr
debian/sonarr.service /lib/systemd/system

View File

@ -0,0 +1,33 @@
USER="sonarr"
# Add User
if ! getent passwd "$USER" >/dev/null; then
adduser --quiet --system --shell /bin/bash --home /var/opt/sonarr --group "$USER"
if ! getent group "$USER" >/dev/null; then
groupadd "$USER"
usermod -a -G "$USER" "$USER"
fi
fi
# Create home directory
if [ ! -d /var/opt/sonarr ]; then
mkdir -p /var/opt/sonarr
chown $USER:$USER /var/opt/sonarr
fi
# Set permissions on /opt/sonarr
chown -R $USER:$USER /opt/sonarr
# Start Sonarr automatically
if [ -f /proc/1/comm ]; then
if [ "`cat /proc/1/comm`" = "systemd" ]; then
# Enable and start systemd service
systemctl enable sonarr.service
systemctl start sonarr.service
fi
fi

View File

@ -0,0 +1,9 @@
#!/bin/sh
set -e
# In case this system is running systemd, we make systemd reload the unit files
# to pick up changes.
if [ -d /run/systemd/system ] ; then
systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section

View File

@ -0,0 +1,6 @@
#!/bin/sh
if [ -f /proc/1/comm ] && [ "`cat /proc/1/comm`" = "systemd" ]; then
rm -f /etc/init.d/sonarr
systemctl stop sonarr.service
systemctl disable sonarr.service
fi

0
debian/rules → distribution/debian/rules Executable file → Normal file
View File

View File

@ -0,0 +1,16 @@
[Unit]
Description=Sonarr Daemon
After=network.target
[Service]
User=sonarr
Group=sonarr
Type=simple
ExecStart=/usr/bin/mono --debug /opt/sonarr/Sonarr.exe -nobrowser
TimeoutStopSec=20
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target