diff --git a/deployment/debian-package-x64/Dockerfile b/deployment/debian-package-x64/Dockerfile index 0de62f72b..2afe6c1d3 100644 --- a/deployment/debian-package-x64/Dockerfile +++ b/deployment/debian-package-x64/Dockerfile @@ -15,7 +15,7 @@ RUN apt-get update \ WORKDIR ${SOURCEDIR} COPY . . -COPY ./deployment/debian-x64/pkg-src ./debian +COPY ./deployment/debian-package-x64/pkg-src ./debian RUN yes | mk-build-deps -i debian/control \ && dpkg-buildpackage -us -uc diff --git a/rpm-package/Dockerfile.fedora_package b/deployment/fedora-package-x64/Dockerfile similarity index 70% rename from rpm-package/Dockerfile.fedora_package rename to deployment/fedora-package-x64/Dockerfile index 35650106d..64367d127 100644 --- a/rpm-package/Dockerfile.fedora_package +++ b/deployment/fedora-package-x64/Dockerfile @@ -6,12 +6,10 @@ RUN mkdir /build && \ rpmdev-setuptree WORKDIR /build/rpmbuild -COPY jellyfin.spec SPECS +COPY ./deployment/fedora-package-x64/pkg-src/jellyfin.spec SPECS COPY . SOURCES RUN spectool -g -R SPECS/jellyfin.spec && \ rpmbuild -bs SPECS/jellyfin.spec && \ dnf build-dep -y SRPMS/jellyfin-*.src.rpm && \ - rpmbuild -bb SPECS/jellyfin.spec && \ - mkdir /jellyfin && \ - find . -name 'jellyfin-*.rpm' -print -exec cp {} /jellyfin \; \ No newline at end of file + rpmbuild -bb SPECS/jellyfin.spec; \ No newline at end of file diff --git a/deployment/fedora-package-x64/package.sh b/deployment/fedora-package-x64/package.sh new file mode 100644 index 000000000..6f18b8cc3 --- /dev/null +++ b/deployment/fedora-package-x64/package.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env sh + +source ../common.build.sh + +VERSION=`get_version ../..` + +# TODO get the version in the package automatically. And using the changelog to decide the debian package suffix version. + +# Build a Jellyfin .rpm file with Docker on Linux +# Places the output .rpm file in the parent directory + +set -o errexit +set -o xtrace +set -o nounset + +package_temporary_dir="`pwd`/pkg-dist-tmp" +output_dir="`pwd`/pkg-dist" +current_user="`whoami`" +image_name="jellyfin-rpmbuild" + +cleanup() { + set +o errexit + docker image rm $image_name --force + rm -rf "$package_temporary_dir" +} +trap cleanup EXIT INT + +docker build ../.. -t "$image_name" -f ./Dockerfile.fedora_package +mkdir -p "$package_temporary_dir" +mkdir -p "$output_dir" +docker run --rm -v "$package_temporary_dir:/temp" "$image_name" sh -c 'find / -maxdepth 1 -type f -name "jellyfin*" -exec mv {} /temp \;' +chown -R "$current_user" "$package_temporary_dir" +if [ $? -ne 0 ]; then + # Some platforms need this to chown the file properly. (Platforms with native docker, not just the client) + sudo chown -R "$current_user" "$package_temporary_dir" +fi +mv "$package_temporary_dir"/* "$output_dir" diff --git a/rpm-package/.gitignore b/deployment/fedora-package-x64/pkg-src/.gitignore similarity index 100% rename from rpm-package/.gitignore rename to deployment/fedora-package-x64/pkg-src/.gitignore diff --git a/rpm-package/README.md b/deployment/fedora-package-x64/pkg-src/README.md similarity index 100% rename from rpm-package/README.md rename to deployment/fedora-package-x64/pkg-src/README.md diff --git a/rpm-package/jellyfin-firewalld.xml b/deployment/fedora-package-x64/pkg-src/jellyfin-firewalld.xml similarity index 100% rename from rpm-package/jellyfin-firewalld.xml rename to deployment/fedora-package-x64/pkg-src/jellyfin-firewalld.xml diff --git a/rpm-package/jellyfin.env b/deployment/fedora-package-x64/pkg-src/jellyfin.env similarity index 100% rename from rpm-package/jellyfin.env rename to deployment/fedora-package-x64/pkg-src/jellyfin.env diff --git a/rpm-package/jellyfin.override.conf b/deployment/fedora-package-x64/pkg-src/jellyfin.override.conf similarity index 100% rename from rpm-package/jellyfin.override.conf rename to deployment/fedora-package-x64/pkg-src/jellyfin.override.conf diff --git a/rpm-package/jellyfin.service b/deployment/fedora-package-x64/pkg-src/jellyfin.service similarity index 100% rename from rpm-package/jellyfin.service rename to deployment/fedora-package-x64/pkg-src/jellyfin.service diff --git a/rpm-package/jellyfin.spec b/deployment/fedora-package-x64/pkg-src/jellyfin.spec similarity index 97% rename from rpm-package/jellyfin.spec rename to deployment/fedora-package-x64/pkg-src/jellyfin.spec index ff5725f87..b008ec834 100644 --- a/rpm-package/jellyfin.spec +++ b/deployment/fedora-package-x64/pkg-src/jellyfin.spec @@ -54,12 +54,12 @@ popd %build export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 -dotnet build --runtime linux-x64 +dotnet build --runtime fedora-x64 Jellyfin.Server %install export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 -dotnet publish --configuration Release --output='%{buildroot}%{_libdir}/jellyfin' --self-contained --runtime linux-x64 +dotnet publish --configuration Release --output='%{buildroot}%{_libdir}/jellyfin' --self-contained --runtime fedora-x64 Jellyfin.Server %{__install} -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/%{name}/LICENSE %{__install} -D -m 0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/override.conf %{__install} -D -m 0644 Jellyfin.Server/Resources/Configuration/logging.json %{buildroot}%{_sysconfdir}/%{name}/logging.json diff --git a/rpm-package/jellyfin.sudoers b/deployment/fedora-package-x64/pkg-src/jellyfin.sudoers similarity index 100% rename from rpm-package/jellyfin.sudoers rename to deployment/fedora-package-x64/pkg-src/jellyfin.sudoers diff --git a/rpm-package/restart.sh b/deployment/fedora-package-x64/pkg-src/restart.sh old mode 100755 new mode 100644 similarity index 100% rename from rpm-package/restart.sh rename to deployment/fedora-package-x64/pkg-src/restart.sh diff --git a/rpm-package/build-fedora-rpm.sh b/rpm-package/build-fedora-rpm.sh deleted file mode 100755 index 87c94e081..000000000 --- a/rpm-package/build-fedora-rpm.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env sh - -# Build a Jellyfin .rpm file with Docker on Linux -# Places the output .rpm file in the parent directory - -set -o errexit -set -o xtrace -set -o nounset - -package_temporary_dir="`mktemp -d`" -current_user="`whoami`" -image_name="jellyfin-rpmbuild" - -cleanup() { - set +o errexit - docker image rm $image_name --force - rm -rf "$package_temporary_dir" -} -trap cleanup EXIT INT - -docker build . -t "$image_name" -f ./Dockerfile.fedora_package -docker run --rm -v "$package_temporary_dir:/temp" "$image_name" cp -r /jellyfin /temp/ -sudo chown -R "$current_user" "$package_temporary_dir" -mv "$package_temporary_dir"/jellyfin/*.rpm ../../