Merge pull request #6 from Wuerfelbecher/copr-fix

Fix build script
This commit is contained in:
Joshua M. Boniface 2019-10-26 16:48:38 -04:00 committed by GitHub
commit 588b554ef0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 63 deletions

View File

@ -12,17 +12,13 @@ ENV ARTIFACT_DIR=/dist
RUN dnf update -y
# 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
RUN dnf copr enable -y @dotnet-sig/dotnet \
&& rpmdev-setuptree \
&& 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
RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh \
&& mkdir -p ${SOURCE_DIR}/SPECS \

View File

@ -8,60 +8,9 @@ set -o xtrace
# Move to source directory
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
spectool -g -R SPECS/jellyfin.spec
rpmbuild -bs SPECS/jellyfin.spec --define "_sourcedir ${SOURCE_DIR}/SOURCES/pkg-src/"
rpmbuild -bb SPECS/jellyfin.spec --define "_sourcedir ${SOURCE_DIR}/SOURCES/pkg-src/"
make -f .copr/Makefile srpm outdir=/root/rpmbuild/SRPMS
rpmbuild -rb /root/rpmbuild/SRPMS/jellyfin-*.src.rpm
# Move the artifacts out
mkdir -p ${ARTIFACT_DIR}/rpm

View File

@ -12,8 +12,10 @@ Release: 1%{?dist}
Summary: The Free Software Media Browser
License: GPLv2
URL: https://jellyfin.media
Source0: %{name}-%{version}.tar.gz
Source1: https://github.com/%{name}/%{name}-web/archive/v%{version}.tar.gz
# Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `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
Source12: jellyfin.env
Source13: jellyfin.sudoers
@ -40,9 +42,6 @@ BuildRequires: dotnet-runtime-2.2, dotnet-sdk-2.2
# RPMfusion free
Requires: ffmpeg
# Fedora has openssl1.1 which is incompatible with dotnet
%{?fedora:Requires: compat-openssl10}
# Disable Automatic Dependency Processing
AutoReqProv: no