diff options
author | Joshua M. Boniface <joshua@boniface.me> | 2024-02-04 16:42:36 -0500 |
---|---|---|
committer | Joshua M. Boniface <joshua@boniface.me> | 2024-02-07 02:26:43 -0500 |
commit | 7666f4d8b4d163d4830a82cce7db7849ae196581 (patch) | |
tree | 860f879715fefa5d952283e97e0e6184bfcf5718 /debian | |
parent | Add missing step to README (diff) | |
download | jellyfin-packaging-7666f4d8b4d163d4830a82cce7db7849ae196581.tar.gz jellyfin-packaging-7666f4d8b4d163d4830a82cce7db7849ae196581.tar.bz2 jellyfin-packaging-7666f4d8b4d163d4830a82cce7db7849ae196581.zip |
Add Dockerized debian builders
Diffstat (limited to 'debian')
-rw-r--r-- | debian/changelog.in (renamed from debian/changelog.j2) | 2 | ||||
-rw-r--r-- | debian/control | 3 | ||||
-rw-r--r-- | debian/docker/Dockerfile | 97 | ||||
-rwxr-xr-x | debian/docker/build.sh | 21 | ||||
-rwxr-xr-x | debian/rules | 7 | ||||
-rw-r--r-- | debian/source/options | 10 |
6 files changed, 135 insertions, 5 deletions
diff --git a/debian/changelog.j2 b/debian/changelog.in index 5cf4c80..b575c1f 100644 --- a/debian/changelog.j2 +++ b/debian/changelog.in @@ -1,4 +1,4 @@ -jellyfin ({package_version}-{package_build}) unstable; urgency=medium +jellyfin ({package_version}+{package_build}) unstable; urgency=medium * {release_comment} diff --git a/debian/control b/debian/control index 4a05c27..83941dc 100644 --- a/debian/control +++ b/debian/control @@ -3,8 +3,7 @@ Section: misc Priority: optional Maintainer: Jellyfin Packaging Team <packaging@jellyfin.org> Build-Depends: debhelper (>= 10), - dotnet-sdk-8.0, - npm | nodejs + npm | nodejs, Standards-Version: 3.9.4 Homepage: https://jellyfin.org Vcs-Browser: https://github.com/jellyfin diff --git a/debian/docker/Dockerfile b/debian/docker/Dockerfile new file mode 100644 index 0000000..be39bae --- /dev/null +++ b/debian/docker/Dockerfile @@ -0,0 +1,97 @@ +# Docker build arguments +ARG DOTNET_VERSION=8.0 +ARG NODEJS_VERSION=20 +# Default to 12, but set externally by the `build.py` script +ARG GCC_VERSION=12 + +ARG PTYPE +ARG PVERSION +ARG PARCH + +FROM ${PTYPE}:${PVERSION} + +ARG SOURCE_DIR=/jellyfin +ARG ARTIFACT_DIR=/dist +ARG DOTNET_VERSION +ARG NODEJS_VERSION +ARG PTYPE +ARG PVERSION +ARG PARCH +ARG GCC_VERSION + +# Docker run environment +ENV SOURCE_DIR=/jellyfin +ENV ARTIFACT_DIR=/dist +ENV DEB_BUILD_OPTIONS=noddebs +ENV TYPE=${PTYPE} +ENV VERSION=${PVERSION} +ENV ARCH=${PARCH} + +# Prepare Debian build environment +RUN apt-get update -y \ + + && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC \ + apt-get install --no-install-recommends -y \ + wget debhelper gnupg devscripts build-essential mmv lsb-release \ + libssl*.* liblttng-ust* \ + libfontconfig*-dev libcurl*openssl-dev libfreetype*-dev libssl-dev \ + && apt-get clean autoclean -y \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* + +# Prepare the cross-toolchain +RUN if test "${PARCH}" != "$( dpkg --print-architecture )"; then \ + if grep -q -i ubuntu /etc/os-release; then \ + rm /etc/apt/sources.list \ + && export CODENAME="$( lsb_release -c -s )" \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/amd64.list \ + && echo "deb [arch=${PARCH}] http://ports.ubuntu.com/ ${CODENAME} main restricted universe multiverse" >>/etc/apt/sources.list.d/${PARCH}.list \ + && echo "deb [arch=${PARCH}] http://ports.ubuntu.com/ ${CODENAME}-updates main restricted universe multiverse" >>/etc/apt/sources.list.d/${PARCH}.list \ + && echo "deb [arch=${PARCH}] http://ports.ubuntu.com/ ${CODENAME}-backports main restricted universe multiverse" >>/etc/apt/sources.list.d/${PARCH}.list \ + && echo "deb [arch=${PARCH}] http://ports.ubuntu.com/ ${CODENAME}-security main restricted universe multiverse" >>/etc/apt/sources.list.d/${PARCH}.list \ + ; fi \ + && set -o xtrace \ + && dpkg --add-architecture ${PARCH} \ + && apt-get update -y \ + && apt-get install --no-install-recommends -y cross-gcc-dev \ + && TARGET_LIST="${PARCH}" cross-gcc-gensource ${GCC_VERSION} \ + && cd cross-gcc-packages-amd64/cross-gcc-${GCC_VERSION}-${PARCH} \ + && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC \ + apt-get -f install --no-install-recommends -o Dpkg::Options::="--force-overwrite" -y \ + bison flex libtool gdb sharutils netbase libmpc-dev libmpfr-dev libgmp-dev \ + systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip \ + binutils-aarch64-linux-gnu binutils-arm-linux-gnueabihf \ + gcc-${GCC_VERSION}-source libstdc++-${GCC_VERSION}-dev-${PARCH}-cross \ + libc6-dev:${PARCH} linux-libc-dev:${PARCH} libgcc1:${PARCH} libstdc++-${GCC_VERSION}-dev:${PARCH} \ + libfontconfig*-dev:${PARCH} libcurl*openssl-dev:${PARCH} libfreetype*-dev:${PARCH} libssl-dev:${PARCH} \ + libssl[13].*:${PARCH} liblttng-ust*:${PARCH} \ + && apt-get clean autoclean -y \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* \ + ; fi + +# Prepare dotnet SDK +RUN wget https://packages.microsoft.com/config/${PTYPE}/${PVERSION}/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \ + && dpkg -i packages-microsoft-prod.deb \ + && apt-get -f install \ + && apt-get update \ + && apt-get install -y dotnet-sdk-${DOTNET_VERSION} + +# Prepare nodejs +RUN wget https://deb.nodesource.com/setup_${NODEJS_VERSION}.x -O nodejs-install.sh \ + && chmod +x ./nodejs-install.sh \ + && ./nodejs-install.sh \ + && apt-get install -y \ + nodejs + +# Link to build script +RUN ln -sf ${SOURCE_DIR}/debian/docker/build.sh /build.sh + +VOLUME ${SOURCE_DIR}/ + +VOLUME ${ARTIFACT_DIR}/ + +ENTRYPOINT ["/build.sh"] diff --git a/debian/docker/build.sh b/debian/docker/build.sh new file mode 100755 index 0000000..32533f7 --- /dev/null +++ b/debian/docker/build.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +#= Debian .deb builder + +set -o errexit +set -o xtrace + +# Move to source directory +pushd "${SOURCE_DIR}" + +# Build DEB +if [[ ${ARCH} != $( dpkg --print-architecture ) ]]; then + export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH} + export CONFIG_CROSS="-a ${ARCH}" +fi +dpkg-buildpackage -us -uc ${CONFIG_CROSS} --pre-clean --post-clean + +mkdir -p "${ARTIFACT_DIR}/" +mv ../jellyfin*.{deb,dsc,tar.gz,buildinfo,changes} "${ARTIFACT_DIR}/" + +popd diff --git a/debian/rules b/debian/rules index 8c52b29..678c4d8 100755 --- a/debian/rules +++ b/debian/rules @@ -28,6 +28,8 @@ endif export DH_VERBOSE=1 export DOTNET_CLI_TELEMETRY_OPTOUT=1 +export COMPlus_LTTng=0 +export COMPlus_EnableDiagnostics=0 %: dh $@ @@ -40,11 +42,13 @@ override_dh_auto_build: cd jellyfin-server && dotnet publish -maxcpucount:1 --configuration $(CONFIG) \ --output='$(CURDIR)/build/usr/lib/jellyfin/bin' --self-contained --runtime $(DOTNETRUNTIME) \ -p:DebugSymbols=false -p:DebugType=none Jellyfin.Server + rm $(CURDIR)/build/usr/lib/jellyfin/bin/libcoreclrtraceptprovider.so cd jellyfin-web && npm ci --no-audit --unsafe-perm && \ npm run build:production && mv $(CURDIR)/jellyfin-web/dist $(CURDIR)/build/web override_dh_auto_clean: cd jellyfin-server && dotnet clean -maxcpucount:1 --configuration $(CONFIG) Jellyfin.Server || true + cd jellyfin-server && find . -type d \( -name bin -o -name obj \) -exec rm -r {} \; || true test -d $(CURDIR)/jellyfin-web/dist && \ rm -rf '$(CURDIR)/jellyfin-web/dist' || true test -d $(CURDIR)/jellyfin-web/web && \ @@ -55,3 +59,6 @@ override_dh_auto_clean: override_dh_installinit: dh_installinit --name=jellyfin + +override_dh_shdeplibs: + dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info diff --git a/debian/source/options b/debian/source/options index b7adf56..6640be4 100644 --- a/debian/source/options +++ b/debian/source/options @@ -3,5 +3,11 @@ tar-ignore='**/.git' tar-ignore='**/.hg' tar-ignore='**/.vs' tar-ignore='**/.vscode' -tar-ignore='deployment' -tar-ignore='*.deb' +tar-ignore='**/obj' +tar-ignore='**/bin' +tar-ignore = "out/" +tar-ignore = "fedora/" +tar-ignore = "docker/" +tar-ignore = "*.py" +tar-ignore = "*.md" +tar-ignore = "*.txt" |