aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Boniface <joshua@boniface.me>2019-10-07 22:29:31 -0400
committerJoshua Boniface <joshua@boniface.me>2019-10-07 22:30:23 -0400
commit218015063b18aaaae2de51f2e77cf451757dc874 (patch)
tree63403de28c2d77423cc8aefede918672a4180859
parentd8c3b26fa686e440912a45d82bb9866b4b66822c (diff)
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.
-rw-r--r--.copr/Makefile44
1 files changed, 43 insertions, 1 deletions
diff --git a/.copr/Makefile b/.copr/Makefile
index 84b98a011..6c1f9a3c4 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)"