From 296a61cbc43d1c42c80ceef73bb92f3014f98f03 Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Sat, 11 Dec 2021 19:26:00 -0500 Subject: [PATCH] Run bump_version in make srpm Also add an "rpms" target that builds the RPMs using mock in a target environment. Signed-off-by: Brian J. Murrell --- fedora/Makefile | 59 +++++++++++++++++++++++++++----------------- fedora/jellyfin.spec | 2 +- 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/fedora/Makefile b/fedora/Makefile index 97904ddd35..6b09458b54 100644 --- a/fedora/Makefile +++ b/fedora/Makefile @@ -1,26 +1,41 @@ VERSION := $(shell sed -ne '/^Version:/s/.* *//p' fedora/jellyfin.spec) +outdir ?= fedora/ +TARGET ?= fedora-35-x86_64 srpm: - cd fedora/; \ - SOURCE_DIR=.. \ - WORKDIR="$${PWD}"; \ - tar \ - --transform "s,^\.,jellyfin-server-$(VERSION)," \ - --exclude='.git*' \ - --exclude='**/.git' \ - --exclude='**/.hg' \ - --exclude='**/.vs' \ - --exclude='**/.vscode' \ - --exclude='deployment' \ - --exclude='**/bin' \ - --exclude='**/obj' \ - --exclude='**/.nuget' \ - --exclude='*.deb' \ - --exclude='*.rpm' \ - --exclude='jellyfin-server-$(VERSION).tar.gz' \ - -czf "jellyfin-server-$(VERSION).tar.gz" \ - -C $${SOURCE_DIR} ./ - cd fedora/; \ - rpmbuild -bs jellyfin.spec \ - --define "_sourcedir $$PWD/" \ + pushd fedora/; \ + if [ "$$(id -u)" = "0" ]; then \ + dnf -y install git; \ + fi; \ + version=$$(git describe --tags | sed -e 's/^v//' \ + -e 's/-[0-9]*-g.*$$//' \ + -e 's/-/~/'); \ + SOURCE_DIR=.. \ + WORKDIR="$${PWD}"; \ + tar \ + --transform "s,^\.,jellyfin-server-$$version," \ + --exclude='.git*' \ + --exclude='**/.git' \ + --exclude='**/.hg' \ + --exclude='**/.vs' \ + --exclude='**/.vscode' \ + --exclude=deployment \ + --exclude='**/bin' \ + --exclude='**/obj' \ + --exclude='**/.nuget' \ + --exclude='*.deb' \ + --exclude='*.rpm' \ + --exclude=jellyfin-server-$$version.tar.gz \ + -czf "jellyfin-server-$$version.tar.gz" \ + -C $${SOURCE_DIR} ./; \ + popd; \ + ./bump_version $$version + cd fedora/; \ + rpmbuild -bs jellyfin.spec \ + --define "_sourcedir $$PWD/" \ --define "_srcrpmdir $(outdir)" + +rpms: fedora/jellyfin-$(shell git describe --tags | sed -e 's/^v//' -e 's/-[0-9]*-g.*$$//' -e 's/-/~/')-1$(shell rpm --eval %dist).src.rpm + mock --addrepo=https://download.copr.fedorainfracloud.org/results/@dotnet-sig/dotnet-preview/$(TARGET)/ \ + --enable-network \ + -r $(TARGET) $< diff --git a/fedora/jellyfin.spec b/fedora/jellyfin.spec index 47dee7c13f..acc6100f63 100644 --- a/fedora/jellyfin.spec +++ b/fedora/jellyfin.spec @@ -12,7 +12,7 @@ Release: 1%{?dist} Summary: The Free Software Media System License: GPLv3 URL: https://jellyfin.org -# Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `v%{version}.tar.gz` +# Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `v%%{version}.tar.gz` Source0: jellyfin-server-%{version}.tar.gz Source11: jellyfin.service Source12: jellyfin.env