From bd0e0d565901128d669cabf5b5dcf99c309d6475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret?= Date: Wed, 9 May 2018 12:32:22 +0200 Subject: [PATCH] Support Mock based build --- Makefile.builder | 14 +++++++++++++- anaconda/anaconda.spec | 7 ------- blivet/python-blivet.spec | 4 ---- live/qubes-live.spec | 2 +- lorax-templates-qubes/lorax-templates-qubes.spec | 8 -------- lorax/lorax.spec | 4 ---- pungi/pungi.spec | 4 ---- pykickstart/pykickstart.spec | 6 +----- qubes-anaconda-addon/qubes-anaconda-addon.spec | 11 +++-------- qubes-release/qubes-dom0-dist-upgrade.spec | 10 +--------- qubes-release/qubes-release.spec | 8 -------- 11 files changed, 19 insertions(+), 59 deletions(-) diff --git a/Makefile.builder b/Makefile.builder index 3775bf4..e897b55 100644 --- a/Makefile.builder +++ b/Makefile.builder @@ -12,10 +12,22 @@ RPM_SPEC_FILES.dom0 := \ ifeq ($(ISO_LIVEUSB),1) RPM_SPEC_FILES.dom0 += \ livecd-tools/livecd-tools.spec \ - live/qubes-live.spec + live/qubes-live.spec endif RPM_SPEC_FILES := $(RPM_SPEC_FILES.$(PACKAGE_SET)) +SOURCE_COPY_IN := $(RPM_SPEC_FILES.dom0) +$(RPM_SPEC_FILES.dom0): SPEC=$(notdir $@) +$(RPM_SPEC_FILES.dom0): PACKAGE=$(dir $@) +$(RPM_SPEC_FILES.dom0): SOURCE_ARCHIVE_NAME=$(notdir $(shell $(RPM_PLUGIN_DIR)/tools/spectool --list-files --source 0 $(CHROOT_DIR)/$(DIST_SRC)/$(PACKAGE)/$(SPEC) | cut -d' ' -f2)) +$(RPM_SPEC_FILES.dom0): + # Create the archive for specific Qubes packages + [[ -e $(CHROOT_DIR)/$(DIST_SRC)/$(PACKAGE)/$(SOURCE_ARCHIVE_NAME) ]] \ + || $(BUILDER_DIR)/scripts/create-archive $(CHROOT_DIR)/$(DIST_SRC)/$(PACKAGE) $(SOURCE_ARCHIVE_NAME) + +NO_ARCHIVE = 1 + +dist-package-build: RPM_SOURCE_DIR=$(dir $(DIST_SRC)/$(PACKAGE)) # vim: ft=make diff --git a/anaconda/anaconda.spec b/anaconda/anaconda.spec index 60505ee..8f88cd8 100644 --- a/anaconda/anaconda.spec +++ b/anaconda/anaconda.spec @@ -16,10 +16,6 @@ URL: http://fedoraproject.org/wiki/Anaconda # make dist Source0: %{name}-%{version}.tar.bz2 -%if 0%{?qubes_builder} -%define _builddir %(pwd)/anaconda -%endif - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # Versions of required components (done so we make sure the buildrequires @@ -233,10 +229,7 @@ options. This includes driver disks, kickstarts, and finding the anaconda runtime on NFS/HTTP/FTP servers or local disks. %prep -%if ! 0%{?qubes_builder} %setup -q -%endif - %build ./autogen.sh diff --git a/blivet/python-blivet.spec b/blivet/python-blivet.spec index 0fe34b7..3932b5d 100644 --- a/blivet/python-blivet.spec +++ b/blivet/python-blivet.spec @@ -1,7 +1,3 @@ -%if 0%{?qubes_builder} -%define _sourcedir %(pwd)/blivet -%endif - Summary: A python module for system storage configuration Name: python-blivet Url: http://fedoraproject.org/wiki/blivet diff --git a/live/qubes-live.spec b/live/qubes-live.spec index 2dcdc6f..497ff32 100644 --- a/live/qubes-live.spec +++ b/live/qubes-live.spec @@ -6,7 +6,7 @@ Name: qubes-live Version: 1.0 Release: 1%{?dist} Summary: Various fixes for Qubes Live edition - +Source0: %{name}-%{version}.tar.gz Group: System License: GPL URL: https://qubes-os.org diff --git a/lorax-templates-qubes/lorax-templates-qubes.spec b/lorax-templates-qubes/lorax-templates-qubes.spec index 599dfdc..de81794 100644 --- a/lorax-templates-qubes/lorax-templates-qubes.spec +++ b/lorax-templates-qubes/lorax-templates-qubes.spec @@ -1,7 +1,3 @@ -%if 0%{?qubes_builder} -%define _builddir %(pwd)/lorax-templates-qubes -%endif - Name: lorax-templates-qubes Version: 4.0.2 Release: 1%{?dist} @@ -20,11 +16,7 @@ BuildArch: noarch Lorax templates for Qubes installation ISO. %prep -%if ! 0%{?qubes_builder} %setup -q -%endif - -%build %install rm -rf $RPM_BUILD_ROOT diff --git a/lorax/lorax.spec b/lorax/lorax.spec index 122c3db..6b9684f 100644 --- a/lorax/lorax.spec +++ b/lorax/lorax.spec @@ -2,10 +2,6 @@ # NOTE: Please submit changes as a pull request %define debug_package %{nil} -%if 0%{?qubes_builder} -%define _sourcedir %(pwd)/lorax -%endif - Name: lorax Version: 25.19 Release: 1%{?dist} diff --git a/pungi/pungi.spec b/pungi/pungi.spec index 4cc3fb9..373e79a 100644 --- a/pungi/pungi.spec +++ b/pungi/pungi.spec @@ -1,7 +1,3 @@ -%if 0%{?qubes_builder} -%define _sourcedir %(pwd)/pungi -%endif - Name: pungi Version: 4.1.14 Release: 2%{?dist} diff --git a/pykickstart/pykickstart.spec b/pykickstart/pykickstart.spec index a24a8af..cfa1e4b 100644 --- a/pykickstart/pykickstart.spec +++ b/pykickstart/pykickstart.spec @@ -1,9 +1,5 @@ %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%if 0%{?qubes_builder} -%define _sourcedir %(pwd)/pykickstart -%endif - Name: pykickstart Version: 2.32 Release: 4%{?dist} @@ -22,7 +18,7 @@ Url: http://fedoraproject.org/wiki/pykickstart # sudo dnf install zanata-python-client # make po-pull && make archive # The tarball will be in the current directory. -Source0: %{name}-%{version}.tar.gz +Source0: %{name}-%{version}.tar.gz Patch0: 0001-Ignore-errors-from-coverage-tests-138.patch Patch1: 0001-Fix-error-message-in-autopart-command.patch Patch2: repo-gpgkey-option.patch diff --git a/qubes-anaconda-addon/qubes-anaconda-addon.spec b/qubes-anaconda-addon/qubes-anaconda-addon.spec index f809e86..0903d7e 100644 --- a/qubes-anaconda-addon/qubes-anaconda-addon.spec +++ b/qubes-anaconda-addon/qubes-anaconda-addon.spec @@ -1,7 +1,3 @@ -%if 0%{?qubes_builder} -%define _builddir %(pwd)/qubes-anaconda-addon -%endif - Name: qubes-anaconda-addon Version: 4.0.6 Release: 1%{?dist} @@ -17,15 +13,14 @@ Requires: qubes-mgmt-salt-dom0-virtual-machines >= 4.0.11 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Source0: %{name}-%{version}.tar.gz + %description This is an addon that makes available Qubes OS specific setup functionality at first boot time. %prep -true - -%build -true +%setup -q %install rm -rf $RPM_BUILD_ROOT diff --git a/qubes-release/qubes-dom0-dist-upgrade.spec b/qubes-release/qubes-dom0-dist-upgrade.spec index cb49d5f..ebc3c50 100644 --- a/qubes-release/qubes-dom0-dist-upgrade.spec +++ b/qubes-release/qubes-dom0-dist-upgrade.spec @@ -1,16 +1,12 @@ %define fedora_base_version %{fedora} -%if 0%{?qubes_builder} -%define _builddir %(pwd)/qubes-release -%endif - Summary: Qubes dom0 dist upgrade Name: qubes-dom0-dist-upgrade Version: 2.0 Release: 2 License: GPLv2 Group: System Environment/Base -Source: %{name}-%{version}.tar.bz2 +Source0: %{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -18,11 +14,7 @@ BuildArch: noarch Qubes dom0 upgrade transitional package. %prep -%if ! 0%{?qubes_builder} %setup -q -%endif - -%build %install rm -rf $RPM_BUILD_ROOT diff --git a/qubes-release/qubes-release.spec b/qubes-release/qubes-release.spec index 455c3b5..2f26f9b 100644 --- a/qubes-release/qubes-release.spec +++ b/qubes-release/qubes-release.spec @@ -2,10 +2,6 @@ %define release_name R%{dist_version} %define fedora_base_version %{fedora} -%if 0%{?qubes_builder} -%define _builddir %(pwd)/qubes-release -%endif - Summary: Qubes release files Name: qubes-release Version: %{dist_version} @@ -39,11 +35,7 @@ Qubes release notes package. %prep -%if ! 0%{?qubes_builder} %setup -q -%endif - -%build %install rm -rf $RPM_BUILD_ROOT