2011-03-31 13:47:30 +00:00
|
|
|
#
|
|
|
|
# The Qubes OS Project, http://www.qubes-os.org
|
|
|
|
#
|
|
|
|
# Copyright (C) 2011 Tomasz Sterna <tomek@xiaoka.com>
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
TOP := $(shell pwd)
|
|
|
|
RPMBUILD_DEFINES := --define "_rpmdir rpm/" --define "_sourcedir $(TOP)/rpm/SOURCES"
|
|
|
|
|
2012-11-16 03:49:01 +00:00
|
|
|
spec_version = $(shell rpm -q --qf "%{VERSION}\n" --specfile $(1)| head -1)
|
2011-03-31 13:47:30 +00:00
|
|
|
package = $(shell \
|
2012-07-09 13:04:37 +00:00
|
|
|
mkdir -p rpm/SOURCES; \
|
2011-03-31 13:47:30 +00:00
|
|
|
cd rpm/SOURCES; \
|
|
|
|
rm -f $(1)-$(2)*; \
|
|
|
|
ln -s ../../$(1) $(1)-$(2); \
|
|
|
|
tar jcf $(1)-$(2).tar.bz2 --dereference --exclude-vcs $(1)-$(2); \
|
|
|
|
rm $(1)-$(2) )
|
|
|
|
|
|
|
|
ANACONDA_VERSION := $(call spec_version,anaconda/anaconda.spec)
|
|
|
|
FIRSTBOOT_VERSION := $(call spec_version,firstboot/firstboot.spec)
|
|
|
|
QBSRELEASE_VERSION := $(call spec_version,qubes-release/qubes-release.spec)
|
2013-01-24 10:50:02 +00:00
|
|
|
LORAXQBS_VERSION := $(call spec_version,lorax-templates-qubes/lorax-templates-qubes.spec)
|
2013-01-26 21:41:55 +00:00
|
|
|
PUNGI_VERSION := $(call spec_version,pungi/pungi.spec)
|
|
|
|
PYKICKSTART_VERSION := $(call spec_version,pykickstart/pykickstart.spec)
|
2011-03-31 13:47:30 +00:00
|
|
|
|
2015-08-02 10:44:51 +00:00
|
|
|
ISO_INSTALLER ?= 1
|
|
|
|
ISO_LIVEUSB ?= 0
|
|
|
|
|
2013-01-24 00:01:06 +00:00
|
|
|
PUNGI_OPTS := --nosource --nodebuginfo --nogreedy --all-stages
|
2012-11-15 10:57:49 +00:00
|
|
|
ifdef QUBES_RELEASE
|
2013-01-26 21:19:09 +00:00
|
|
|
ISO_VERSION := $(QUBES_RELEASE)
|
|
|
|
PUNGI_OPTS += --isfinal
|
|
|
|
else
|
|
|
|
ISO_VERSION := $(shell date +%Y%m%d)
|
2012-11-13 04:18:13 +00:00
|
|
|
endif
|
2013-01-26 21:19:09 +00:00
|
|
|
PUNGI_OPTS += --ver="$(ISO_VERSION)"
|
2012-11-13 04:18:13 +00:00
|
|
|
|
2011-03-31 13:47:30 +00:00
|
|
|
help:
|
|
|
|
@echo "make rpms <--- make all rpms and sign them";\
|
|
|
|
echo "make rpms_anaconda <--- create binary rpms for Anaconda"; \
|
|
|
|
echo "make rpms_firstboot <--- create binary rpms for Firstboot"; \
|
|
|
|
echo "make rpms_release <--- create binary rpms for Qubes Release package"; \
|
|
|
|
echo; \
|
2011-03-31 14:09:42 +00:00
|
|
|
echo "make update-repo <-- copy newly generated rpms to installer yum repo";\
|
2011-04-01 16:58:29 +00:00
|
|
|
echo "make iso <== \o/";\
|
2011-04-04 18:05:40 +00:00
|
|
|
echo; \
|
|
|
|
echo "make clean";\
|
|
|
|
echo; \
|
2011-03-31 13:47:30 +00:00
|
|
|
exit 0;
|
|
|
|
|
2014-06-10 13:41:09 +00:00
|
|
|
.PHONY: rpms rpms_anaconda rpms_firstboot rpms_release rpms_lorax \
|
2013-01-26 21:41:55 +00:00
|
|
|
rpms_pungi rpms_pykickstart \
|
2013-01-24 10:50:02 +00:00
|
|
|
update-repo update-repo-testing clean iso
|
2011-03-31 13:47:30 +00:00
|
|
|
|
2014-06-10 13:41:09 +00:00
|
|
|
rpms: rpms_anaconda rpms_firstboot rpms_release rpms_lorax rpms_pungi rpms_pykickstart
|
2011-03-31 14:09:42 +00:00
|
|
|
rpm --addsign `ls -d rpm/x86_64/*.rpm rpm/i686/*.rpm rpm/noarch/*.rpm 2>/dev/null`
|
2011-03-31 13:47:30 +00:00
|
|
|
|
2012-11-14 00:41:38 +00:00
|
|
|
rpms-dom0: rpms
|
|
|
|
|
|
|
|
rpms-vm:
|
|
|
|
|
2011-03-31 14:09:42 +00:00
|
|
|
rpm/SOURCES/anaconda-$(ANACONDA_VERSION).tar.bz2: anaconda anaconda/anaconda.spec
|
2011-03-31 13:47:30 +00:00
|
|
|
$(call package,anaconda,$(ANACONDA_VERSION))
|
|
|
|
|
2013-01-24 10:50:02 +00:00
|
|
|
rpm/SOURCES/lorax-templates-qubes-$(LORAXQBS_VERSION).tar.bz2: lorax-templates-qubes lorax-templates-qubes/lorax-templates-qubes.spec
|
|
|
|
$(call package,lorax-templates-qubes,$(LORAXQBS_VERSION))
|
|
|
|
|
2011-03-31 14:09:42 +00:00
|
|
|
rpm/SOURCES/firstboot-$(FIRSTBOOT_VERSION).tar.bz2: firstboot firstboot/firstboot.spec
|
2011-03-31 13:47:30 +00:00
|
|
|
$(call package,firstboot,$(FIRSTBOOT_VERSION))
|
|
|
|
|
2013-02-08 22:01:34 +00:00
|
|
|
rpm/SOURCES/qubes-release-$(QBSRELEASE_VERSION).tar.bz2: qubes-release qubes-release/qubes-release.spec conf/comps-qubes.xml
|
2011-03-31 13:47:30 +00:00
|
|
|
$(call package,qubes-release,$(QBSRELEASE_VERSION))
|
2013-02-08 22:01:34 +00:00
|
|
|
cp conf/comps-qubes.xml rpm/SOURCES/Qubes-comps.xml
|
2011-03-31 13:47:30 +00:00
|
|
|
|
|
|
|
rpms_anaconda: rpm/SOURCES/anaconda-$(ANACONDA_VERSION).tar.bz2
|
|
|
|
rpmbuild $(RPMBUILD_DEFINES) -bb anaconda/anaconda.spec
|
|
|
|
|
2013-01-24 10:50:02 +00:00
|
|
|
rpms_lorax: rpm/SOURCES/lorax-templates-qubes-$(LORAXQBS_VERSION).tar.bz2
|
|
|
|
rpmbuild $(RPMBUILD_DEFINES) -bb lorax-templates-qubes/lorax-templates-qubes.spec
|
|
|
|
|
2013-01-26 21:41:55 +00:00
|
|
|
rpms_pungi: pungi/pungi-$(PUNGI_VERSION).tar.bz2 pungi/pungi.spec
|
|
|
|
rpmbuild --define "_rpmdir rpm/" --define "_sourcedir $(TOP)/pungi" -bb pungi/pungi.spec
|
|
|
|
|
|
|
|
rpms_pykickstart: pykickstart/pykickstart-$(PYKICKSTART_VERSION).tar.gz pykickstart/pykickstart.spec
|
|
|
|
rpmbuild --define "_rpmdir rpm/" --define "_sourcedir $(TOP)/pykickstart" -bb pykickstart/pykickstart.spec
|
|
|
|
|
2011-03-31 13:47:30 +00:00
|
|
|
rpms_firstboot: rpm/SOURCES/firstboot-$(FIRSTBOOT_VERSION).tar.bz2
|
|
|
|
rpmbuild $(RPMBUILD_DEFINES) -bb firstboot/firstboot.spec
|
|
|
|
|
|
|
|
rpms_release: rpm/SOURCES/qubes-release-$(QBSRELEASE_VERSION).tar.bz2
|
|
|
|
rpmbuild $(RPMBUILD_DEFINES) -bb qubes-release/qubes-release.spec
|
|
|
|
|
2014-06-10 13:41:09 +00:00
|
|
|
RPMS = \
|
2011-03-31 14:09:42 +00:00
|
|
|
rpm/noarch/qubes-release-$(QBSRELEASE_VERSION)-*.rpm \
|
2012-12-19 02:11:47 +00:00
|
|
|
rpm/noarch/qubes-release-notes-$(QBSRELEASE_VERSION)-*.rpm \
|
2013-01-24 10:50:02 +00:00
|
|
|
rpm/noarch/lorax-templates-qubes-$(LORAXQBS_VERSION)-*.rpm \
|
2013-01-26 21:41:55 +00:00
|
|
|
rpm/noarch/pungi-$(PUNGI_VERSION)-*.rpm \
|
|
|
|
rpm/noarch/pykickstart-$(PYKICKSTART_VERSION)-*.rpm \
|
2013-01-26 21:21:58 +00:00
|
|
|
rpm/x86_64/anaconda*-$(ANACONDA_VERSION)-*.rpm \
|
2011-03-31 14:09:42 +00:00
|
|
|
rpm/x86_64/firstboot-$(FIRSTBOOT_VERSION)-*.rpm
|
|
|
|
|
2011-03-31 13:47:30 +00:00
|
|
|
update-repo:
|
2012-11-19 16:50:55 +00:00
|
|
|
@ln -f $(RPMS) yum/installer/rpm/
|
|
|
|
@echo "--> Updating Installer repos..."
|
|
|
|
@(cd yum && ./update_repo.sh)
|
2011-03-31 13:47:30 +00:00
|
|
|
|
2012-12-09 22:54:24 +00:00
|
|
|
update-repo-current:
|
|
|
|
ln -f $(RPMS) ../yum/current-release/current/dom0/rpm/
|
|
|
|
|
|
|
|
update-repo-current-testing:
|
|
|
|
ln -f $(RPMS) ../yum/current-release/current-testing/dom0/rpm/
|
|
|
|
|
|
|
|
update-repo-unstable:
|
|
|
|
ln -f $(RPMS) ../yum/current-release/unstable/dom0/rpm/
|
|
|
|
|
2015-08-02 10:44:51 +00:00
|
|
|
ifeq ($(ISO_INSTALLER),1)
|
|
|
|
iso: iso-installer
|
|
|
|
endif
|
|
|
|
ifeq ($(ISO_LIVEUSB),1)
|
|
|
|
iso: iso-liveusb
|
|
|
|
endif
|
|
|
|
|
|
|
|
iso-prepare:
|
|
|
|
ln -nsf `pwd` /tmp/qubes-installer
|
2015-04-15 12:22:56 +00:00
|
|
|
createrepo -q -g ../../conf/comps-qubes.xml --update yum/qubes-dom0
|
2015-08-02 10:44:51 +00:00
|
|
|
|
|
|
|
iso-installer: iso-prepare
|
2013-02-19 21:33:03 +00:00
|
|
|
mkdir -p work
|
2013-02-20 01:43:16 +00:00
|
|
|
pushd work && pungi --name=Qubes $(PUNGI_OPTS) -c $(PWD)/conf/qubes-kickstart.cfg && popd
|
2013-02-19 21:33:03 +00:00
|
|
|
./rpm_verify work/$(ISO_VERSION)/x86_64/os/Packages/*/*.rpm
|
2013-01-26 21:19:09 +00:00
|
|
|
# Move result files to known-named directories
|
|
|
|
mkdir -p build/ISO/qubes-x86_64/iso build/work
|
2013-02-19 21:33:03 +00:00
|
|
|
mv work/$(ISO_VERSION)/x86_64/iso/*-DVD.iso build/ISO/qubes-x86_64/iso/
|
2013-01-26 21:19:09 +00:00
|
|
|
rm -rf build/work/$(ISO_VERSION)
|
2013-02-19 21:33:03 +00:00
|
|
|
mv work/$(ISO_VERSION)/x86_64/os build/work/$(ISO_VERSION)
|
2015-04-15 12:22:56 +00:00
|
|
|
chown --reference=Makefile -R build yum
|
2013-02-19 21:33:03 +00:00
|
|
|
rm -rf work
|
2011-04-04 18:05:40 +00:00
|
|
|
|
2015-08-02 10:44:51 +00:00
|
|
|
iso-liveusb: conf/liveusb.ks iso-prepare
|
2015-08-01 21:18:48 +00:00
|
|
|
mkdir -p work
|
2015-08-09 18:42:24 +00:00
|
|
|
pushd work && ../livecd-creator-qubes --debug --product='Qubes OS' --title="Qubes OS $(ISO_VERSION)" --fslabel="Qubes-$(ISO_VERSION)-x86_64-LIVE" --config ../$< && popd
|
2015-08-01 21:18:48 +00:00
|
|
|
# Move result files to known-named directories
|
|
|
|
mkdir -p build/ISO/qubes-x86_64/iso build/work
|
|
|
|
mv work/*.iso build/ISO/qubes-x86_64/iso/
|
|
|
|
chown --reference=Makefile -R build yum
|
|
|
|
rm -rf work
|
|
|
|
|
2012-11-19 16:50:15 +00:00
|
|
|
clean-repos:
|
|
|
|
@echo "--> Removing old rpms from the installer repos..."
|
|
|
|
@(cd yum && ./clean_repos.sh)
|
|
|
|
|
2011-04-04 18:05:40 +00:00
|
|
|
clean:
|
2012-11-27 14:09:30 +00:00
|
|
|
sudo rm -fr build/*
|
2011-04-04 18:05:40 +00:00
|
|
|
rm -fr rpm/SOURCES/*.bz2
|
|
|
|
rm -fr rpm/noarch/*.rpm
|
|
|
|
rm -fr rpm/x86_64/*.rpm
|