2021-12-12 18:28:28 -07:00
|
|
|
DIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
|
|
|
# install git and npm
|
|
|
|
$(info $(shell set -x; if [ "$$(id -u)" = "0" ]; then echo "Installing git"; dnf -y install git npm; fi))
|
|
|
|
NAME := jellyfin-web
|
|
|
|
VERSION := $(shell set -x; sed -ne '/^Version:/s/.* *//p' $(DIR)/$(NAME).spec)
|
|
|
|
RELEASE := $(shell set -x; sed -ne '/^Release:/s/.* *\(.*\)%{.*}.*/\1/p' $(DIR)/$(NAME).spec)
|
2021-12-29 09:48:15 -07:00
|
|
|
SRPM := jellyfin-web-$(subst -,~,$(VERSION))-$(RELEASE)$(shell rpm --eval %dist).src.rpm
|
|
|
|
TARBALL :=$(NAME)-$(subst -,~,$(VERSION)).tar.gz
|
2020-03-23 21:01:03 -07:00
|
|
|
|
2023-09-27 20:50:53 -07:00
|
|
|
epel-7-x86_64_repos := https://rpm.nodesource.com/pub_20.x/nodistro/\$$basearch/
|
2021-12-12 18:28:28 -07:00
|
|
|
|
2022-06-23 07:06:21 -07:00
|
|
|
fed_ver := $(shell rpm -E %fedora)
|
|
|
|
# fallback when not running on Fedora
|
|
|
|
fed_ver ?= 36
|
|
|
|
TARGET ?= fedora-$(fed_ver)-x86_64
|
|
|
|
|
2021-12-12 18:28:28 -07:00
|
|
|
outdir ?= $(PWD)/$(DIR)/
|
|
|
|
|
|
|
|
srpm: $(DIR)/$(SRPM)
|
|
|
|
tarball: $(DIR)/$(TARBALL)
|
|
|
|
|
|
|
|
$(DIR)/$(TARBALL):
|
|
|
|
cd $(DIR)/; \
|
|
|
|
SOURCE_DIR=.. \
|
|
|
|
WORKDIR="$${PWD}"; \
|
2021-12-29 09:48:15 -07:00
|
|
|
version=$(VERSION); \
|
2021-12-12 18:28:28 -07:00
|
|
|
tar \
|
2021-12-29 09:48:15 -07:00
|
|
|
--transform "s,^\.,$(NAME)-$(subst -,~,$(VERSION))," \
|
2021-12-12 18:28:28 -07:00
|
|
|
--exclude='.git*' \
|
|
|
|
--exclude='**/.git' \
|
|
|
|
--exclude='**/.hg' \
|
|
|
|
--exclude=deployment \
|
|
|
|
--exclude='*.deb' \
|
|
|
|
--exclude='*.rpm' \
|
|
|
|
--exclude=$(notdir $@) \
|
|
|
|
-czf $(notdir $@) \
|
2020-03-23 21:01:03 -07:00
|
|
|
-C $${SOURCE_DIR} ./
|
2021-12-12 18:28:28 -07:00
|
|
|
|
|
|
|
$(DIR)/$(SRPM): $(DIR)/$(TARBALL) $(DIR)/jellyfin-web.spec
|
|
|
|
cd $(DIR)/; \
|
|
|
|
rpmbuild -bs $(NAME).spec \
|
|
|
|
--define "_sourcedir $$PWD/" \
|
2020-03-23 21:01:03 -07:00
|
|
|
--define "_srcrpmdir $(outdir)"
|
2021-12-12 18:28:28 -07:00
|
|
|
|
|
|
|
rpms: $(DIR)/$(SRPM)
|
|
|
|
mock $(addprefix --addrepo=, $($(TARGET)_repos)) \
|
|
|
|
--enable-network \
|
|
|
|
-r $(TARGET) $<
|