commit
588b554ef0
|
@ -12,17 +12,13 @@ ENV ARTIFACT_DIR=/dist
|
||||||
RUN dnf update -y
|
RUN dnf update -y
|
||||||
|
|
||||||
# Install build dependencies
|
# Install build dependencies
|
||||||
RUN dnf install -y @buildsys-build rpmdevtools dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel nodejs wget git
|
RUN dnf install -y @buildsys-build rpmdevtools dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel nodejs-yarn
|
||||||
|
|
||||||
# Install DotNET SDK
|
# Install DotNET SDK
|
||||||
RUN dnf copr enable -y @dotnet-sig/dotnet \
|
RUN dnf copr enable -y @dotnet-sig/dotnet \
|
||||||
&& rpmdev-setuptree \
|
&& rpmdev-setuptree \
|
||||||
&& dnf install -y dotnet-sdk-${SDK_VERSION} dotnet-runtime-${SDK_VERSION}
|
&& dnf install -y dotnet-sdk-${SDK_VERSION} dotnet-runtime-${SDK_VERSION}
|
||||||
|
|
||||||
# Install yarn package manager
|
|
||||||
RUN wget -q -O /etc/yum.repos.d/yarn.repo https://dl.yarnpkg.com/rpm/yarn.repo \
|
|
||||||
&& dnf install -y yarn
|
|
||||||
|
|
||||||
# Create symlinks and directories
|
# Create symlinks and directories
|
||||||
RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh \
|
RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh \
|
||||||
&& mkdir -p ${SOURCE_DIR}/SPECS \
|
&& mkdir -p ${SOURCE_DIR}/SPECS \
|
||||||
|
|
|
@ -8,60 +8,9 @@ set -o xtrace
|
||||||
# Move to source directory
|
# Move to source directory
|
||||||
pushd ${SOURCE_DIR}
|
pushd ${SOURCE_DIR}
|
||||||
|
|
||||||
VERSION="$( grep '^Version:' ${SOURCE_DIR}/SOURCES/pkg-src/jellyfin.spec | awk '{ print $NF }' )"
|
|
||||||
|
|
||||||
# Create RPM source archive
|
|
||||||
GNU_TAR=1
|
|
||||||
echo "Bundling all sources for RPM build."
|
|
||||||
tar \
|
|
||||||
--transform "s,^\.,jellyfin-${VERSION}," \
|
|
||||||
--exclude='.git*' \
|
|
||||||
--exclude='**/.git' \
|
|
||||||
--exclude='**/.hg' \
|
|
||||||
--exclude='**/.vs' \
|
|
||||||
--exclude='**/.vscode' \
|
|
||||||
--exclude='deployment' \
|
|
||||||
--exclude='**/bin' \
|
|
||||||
--exclude='**/obj' \
|
|
||||||
--exclude='**/.nuget' \
|
|
||||||
--exclude='*.deb' \
|
|
||||||
--exclude='*.rpm' \
|
|
||||||
-czf "${SOURCE_DIR}/SOURCES/pkg-src/jellyfin-${VERSION}.tar.gz" \
|
|
||||||
-C ${SOURCE_DIR} ./ || GNU_TAR=0
|
|
||||||
|
|
||||||
if [ $GNU_TAR -eq 0 ]; then
|
|
||||||
echo "The installed tar binary did not support --transform. Using workaround."
|
|
||||||
package_temporary_dir="$( mktemp -d )"
|
|
||||||
mkdir -p "${package_temporary_dir}/jellyfin"
|
|
||||||
# Not GNU tar
|
|
||||||
tar \
|
|
||||||
--exclude='.git*' \
|
|
||||||
--exclude='**/.git' \
|
|
||||||
--exclude='**/.hg' \
|
|
||||||
--exclude='**/.vs' \
|
|
||||||
--exclude='**/.vscode' \
|
|
||||||
--exclude='deployment' \
|
|
||||||
--exclude='**/bin' \
|
|
||||||
--exclude='**/obj' \
|
|
||||||
--exclude='**/.nuget' \
|
|
||||||
--exclude='*.deb' \
|
|
||||||
--exclude='*.rpm' \
|
|
||||||
-czf "${package_temporary_dir}/jellyfin/jellyfin-${VERSION}.tar.gz" \
|
|
||||||
-C ${SOURCE_DIR} ./
|
|
||||||
echo "Extracting filtered package."
|
|
||||||
mkdir -p "${package_temporary_dir}/jellyfin-${VERSION}"
|
|
||||||
tar -xzf "${package_temporary_dir}/jellyfin/jellyfin-${VERSION}.tar.gz" -C "${package_temporary_dir}/jellyfin-${VERSION}"
|
|
||||||
echo "Removing filtered package."
|
|
||||||
rm -f "${package_temporary_dir}/jellyfin/jellyfin-${VERSION}.tar.gz"
|
|
||||||
echo "Repackaging package into final tarball."
|
|
||||||
tar -czf "${SOURCE_DIR}/SOURCES/pkg-src/jellyfin-${VERSION}.tar.gz" -C "${package_temporary_dir}" "jellyfin-${VERSION}"
|
|
||||||
rm -rf ${package_temporary_dir}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Build RPM
|
# Build RPM
|
||||||
spectool -g -R SPECS/jellyfin.spec
|
make -f .copr/Makefile srpm outdir=/root/rpmbuild/SRPMS
|
||||||
rpmbuild -bs SPECS/jellyfin.spec --define "_sourcedir ${SOURCE_DIR}/SOURCES/pkg-src/"
|
rpmbuild -rb /root/rpmbuild/SRPMS/jellyfin-*.src.rpm
|
||||||
rpmbuild -bb SPECS/jellyfin.spec --define "_sourcedir ${SOURCE_DIR}/SOURCES/pkg-src/"
|
|
||||||
|
|
||||||
# Move the artifacts out
|
# Move the artifacts out
|
||||||
mkdir -p ${ARTIFACT_DIR}/rpm
|
mkdir -p ${ARTIFACT_DIR}/rpm
|
||||||
|
|
|
@ -12,8 +12,10 @@ Release: 1%{?dist}
|
||||||
Summary: The Free Software Media Browser
|
Summary: The Free Software Media Browser
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
URL: https://jellyfin.media
|
URL: https://jellyfin.media
|
||||||
Source0: %{name}-%{version}.tar.gz
|
# Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `v%{version}.tar.gz`
|
||||||
Source1: https://github.com/%{name}/%{name}-web/archive/v%{version}.tar.gz
|
Source0: https://github.com/%{name}/%{name}/archive/%{name}-%{version}.tar.gz
|
||||||
|
# Jellyfin Webinterface downloaded by `make -f .copr/Makefile srpm`, real URL ends with `v%{version}.tar.gz`
|
||||||
|
Source1: https://github.com/%{name}/%{name}-web/archive/%{name}-web-%{version}.tar.gz
|
||||||
Source11: jellyfin.service
|
Source11: jellyfin.service
|
||||||
Source12: jellyfin.env
|
Source12: jellyfin.env
|
||||||
Source13: jellyfin.sudoers
|
Source13: jellyfin.sudoers
|
||||||
|
@ -40,9 +42,6 @@ BuildRequires: dotnet-runtime-2.2, dotnet-sdk-2.2
|
||||||
# RPMfusion free
|
# RPMfusion free
|
||||||
Requires: ffmpeg
|
Requires: ffmpeg
|
||||||
|
|
||||||
# Fedora has openssl1.1 which is incompatible with dotnet
|
|
||||||
%{?fedora:Requires: compat-openssl10}
|
|
||||||
|
|
||||||
# Disable Automatic Dependency Processing
|
# Disable Automatic Dependency Processing
|
||||||
AutoReqProv: no
|
AutoReqProv: no
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user