From 218015063b18aaaae2de51f2e77cf451757dc874 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Mon, 7 Oct 2019 22:29:31 -0400 Subject: [PATCH] Port former create_tarball into COPR Makefile This script was removed in #1793; instead of restoring it, instead implement its functionality directly in the COPR Makefile. --- .copr/Makefile | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/.copr/Makefile b/.copr/Makefile index 84b98a0116..6c1f9a3c43 100644 --- a/.copr/Makefile +++ b/.copr/Makefile @@ -2,7 +2,49 @@ srpm: dnf -y install git git submodule update --init --recursive cd deployment/fedora-package-x64; \ - ./create_tarball.sh; \ + WORKDIR="$( pwd )"; \ + VERSION="$( sed -ne '/^Version:/s/.* *//p' "${WORKDIR}"/pkg-src/jellyfin.spec )"; \ + package_temporary_dir="${WORKDIR}/pkg-dist-tmp"; \ + pkg_src_dir="${WORKDIR}/pkg-src"; \ + GNU_TAR=1; \ + 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 + package_temporary_dir="$( mktemp -d )"; \ + mkdir -p "${package_temporary_dir}/jellyfin"; \ + 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} ./; \ + mkdir -p "${package_temporary_dir}/jellyfin-${VERSION}"; \ + tar -xzf "${package_temporary_dir}/jellyfin/jellyfin-${VERSION}.tar.gz" -C "${package_temporary_dir}/jellyfin-${VERSION}"; \ + rm -f "${package_temporary_dir}/jellyfin/jellyfin-${VERSION}.tar.gz"; \ + tar -czf "${SOURCE_DIR}/SOURCES/pkg-src/jellyfin-${VERSION}.tar.gz" -C "${package_temporary_dir}" "jellyfin-${VERSION}"; \ + rm -rf ${package_temporary_dir}; \ + fi; \ rpmbuild -bs pkg-src/jellyfin.spec \ --define "_sourcedir $$PWD/pkg-src/" \ --define "_srcrpmdir $(outdir)"