Fix build on EL7

Add /usr/local/bin to $PATH.

Update fedora/Makefile with enhancements from jellyfin-web.
This commit is contained in:
Brian J. Murrell 2021-12-14 12:52:48 -05:00
parent 2c6d6dbbf8
commit 543b0127b3
4 changed files with 50 additions and 35 deletions

1
.copr Symbolic link
View File

@ -0,0 +1 @@
fedora

View File

@ -1 +0,0 @@
../fedora/Makefile

View File

@ -1,41 +1,55 @@
VERSION := $(shell sed -ne '/^Version:/s/.* *//p' fedora/jellyfin.spec) DIR := $(dir $(lastword $(MAKEFILE_LIST)))
outdir ?= fedora/ 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 TARGET ?= fedora-35-x86_64
srpm: srpm: $(DIR)/$(SRPM)
pushd fedora/; \ tarball: $(DIR)/$(TARBALL)
if [ "$$(id -u)" = "0" ]; then \
dnf -y install git; \ $(DIR)/$(TARBALL):
fi; \ cd $(DIR)/; \
version=$$(git describe --tags | sed -e 's/^v//' \ SOURCE_DIR=.. \
-e 's/-[0-9]*-g.*$$//' \ WORKDIR="$${PWD}"; \
-e 's/-/~/'); \ version=$(GIT_VER); \
SOURCE_DIR=.. \ tar \
WORKDIR="$${PWD}"; \ --transform "s,^\.,$(NAME)-$(subst -,~,$(GIT_VER))," \
tar \ --exclude='.git*' \
--transform "s,^\.,jellyfin-server-$$version," \ --exclude='**/.git' \
--exclude='.git*' \ --exclude='**/.hg' \
--exclude='**/.git' \ --exclude='**/.vs' \
--exclude='**/.hg' \ --exclude='**/.vscode' \
--exclude='**/.vs' \ --exclude=deployment \
--exclude='**/.vscode' \ --exclude='**/bin' \
--exclude=deployment \ --exclude='**/obj' \
--exclude='**/bin' \ --exclude='**/.nuget' \
--exclude='**/obj' \ --exclude='*.deb' \
--exclude='**/.nuget' \ --exclude='*.rpm' \
--exclude='*.deb' \ --exclude=$(notdir $@) \
--exclude='*.rpm' \ -czf $(notdir $@) \
--exclude=jellyfin-server-$$version.tar.gz \ -C $${SOURCE_DIR} ./
-czf "jellyfin-server-$$version.tar.gz" \
-C $${SOURCE_DIR} ./; \ $(DIR)/$(SRPM): $(DIR)/$(TARBALL) $(DIR)/jellyfin.spec
popd; \ ./bump_version $(GIT_VER)
./bump_version $$version cd $(DIR)/; \
cd fedora/; \
rpmbuild -bs jellyfin.spec \ rpmbuild -bs jellyfin.spec \
--define "_sourcedir $$PWD/" \ --define "_sourcedir $$PWD/" \
--define "_srcrpmdir $(outdir)" --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 rpms: $(DIR)/$(SRPM)
mock --addrepo=https://download.copr.fedorainfracloud.org/results/@dotnet-sig/dotnet-preview/$(TARGET)/ \ mock $(addprefix --addrepo=, $($(TARGET)_repos)) \
--enable-network \ --enable-network \
-r $(TARGET) $< -r $(TARGET) $<

View File

@ -64,6 +64,7 @@ the Jellyfin server to bind to ports 80 and/or 443 for example.
%install %install
export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=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} \ dotnet publish --configuration Release --output='%{buildroot}%{_libdir}/jellyfin' --self-contained --runtime %{dotnet_runtime} \
"-p:DebugSymbols=false;DebugType=none" Jellyfin.Server "-p:DebugSymbols=false;DebugType=none" Jellyfin.Server
%{__install} -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/jellyfin/LICENSE %{__install} -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/jellyfin/LICENSE