jellyfin/.copr/Makefile
Joshua Boniface 218015063b 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.
2019-10-07 22:30:23 -04:00

51 lines
2.0 KiB
Makefile

srpm:
dnf -y install git
git submodule update --init --recursive
cd deployment/fedora-package-x64; \
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)"