From 296a61cbc43d1c42c80ceef73bb92f3014f98f03 Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Sat, 11 Dec 2021 19:26:00 -0500 Subject: 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 ++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 22 deletions(-) (limited to 'fedora/Makefile') 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) $< -- cgit v1.2.3 From 543b0127b363d3fd371eb08166633ba6e0d2f9bd Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Tue, 14 Dec 2021 12:52:48 -0500 Subject: Fix build on EL7 Add /usr/local/bin to $PATH. Update fedora/Makefile with enhancements from jellyfin-web. --- .copr | 1 + .copr/Makefile | 1 - fedora/Makefile | 82 ++++++++++++++++++++++++++++++---------------------- fedora/jellyfin.spec | 1 + 4 files changed, 50 insertions(+), 35 deletions(-) create mode 120000 .copr delete mode 120000 .copr/Makefile (limited to 'fedora/Makefile') diff --git a/.copr b/.copr new file mode 120000 index 0000000000..100fe0cd7b --- /dev/null +++ b/.copr @@ -0,0 +1 @@ +fedora \ No newline at end of file diff --git a/.copr/Makefile b/.copr/Makefile deleted file mode 120000 index ec3c90dfd9..0000000000 --- a/.copr/Makefile +++ /dev/null @@ -1 +0,0 @@ -../fedora/Makefile \ No newline at end of file diff --git a/fedora/Makefile b/fedora/Makefile index 6b09458b54..22cc30448d 100644 --- a/fedora/Makefile +++ b/fedora/Makefile @@ -1,41 +1,55 @@ -VERSION := $(shell sed -ne '/^Version:/s/.* *//p' fedora/jellyfin.spec) -outdir ?= fedora/ +DIR := $(dir $(lastword $(MAKEFILE_LIST))) +INSTGIT := $(shell if [ "$$(id -u)" = "0" ]; then dnf -y install git; fi) +NAME := jellyfin-server +VERSION := $(shell sed -ne '/^Version:/s/.* *//p' $(DIR)/jellyfin.spec) +RELEASE := $(shell sed -ne '/^Release:/s/.* *\(.*\)%{.*}.*/\1/p' $(DIR)/jellyfin.spec) +GIT_VER := $(shell git describe --tags | sed -e 's/^v//' -e 's/-[0-9]*-g.*$$//') +SRPM := jellyfin-$(subst -,~,$(GIT_VER))-$(RELEASE)$(shell rpm --eval %dist).src.rpm +TARBALL :=$(NAME)-$(subst -,~,$(GIT_VER)).tar.gz + +epel-7-x86_64_repos := https://packages.microsoft.com/rhel/7/prod/ +epel-8-x86_64_repos := https://download.copr.fedorainfracloud.org/results/@dotnet-sig/dotnet-preview/$(TARGET)/ +fedora_repos := https://download.copr.fedorainfracloud.org/results/@dotnet-sig/dotnet-preview/$(TARGET)/ +fedora-34-x86_64_repos := $(fedora_repos) +fedora-35-x86_64_repos := $(fedora_repos) +fedora-34-x86_64_repos := $(fedora_repos) + +outdir ?= $(PWD)/$(DIR)/ TARGET ?= fedora-35-x86_64 -srpm: - 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/; \ +srpm: $(DIR)/$(SRPM) +tarball: $(DIR)/$(TARBALL) + +$(DIR)/$(TARBALL): + cd $(DIR)/; \ + SOURCE_DIR=.. \ + WORKDIR="$${PWD}"; \ + version=$(GIT_VER); \ + tar \ + --transform "s,^\.,$(NAME)-$(subst -,~,$(GIT_VER))," \ + --exclude='.git*' \ + --exclude='**/.git' \ + --exclude='**/.hg' \ + --exclude='**/.vs' \ + --exclude='**/.vscode' \ + --exclude=deployment \ + --exclude='**/bin' \ + --exclude='**/obj' \ + --exclude='**/.nuget' \ + --exclude='*.deb' \ + --exclude='*.rpm' \ + --exclude=$(notdir $@) \ + -czf $(notdir $@) \ + -C $${SOURCE_DIR} ./ + +$(DIR)/$(SRPM): $(DIR)/$(TARBALL) $(DIR)/jellyfin.spec + ./bump_version $(GIT_VER) + cd $(DIR)/; \ 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 \ +rpms: $(DIR)/$(SRPM) + mock $(addprefix --addrepo=, $($(TARGET)_repos)) \ + --enable-network \ -r $(TARGET) $< diff --git a/fedora/jellyfin.spec b/fedora/jellyfin.spec index a4584364ef..e93944a205 100644 --- a/fedora/jellyfin.spec +++ b/fedora/jellyfin.spec @@ -64,6 +64,7 @@ the Jellyfin server to bind to ports 80 and/or 443 for example. %install export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +export PATH=$PATH:/usr/local/bin dotnet publish --configuration Release --output='%{buildroot}%{_libdir}/jellyfin' --self-contained --runtime %{dotnet_runtime} \ "-p:DebugSymbols=false;DebugType=none" Jellyfin.Server %{__install} -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/jellyfin/LICENSE -- cgit v1.2.3 From 226a43619f6427c6f816f48b495e31eca3a58a46 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Thu, 30 Dec 2021 16:54:59 -0500 Subject: Fix fedora build version --- fedora/Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'fedora/Makefile') diff --git a/fedora/Makefile b/fedora/Makefile index 22cc30448d..261fd262d8 100644 --- a/fedora/Makefile +++ b/fedora/Makefile @@ -3,9 +3,8 @@ INSTGIT := $(shell if [ "$$(id -u)" = "0" ]; then dnf -y install git; fi) NAME := jellyfin-server VERSION := $(shell sed -ne '/^Version:/s/.* *//p' $(DIR)/jellyfin.spec) RELEASE := $(shell sed -ne '/^Release:/s/.* *\(.*\)%{.*}.*/\1/p' $(DIR)/jellyfin.spec) -GIT_VER := $(shell git describe --tags | sed -e 's/^v//' -e 's/-[0-9]*-g.*$$//') -SRPM := jellyfin-$(subst -,~,$(GIT_VER))-$(RELEASE)$(shell rpm --eval %dist).src.rpm -TARBALL :=$(NAME)-$(subst -,~,$(GIT_VER)).tar.gz +SRPM := jellyfin-$(subst -,~,$(VERSION))-$(RELEASE)$(shell rpm --eval %dist).src.rpm +TARBALL :=$(NAME)-$(subst -,~,$(VERSION)).tar.gz epel-7-x86_64_repos := https://packages.microsoft.com/rhel/7/prod/ epel-8-x86_64_repos := https://download.copr.fedorainfracloud.org/results/@dotnet-sig/dotnet-preview/$(TARGET)/ @@ -24,9 +23,9 @@ $(DIR)/$(TARBALL): cd $(DIR)/; \ SOURCE_DIR=.. \ WORKDIR="$${PWD}"; \ - version=$(GIT_VER); \ + version=$(VERSION); \ tar \ - --transform "s,^\.,$(NAME)-$(subst -,~,$(GIT_VER))," \ + --transform "s,^\.,$(NAME)-$(subst -,~,$(VERSION))," \ --exclude='.git*' \ --exclude='**/.git' \ --exclude='**/.hg' \ @@ -43,7 +42,6 @@ $(DIR)/$(TARBALL): -C $${SOURCE_DIR} ./ $(DIR)/$(SRPM): $(DIR)/$(TARBALL) $(DIR)/jellyfin.spec - ./bump_version $(GIT_VER) cd $(DIR)/; \ rpmbuild -bs jellyfin.spec \ --define "_sourcedir $$PWD/" \ -- cgit v1.2.3