0504ed9fe6
* Remove additional dotnet-preview repo from Makefile
* Repo doesn't seem maintained, and maintainers actively discourage
the usage in production in its description
* Considering this, we should build with stable .NET releases, which
Fedora and RHEL 8+ repos already provide
* Use Fedora-version-specific runtime-identifier for `dotnet publish`
* This has no actual effect right now judging by the [RID
catalog](3efd59151a/docs/core/rid-catalog.md
),
so this is just future proofing.
* Remove AutoReqProv
* There's rarely a reason to use this feature, this is not one of them
* In the [proposal of this
feature](https://fedoraproject.org/wiki/AutoReqProv_(draft)#Usage)
it is stated that this is not to be used on packages with binaries
in /usr/bin and others, which is the case in this package.
* also didn't seem to work since we were still having dependency
issues with implicit dependencies (see jellyfin/jellyfin#7471 )
* Removed DOTNET_SKIP_FIRST_TIME_EXPERIENCE as it is unused in .NET SDK
* see dotnet/sdk#9945
* it's already merged for removal in future versions
* Move building process `dotnet publish` to %build section
* Also removed `--output` from this due to an outstanding bug on SDK's
side. This also separates building and installing as intended
* define LICENSE as %license, which automatically puts it in a
standardised directory
53 lines
2.1 KiB
Makefile
53 lines
2.1 KiB
Makefile
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)
|
|
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/
|
|
|
|
fed_ver := $(shell rpm -E %fedora)
|
|
# fallback when not running on Fedora
|
|
fed_ver ?= 36
|
|
TARGET ?= fedora-$(fed_ver)-x86_64
|
|
|
|
outdir ?= $(PWD)/$(DIR)/
|
|
|
|
srpm: $(DIR)/$(SRPM)
|
|
tarball: $(DIR)/$(TARBALL)
|
|
|
|
$(DIR)/$(TARBALL):
|
|
cd $(DIR)/; \
|
|
SOURCE_DIR=.. \
|
|
WORKDIR="$${PWD}"; \
|
|
version=$(VERSION); \
|
|
tar \
|
|
--transform "s,^\.,$(NAME)-$(subst -,~,$(VERSION))," \
|
|
--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
|
|
cd $(DIR)/; \
|
|
rpmbuild -bs jellyfin.spec \
|
|
--define "_sourcedir $$PWD/" \
|
|
--define "_srcrpmdir $(outdir)"
|
|
|
|
rpms: $(DIR)/$(SRPM)
|
|
mock $(addprefix --addrepo=, $($(TARGET)_repos)) \
|
|
--enable-network \
|
|
-r $(TARGET) $<
|