2011-11-06 13:02:24 +00:00
|
|
|
ifndef DIST
|
|
|
|
$(error "You must set DIST variable, e.g. DIST=fc14")
|
|
|
|
endif
|
|
|
|
|
2013-02-16 15:00:50 +00:00
|
|
|
#TODO: build template name somehow smarter
|
2011-11-06 13:02:24 +00:00
|
|
|
TEMPLATE_NAME := $${DIST/fc/fedora-}-x64
|
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"
|
2011-11-09 11:49:54 +00:00
|
|
|
@echo "make clean -- copy newly generated rpm to installer repo"
|
2011-11-06 13:02:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
rpms:
|
2013-02-24 12:33:57 +00:00
|
|
|
@echo $(TIMESTAMP) > build_timestamp_$(DIST)
|
2011-11-06 13:02:24 +00:00
|
|
|
@echo "Building template: $(TEMPLATE_NAME)"
|
2013-02-16 15:00:50 +00:00
|
|
|
sudo -E ./prepare_image prepared_images/$(TEMPLATE_NAME).img && \
|
|
|
|
sudo -E ./qubeize_image prepared_images/$(TEMPLATE_NAME).img $(TEMPLATE_NAME) && \
|
2011-11-06 13:02:24 +00:00
|
|
|
./build_template_rpm $(TEMPLATE_NAME) || exit 1; \
|
|
|
|
|
|
|
|
update-repo-installer:
|
2013-03-20 14:24:15 +00:00
|
|
|
[ -z "$$UPDATE_REPO" ] && UPDATE_REPO=../installer/yum/qubes-dom0;\
|
|
|
|
ln -f rpm/noarch/qubes-template-$(TEMPLATE_NAME)-$(VERSION)-$(shell cat build_timestamp_$(DIST))*.noarch.rpm $$UPDATE_REPO/rpm
|
2011-11-06 13:02:24 +00:00
|
|
|
|
2012-11-14 15:12:18 +00:00
|
|
|
prepare-repo-template:
|
2013-04-28 20:36:51 +00:00
|
|
|
rm -rf yum_repo_qubes/$(DIST)
|
2012-11-14 15:12:18 +00:00
|
|
|
mkdir -p yum_repo_qubes/$(DIST)/rpm yum_repo_qubes/$(DIST)/repodata
|
|
|
|
|
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
|
|
|
|