2011-11-06 13:02:24 +00:00
|
|
|
ifndef DIST
|
|
|
|
$(error "You must set DIST variable, e.g. DIST=fc14")
|
|
|
|
endif
|
2014-07-26 02:30:31 +00:00
|
|
|
export DIST
|
2011-11-06 13:02:24 +00:00
|
|
|
|
2017-06-14 08:51:03 +00:00
|
|
|
TEMPLATE_ENV_WHITELIST ?=
|
2015-03-10 03:19:28 +00:00
|
|
|
TEMPLATE_BUILDER = 1
|
|
|
|
-include $(addsuffix /Makefile.builder,$(BUILDER_PLUGINS_DIRS))
|
2014-10-24 20:17:29 +00:00
|
|
|
|
2015-03-10 03:19:28 +00:00
|
|
|
TEMPLATE_NAME := $(DIST)
|
2014-05-13 02:40:09 +00:00
|
|
|
ifdef TEMPLATE_FLAVOR
|
|
|
|
TEMPLATE_NAME := $(TEMPLATE_NAME)-$(TEMPLATE_FLAVOR)
|
|
|
|
endif
|
2014-10-24 20:17:29 +00:00
|
|
|
|
2017-06-14 08:51:03 +00:00
|
|
|
# expose those variables to template-building scripts
|
|
|
|
TEMPLATE_ENV_WHITELIST += \
|
|
|
|
DIST DISTRIBUTION TEMPLATE_SCRIPTS TEMPLATE_NAME TEMPLATE_FLAVOR \
|
2017-09-03 23:24:31 +00:00
|
|
|
TEMPLATE_FLAVOR_DIR TEMPLATE_OPTIONS APPMENUS_DIR \
|
2017-09-26 00:48:35 +00:00
|
|
|
VERBOSE DEBUG PATH BUILDER_DIR SRC_DIR DISCARD_PREPARED_IMAGE \
|
2018-03-10 01:02:21 +00:00
|
|
|
TEMPLATE_ROOT_WITH_PARTITIONS TEMPLATE_ROOT_SIZE \
|
|
|
|
USE_QUBES_REPO_VERSION USE_QUBES_REPO_TESTING \
|
|
|
|
BUILDER_TURBO_MODE REPO_PROXY FEDORA_MIRROR \
|
2018-05-06 10:01:24 +00:00
|
|
|
CENTOS_MIRROR EPEL_MIRROR QUBES_MIRROR
|
2017-06-14 08:51:03 +00:00
|
|
|
|
2015-03-09 12:38:09 +00:00
|
|
|
# Make sure names are < 32 characters, process aliases
|
2014-10-24 20:17:29 +00:00
|
|
|
fix_up := $(shell TEMPLATE_NAME=$(TEMPLATE_NAME) ./builder_fix_filenames)
|
|
|
|
TEMPLATE_NAME := $(word 1,$(fix_up))
|
|
|
|
|
2015-02-10 14:50:45 +00:00
|
|
|
export TEMPLATE_NAME
|
2015-03-10 03:19:28 +00:00
|
|
|
export TEMPLATE_SCRIPTS
|
|
|
|
export DISTRIBUTION
|
2015-02-10 14:50:45 +00:00
|
|
|
|
2012-11-06 09:43:45 +00:00
|
|
|
VERSION := $(shell cat version)
|
|
|
|
TIMESTAMP := $(shell date -u +%Y%m%d%H%M)
|
2011-11-06 13:02:24 +00:00
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "make rpms -- generate template rpm"
|
|
|
|
@echo "make update-repo-installer -- copy newly generated rpm to installer repo"
|
2017-08-25 14:00:45 +00:00
|
|
|
@echo "make clean -- remove all files and directories built or added"
|
2011-11-06 13:02:24 +00:00
|
|
|
|
2015-03-17 14:05:14 +00:00
|
|
|
template-name:
|
|
|
|
@echo $(TEMPLATE_NAME)
|
2011-11-06 13:02:24 +00:00
|
|
|
|
2015-03-09 12:38:09 +00:00
|
|
|
prepare:
|
2015-03-17 14:05:14 +00:00
|
|
|
@echo "Building template: $(TEMPLATE_NAME)"
|
2015-03-10 03:19:28 +00:00
|
|
|
@echo $(TIMESTAMP) > build_timestamp_$(TEMPLATE_NAME)
|
2015-03-09 12:38:09 +00:00
|
|
|
|
2015-03-17 14:05:14 +00:00
|
|
|
package:
|
2015-03-09 12:38:09 +00:00
|
|
|
./build_template_rpm $(TEMPLATE_NAME)
|
2015-03-17 14:05:14 +00:00
|
|
|
|
|
|
|
rpms: prepare rootimg-build package
|
2015-03-09 12:38:09 +00:00
|
|
|
./create_template_list.sh || :
|
2011-11-06 13:02:24 +00:00
|
|
|
|
2015-01-30 14:35:00 +00:00
|
|
|
rootimg-build:
|
2015-03-10 03:19:28 +00:00
|
|
|
ifeq (,$(TEMPLATE_SCRIPTS))
|
|
|
|
$(error Building template $(DIST) not supported by any of configured plugins)
|
|
|
|
endif
|
2017-06-14 08:51:03 +00:00
|
|
|
sudo env -i $(foreach var,$(TEMPLATE_ENV_WHITELIST),$(var)="$($(var))") \
|
|
|
|
./prepare_image prepared_images/$(TEMPLATE_NAME).img
|
|
|
|
sudo env -i $(foreach var,$(TEMPLATE_ENV_WHITELIST),$(var)="$($(var))") \
|
|
|
|
./qubeize_image prepared_images/$(TEMPLATE_NAME).img $(TEMPLATE_NAME)
|
2015-01-30 14:35:00 +00:00
|
|
|
|
2017-10-28 11:17:30 +00:00
|
|
|
update-repo-templates-itl: update-repo-templates.itl
|
|
|
|
update-repo-templates-community: update-repo-templates.community
|
|
|
|
|
|
|
|
update-repo-templates.%: repo = $(subst .,,$(suffix $@))
|
|
|
|
update-repo-templates.%:
|
|
|
|
[ -z "$$UPDATE_REPO" ] && UPDATE_REPO=../linux-yum/current-release/templates-$(repo);\
|
|
|
|
ln -f rpm/noarch/qubes-template-$(TEMPLATE_NAME)-$(VERSION)-$(shell cat build_timestamp_$(TEMPLATE_NAME))*.noarch.rpm $$UPDATE_REPO/rpm
|
|
|
|
|
2011-11-06 13:02:24 +00:00
|
|
|
update-repo-installer:
|
2013-03-20 14:24:15 +00:00
|
|
|
[ -z "$$UPDATE_REPO" ] && UPDATE_REPO=../installer/yum/qubes-dom0;\
|
2015-03-19 21:58:50 +00:00
|
|
|
ln -f rpm/noarch/qubes-template-$(TEMPLATE_NAME)-$(VERSION)-$(shell cat build_timestamp_$(TEMPLATE_NAME))*.noarch.rpm $$UPDATE_REPO/rpm
|
2011-11-06 13:02:24 +00:00
|
|
|
|
2018-05-25 14:31:23 +00:00
|
|
|
sign:
|
|
|
|
setsid -w rpmsign $$RPMSIGN_OPTS --addsign rpm/noarch/qubes-template-$(TEMPLATE_NAME)-$(VERSION)-$(shell cat build_timestamp_$(TEMPLATE_NAME))*.noarch.rpm
|
|
|
|
|
2012-11-14 15:12:18 +00:00
|
|
|
prepare-repo-template:
|
2015-03-10 03:19:28 +00:00
|
|
|
rm -rf pkgs-for-template/$(DIST)
|
|
|
|
mkdir -p pkgs-for-template/$(DIST)
|
2012-11-14 15:12:18 +00:00
|
|
|
|
2011-11-09 11:49:54 +00:00
|
|
|
clean:
|
|
|
|
sudo rm -fr qubeized_images/root.img.*
|
|
|
|
sudo rm -fr qubeized_images/$(TEMPLATE_NAME)*
|
2011-11-09 16:14:09 +00:00
|
|
|
sudo rm -fr rpmbuild/BUILDROOT/*
|
|
|
|
sudo rm -fr rpmbuild/tmp/*
|
2013-02-16 16:17:23 +00:00
|
|
|
# We're not removing any images from prepared_images/ intentionally
|
2011-11-09 11:49:54 +00:00
|
|
|
# because the user might want to keep using the same image for a long time
|
2013-02-16 16:17:23 +00:00
|
|
|
# and they are not dependent on any of the Qubes packages
|
2011-11-06 13:02:24 +00:00
|
|
|
|