Moved rpm package and edited the package slightly, to build the project correctly.
This commit is contained in:
parent
94933722c4
commit
21098eb861
|
@ -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
|
||||
|
|
|
@ -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 \;
|
||||
rpmbuild -bb SPECS/jellyfin.spec;
|
37
deployment/fedora-package-x64/package.sh
Normal file
37
deployment/fedora-package-x64/package.sh
Normal 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"
|
|
@ -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
|
0
rpm-package/restart.sh → deployment/fedora-package-x64/pkg-src/restart.sh
Executable file → Normal file
0
rpm-package/restart.sh → deployment/fedora-package-x64/pkg-src/restart.sh
Executable file → Normal 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 ../../
|
Loading…
Reference in New Issue
Block a user