Moved rpm package and edited the package slightly, to build the project correctly.

This commit is contained in:
Erwin de Haan 2019-01-11 23:22:50 +01:00
parent 94933722c4
commit 21098eb861
13 changed files with 42 additions and 31 deletions

View File

@ -15,7 +15,7 @@ RUN apt-get update \
WORKDIR ${SOURCEDIR} WORKDIR ${SOURCEDIR}
COPY . . COPY . .
COPY ./deployment/debian-x64/pkg-src ./debian COPY ./deployment/debian-package-x64/pkg-src ./debian
RUN yes | mk-build-deps -i debian/control \ RUN yes | mk-build-deps -i debian/control \
&& dpkg-buildpackage -us -uc && dpkg-buildpackage -us -uc

View File

@ -6,12 +6,10 @@ RUN mkdir /build && \
rpmdev-setuptree rpmdev-setuptree
WORKDIR /build/rpmbuild WORKDIR /build/rpmbuild
COPY jellyfin.spec SPECS COPY ./deployment/fedora-package-x64/pkg-src/jellyfin.spec SPECS
COPY . SOURCES COPY . SOURCES
RUN spectool -g -R SPECS/jellyfin.spec && \ RUN spectool -g -R SPECS/jellyfin.spec && \
rpmbuild -bs SPECS/jellyfin.spec && \ rpmbuild -bs SPECS/jellyfin.spec && \
dnf build-dep -y SRPMS/jellyfin-*.src.rpm && \ dnf build-dep -y SRPMS/jellyfin-*.src.rpm && \
rpmbuild -bb SPECS/jellyfin.spec && \ rpmbuild -bb SPECS/jellyfin.spec;
mkdir /jellyfin && \
find . -name 'jellyfin-*.rpm' -print -exec cp {} /jellyfin \;

View File

@ -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"

View File

@ -54,12 +54,12 @@ popd
%build %build
export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
dotnet build --runtime linux-x64 dotnet build --runtime fedora-x64 Jellyfin.Server
%install %install
export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=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 LICENSE %{buildroot}%{_datadir}/licenses/%{name}/LICENSE
%{__install} -D -m 0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/override.conf %{__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 %{__install} -D -m 0644 Jellyfin.Server/Resources/Configuration/logging.json %{buildroot}%{_sysconfdir}/%{name}/logging.json

View File

@ -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 ../../