This repository has been archived by the owner on May 4, 2021. It is now read-only.
forked from QubesOS/qubes-desktop-linux-i3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.common
81 lines (59 loc) · 2.01 KB
/
Makefile.common
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#
# Common Makefile for building RPMs
#
# the pathnames are relative to the subproject directory (e.g. i3/)
# so that e.g. this file is: ../Makefile.common
#
WORKDIR := $(CURDIR)
SPECDIR ?= $(WORKDIR)
SRCRPMDIR ?= $(WORKDIR)/../srpm
BUILDDIR ?= $(WORKDIR)
RPMDIR ?= $(WORKDIR)/../rpm
SOURCEDIR := $(WORKDIR)
RPM_DEFINES := --define "_sourcedir $(SOURCEDIR)" \
--define "_specdir $(SPECDIR)" \
--define "_builddir $(BUILDDIR)" \
--define "_srcrpmdir $(SRCRPMDIR)" \
--define "_rpmdir $(RPMDIR)"
help:
@echo "make rpms -- generate binary rpm packages"
@echo "make srpms -- generate source rpm packages"
DIST_DOM0 ?= fc20
VER_REL := $(shell rpm $(RPM_DEFINES) -q --qf "%{VERSION}-%{RELEASE}\n" --specfile $(SPECFILE)| head -1|sed -e 's/fc../$(DIST_DOM0)/')
NAME := $(shell rpm $(RPM_DEFINES) -q --qf "%{NAME}\n" --specfile $(SPECFILE)| head -1)
URL := $(shell spectool $(RPM_DEFINES) --list-files --source 0 $(SPECFILE) 2> /dev/null| cut -d ' ' -f 2- )
ifndef SRC_FILE
ifdef URL
SRC_FILE := $(notdir $(URL))
endif
endif
get-sources: $(SRC_FILE)
$(SRC_FILE):
ifneq ($(SRC_FILE), None)
@spectool $(RPM_DEFINES) --get-files $(SPECFILE) 2> /dev/null
endif
.PHONY: verify-sources
verify-sources: $(SRC_FILE)
ifneq ($(SRC_FILE), None)
@sha256sum --quiet -c sources
endif
.PHONY: clean-sources
clean-sources:
ifneq ($(SRC_FILE), None)
-rm $(SRC_FILE)
endif
rpms: rpms-dom0
rpms-vm:
rpms-dom0:
rpmbuild $(RPM_DEFINES) -bb $(SPECFILE)
srpms: verify-sources
rpmbuild $(RPM_DEFINES) -bs $(SPECFILE)
update-repo-current:
ln -f $(RPMDIR)/x86_64/$(NAME)*$(VER_REL)*.rpm ../../yum/current-release/current/dom0/rpm/
update-repo-current-testing:
ln -f $(RPMDIR)/x86_64/$(NAME)*$(VER_REL)*.rpm ../../yum/current-release/current-testing/dom0/rpm/
update-repo-unstable:
ln -f $(RPMDIR)/x86_64/$(NAME)*$(VER_REL)*.rpm ../../yum/current-release/unstable/dom0/rpm/
update-repo-installer:
ln -f $(RPMDIR)/x86_64/$(NAME)*$(VER_REL)*.rpm ../../installer/yum/qubes-dom0/rpm/
clean: