-
Notifications
You must be signed in to change notification settings - Fork 5
/
utils.mk
44 lines (37 loc) · 1.07 KB
/
utils.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# SPDX-License-Identifier: GPLv3
#
# utils.mk - make utilities
# Copyright Peter Jones <[email protected]>
#
VERSION = 0
RELEASE = 1
DESTDIR := temp
DATE=$(shell date "+%Y%m%d")
ESPDIR := /boot/efi/EFI/BOOT
ARCH := $(shell rpm --eval '%{_build_arch}')
# KVRA := $(shell rpm -q kernel-core --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | tail -n 1)
KVRA ?= 6.2.11-300.fc38.$(ARCH)
EFI_ARCH := $(shell rpm --eval '%{efi_arch}')
OS_NAME := $(shell grep '^ID=' /etc/os-release | sed 's/ID=//')
# OS_VERSION := $(shell grep '^VERSION_ID=' /etc/os-release | sed 's/VERSION_ID=//')
OS_VERSION ?= 38
# OS_DIST := $(shell rpm --eval '%{dist}')
OS_DIST ?= .fc38
VR := $(VERSION)-$(RELEASE)$(OS_DIST)
ifeq ($(.DEFAULT_GOAL),)
.DEFAULT_GOAL := all
endif
RPMBUILD_ARGS := -D "_topdir $(TOPDIR)" \
-D '_builddir %{_topdir}' \
-D '_rpmdir %{_topdir}' \
-D '_sourcedir %{_topdir}' \
-D '_specdir %{_topdir}' \
-D '_srcrpmdir %{_topdir}' \
-D 'dist $(OS_DIST)'
.EXPORT_ALL_VARIABLES:
% : %.in
@sed \
-e 's,@@VERSION@@,$(VERSION),g' \
-e 's,@@RELEASE@@,$(RELEASE),g' \
$< > $@
# vim:ft=make