From 70e4dbe3bddf393705cf7291365aac81ed93bf88 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sun, 14 Jul 2019 21:35:16 +0200 Subject: [PATCH] Updated debian build to fix stray msbuild dependency --- distribution/build-package.sh | 7 +++++ distribution/debian.sh | 30 ++++++++++++++++----- distribution/debian/control | 6 ++--- distribution/debian/install | 4 +-- distribution/debian/postinst | 2 +- distribution/debian/rules | 8 +----- distribution/debian/sonarr.clideps-override | 2 +- distribution/docker-build/Dockerfile | 23 ++++++++++++++++ distribution/docker-build/debian-start.sh | 18 +++++++++++++ 9 files changed, 79 insertions(+), 21 deletions(-) create mode 100644 distribution/build-package.sh create mode 100644 distribution/docker-build/Dockerfile create mode 100644 distribution/docker-build/debian-start.sh diff --git a/distribution/build-package.sh b/distribution/build-package.sh new file mode 100644 index 000000000..89e92e91b --- /dev/null +++ b/distribution/build-package.sh @@ -0,0 +1,7 @@ +# Note, this script is only used for local dev tests, this is not the script used for building the official sonarr package + +mkdir -p /${PWD}/../_output_debian + +docker build -f docker-build/Dockerfile -t sonarr-packager ./docker-build + +docker run --rm -v /${PWD}/../_output_linux:/data/sonarr_bin:ro -v /${PWD}:/data/build -v /${PWD}/../_output_debian:/data/output sonarr-packager diff --git a/distribution/debian.sh b/distribution/debian.sh index a2d22e066..446e47d20 100644 --- a/distribution/debian.sh +++ b/distribution/debian.sh @@ -19,7 +19,11 @@ sed -i '/#BEGIN BUILTIN UPDATER/,/#END BUILTIN UPDATER/d' debian/preinst debian/ echo "# Do Not Edit\nPackageVersion=$BuildVersion\nReleaseVersion=$BuildVersion\nUpdateMethod=$PackageUpdater\nBranch=$BuildBranch" > package_info echo Running debuild for $BuildVersion -debuild -b +if [ -z "${TEST_OUTPUT}" ]; then + debuild -b +else + debuild -us -uc -b +fi # Restore debian directory to the original files rm -rf ./debian @@ -32,16 +36,28 @@ sed -i '/#BEGIN BUILTIN UPDATER/d; /#END BUILTIN UPDATER/d' debian/preinst debia echo "# Do Not Edit\nPackageVersion=$BootstrapVersion\nReleaseVersion=$BuildVersion\nUpdateMethod=$BootstrapUpdater\nBranch=$BuildBranch" > package_info echo Running debuild for $BootstrapVersion -debuild -b +if [ -z "${TEST_OUTPUT}" ]; then + debuild -b +else + debuild -us -uc -b +fi echo Moving stuff around mv ../sonarr_*.deb ./ mv ../sonarr_*.changes ./ rm ../sonarr_*.build -echo Signing Package -dpkg-sig -k 884589CE --sign builder "sonarr_${BuildVersion}_all.deb" -dpkg-sig -k 884589CE --sign builder "sonarr_${BootstrapVersion}_all.deb" +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" -echo running alien -alien -r -v ./*.deb + 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 diff --git a/distribution/debian/control b/distribution/debian/control index 10d9baab8..d8a2daee3 100644 --- a/distribution/debian/control +++ b/distribution/debian/control @@ -7,9 +7,9 @@ Vcs-Git: git@github.com:Sonarr/Sonarr.git Vcs-Browser: https://github.com/Sonarr/Sonarr Build-Depends: debhelper (>= 9), dh-systemd (>= 1.5), - mono-devel (>= 4.6), - libmono-cil-dev (>= 4.6), - cli-common-dev (>= 0.5.7) + mono-devel (>= 5.4), + libmono-cil-dev (>= 5.4), + cli-common-dev (>= 0.9+xamarin5) Package: sonarr Architecture: all diff --git a/distribution/debian/install b/distribution/debian/install index a09cfdbad..b3cf8bedb 100644 --- a/distribution/debian/install +++ b/distribution/debian/install @@ -1,2 +1,2 @@ -sonarr_bin/* /usr/lib/sonarr/bin -package_info /usr/lib/sonarr +sonarr_bin/* usr/lib/sonarr/bin +package_info usr/lib/sonarr diff --git a/distribution/debian/postinst b/distribution/debian/postinst index 7524a6003..80b212e8f 100644 --- a/distribution/debian/postinst +++ b/distribution/debian/postinst @@ -104,4 +104,4 @@ fi #DEBHELPER# -exit 0 \ No newline at end of file +exit 0 diff --git a/distribution/debian/rules b/distribution/debian/rules index e090115f5..6ee017f07 100644 --- a/distribution/debian/rules +++ b/distribution/debian/rules @@ -1,10 +1,4 @@ #!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 @@ -20,7 +14,7 @@ EXCLUDE_MODULEREFS = crypt32 httpapi System.Native override_dh_installinit: true -# Sonarr like debug symbols for logging +# Sonarr likes debug symbols for logging override_dh_clistrip: override_dh_makeclilibs: diff --git a/distribution/debian/sonarr.clideps-override b/distribution/debian/sonarr.clideps-override index 87dc0627c..5766b82d7 100644 --- a/distribution/debian/sonarr.clideps-override +++ b/distribution/debian/sonarr.clideps-override @@ -1,2 +1,2 @@ recommends libcurl3 -ignores msbuild \ No newline at end of file +ignores msbuild diff --git a/distribution/docker-build/Dockerfile b/distribution/docker-build/Dockerfile new file mode 100644 index 000000000..5998d6e51 --- /dev/null +++ b/distribution/docker-build/Dockerfile @@ -0,0 +1,23 @@ +FROM ubuntu:xenial AS builder + +ENV DEBIAN_FRONTEND noninteractive +ENV MONO_VERSION 5.14 + +RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \ + echo "deb http://download.mono-project.com/repo/debian stable-xenial/snapshots/$MONO_VERSION main" > /etc/apt/sources.list.d/mono-official-stable.list && \ + apt-get update && apt-get install -y \ + devscripts build-essential tofrodos \ + dh-make dh-systemd \ + cli-common-dev \ + mono-complete \ + sqlite3 libcurl3 mediainfo + +RUN apt-cache policy mono-complete +RUN apt-cache policy cli-common-dev + +COPY debian-start.sh /debian-start.sh +RUN fromdos /debian-start.sh + +WORKDIR /data +VOLUME [ "/data/sonarr_bin", "/data/build", "/data/output" ] +CMD /debian-start.sh diff --git a/distribution/docker-build/debian-start.sh b/distribution/docker-build/debian-start.sh new file mode 100644 index 000000000..a1eff0638 --- /dev/null +++ b/distribution/docker-build/debian-start.sh @@ -0,0 +1,18 @@ +echo "Debian Build Dev bootstrap..." + +export TEST_OUTPUT=/data/output + +mkdir ${TEST_OUTPUT} + +mkdir /data/temp + +cp -rf /data/build/debian.sh /data/temp +cp -rf /data/build/debian /data/temp +cp -rf /data/sonarr_bin /data/temp/sonarr_bin + +cd /data/temp + +ls -al . + +fromdos debian.sh +sh debian.sh