2021-12-14 17:52:48 +00:00
|
|
|
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)
|
2021-12-30 21:54:59 +00:00
|
|
|
SRPM := jellyfin-$(subst -,~,$(VERSION))-$(RELEASE)$(shell rpm --eval %dist).src.rpm
|
|
|
|
TARBALL :=$(NAME)-$(subst -,~,$(VERSION)).tar.gz
|
2021-12-14 17:52:48 +00:00
|
|
|
|
|
|
|
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)/
|
2021-12-12 00:26:00 +00:00
|
|
|
TARGET ?= fedora-35-x86_64
|
2020-03-23 20:28:49 +00:00
|
|
|
|
2021-12-14 17:52:48 +00:00
|
|
|
srpm: $(DIR)/$(SRPM)
|
|
|
|
tarball: $(DIR)/$(TARBALL)
|
|
|
|
|
|
|
|
$(DIR)/$(TARBALL):
|
|
|
|
cd $(DIR)/; \
|
|
|
|
SOURCE_DIR=.. \
|
|
|
|
WORKDIR="$${PWD}"; \
|
2021-12-30 21:54:59 +00:00
|
|
|
version=$(VERSION); \
|
2021-12-14 17:52:48 +00:00
|
|
|
tar \
|
2021-12-30 21:54:59 +00:00
|
|
|
--transform "s,^\.,$(NAME)-$(subst -,~,$(VERSION))," \
|
2021-12-14 17:52:48 +00:00
|
|
|
--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)/; \
|
2021-12-12 00:26:00 +00:00
|
|
|
rpmbuild -bs jellyfin.spec \
|
|
|
|
--define "_sourcedir $$PWD/" \
|
2020-03-23 20:28:49 +00:00
|
|
|
--define "_srcrpmdir $(outdir)"
|
2021-12-12 00:26:00 +00:00
|
|
|
|
2021-12-14 17:52:48 +00:00
|
|
|
rpms: $(DIR)/$(SRPM)
|
|
|
|
mock $(addprefix --addrepo=, $($(TARGET)_repos)) \
|
|
|
|
--enable-network \
|
2021-12-12 00:26:00 +00:00
|
|
|
-r $(TARGET) $<
|