David Huff
2008-Nov-20 22:31 UTC
[Ovirt-devel] [PATCH node-image] Added subpackage for srpms, ovirt-node-image-srpms
Workaround which uses pungi to downoad srpms and create a srpm.iso. This patch takes alot from ovirt-release ovirt.mk. Packages srpms into a new subrpm which only contains the source iso. Adds new RPM flag pungi_srpms to toggle srpm iso creation. --- Makefile.am | 47 ++++++++++++++++++++++++++++++++++++++++++++++ ovirt-node-image.spec.in | 32 ++++++++++++++++++++++++++++++- 2 files changed, 78 insertions(+), 1 deletions(-) diff --git a/Makefile.am b/Makefile.am index 61f826f..d34c8a1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -65,6 +65,8 @@ RPMDIR = $$(rpm --eval '%{_rpmdir}') RPM_FLAGS = --define "ovirt_cache_dir $(OVIRT_CACHE_DIR)" RPM_FLAGS += $(if $(_ovirt_dev),--define "extra_release .$(GIT_RELEASE)") RPM_FLAGS += --define "source_iso 1" +RPM_FLAGS += --define "pungi_srpms 1" +SRC_KS = $(OVIRT_CACHE_DIR)/$(PACKAGE)-tmp/src.ks repos.ks: ( \ @@ -125,6 +127,51 @@ $(NVR).$(PKG_FMT).$(SUM): $(NVR).$(PKG_FMT) $(PACKAGE).$(PKG_FMT) node: $(NVR).$(PKG_FMT).$(SUM) +$(PACKAGE).source source: $(NVR).$(PKG_FMT).$(SUM).source + +$(NVR).$(PKG_FMT).$(SUM).source: $(NVR).$(PKG_FMT).source + +$(NVR).$(PKG_FMT).source: + @mkdir -p $(OVIRT_CACHE_DIR)/$(PACKAGE)-tmp/tree/pungi + @sudo rm -Rf $(OVIRT_CACHE_DIR)/$(PACKAGE)-tmp/tree/pungi/* + @( if [ -n "$(FEDORA_URL)" ]; then \ + echo "repo --name=f$(FEDORA) --baseurl=$(FEDORA_URL)/releases/$(FEDORA)/Everything/\$$basearch/os" ; \ + echo "repo --name=f$(FEDORA)-updates --baseurl=$(FEDORA_URL)/updates/$(FEDORA)/\$$basearch" ; \ + echo "repo --name=f$(FEDORA)-updates-newkey --baseurl=$(FEDORA_URL)/updates/$(FEDORA)/\$$basearch.newkey" ; \ + echo "repo --name=f$(FEDORA)-src --baseurl=$(FEDORA_URL)/releases/$(FEDORA)/Everything/source/SRPMS" ; \ + echo "repo --name=f$(FEDORA)-updates-src --baseurl=$(FEDORA_URL)/updates/$(FEDORA)/SRPMS" ; \ + echo "repo --name=f$(FEDORA)-updates-src-newkey --baseurl=$(FEDORA_URL)/updates/$(FEDORA)/SRPMS.newkey" ; \ + else \ + echo "repo --name=f$(FEDORA) --mirrorlist=$(FEDORA_MIRROR)?repo=fedora-$(FEDORA)&arch=\$$basearch" ; \ + echo "repo --name=f$(FEDORA)-updates --mirrorlist=$(FEDORA_MIRROR)?repo=updates-released-f$(FEDORA)&arch=\$$basearch" ; \ + echo "repo --name=f$(FEDORA)-updates-newkey --mirrorlist=$(FEDORA_MIRROR)?repo=updates-released-f$(FEDORA).newkey&arch=\$$basearch" ; \ + echo "repo --name=f$(FEDORA)-src --mirrorlist=$(FEDORA_MIRROR)?repo=fedora-source-$(FEDORA)&arch=src" ; \ + echo "repo --name=f$(FEDORA)-updates-src --mirrorlist=$(FEDORA_MIRROR)?repo=updates-released-source-f$(FEDORA)&arch=src" ; \ + echo "repo --name=f$(FEDORA)-updates-src-newkey --mirrorlist=$(FEDORA_MIRROR)?repo=updates-released-source-f$(FEDORA).newkey&arch=src" ; \ + fi ; \ + echo "repo --name=ovirt-org --baseurl=$(OVIRT_URL)/$(FEDORA)/\$$basearch" ; \ + echo "repo --name=ovirt-org-src --baseurl=$(OVIRT_URL)/$(FEDORA)/src" ; \ + echo "#repo --name=thincrust-net --baseurl=$(THINCRUST_URL)/noarch" ; \ + echo "#repo --name=thincrust-net-src --baseurl=$(THINCRUST_URL)/srpms" ; \ + echo "#repo --name=ovirt-local --baseurl=file://$(OVIRT_CACHE_DIR)/ovirt" ; \ + echo "%packages --nobase" ; \ + grep -v '^-' /usr/share/appliance-os/includes/base-pkgs.ks ; \ + echo "lokkit" ; \ + for dir in $(SUBDIRS); do \ + echo "ovirt-$$dir" ; \ + test -f $$dir/common-pkgs.ks && grep -v '^-' $$dir/common-pkgs.ks ; \ + done ; \ + echo "%end" ) > $(SRC_KS) + cd $(OVIRT_CACHE_DIR)/$(PACKAGE)-tmp/tree/pungi && \ + pungi -G --ver=$(PACKAGE) -c $(SRC_KS) --cachedir=$(OVIRT_CACHE_DIR)/yum + cd $(OVIRT_CACHE_DIR)/$(PACKAGE)-tmp/tree/pungi && \ + sudo pungi --sourceiso --ver=$(PACKAGE) -c $(SRC_KS) --cachedir=$(OVIRT_CACHE_DIR)/yum + sudo mv $(OVIRT_CACHE_DIR)/$(PACKAGE)-tmp/tree/pungi/$(PACKAGE)/source/iso/Fedora-$(PACKAGE)-source.iso ./$(PACKAGE)-source.iso + sudo sudo chown -R $(USER) ./$(PACKAGE)-source.iso + sudo sudo chown -R $(USER) $(OVIRT_CACHE_DIR)/$(PACKAGE)-tmp/tree/pungi + sudo rm -Rf $(OVIRT_CACHE_DIR)/$(PACKAGE)-tmp/tree/pungi + @rm $(SRC_KS) + rpms: dist node rpmbuild $(RPM_FLAGS) -ta $(distdir).tar.gz diff --git a/ovirt-node-image.spec.in b/ovirt-node-image.spec.in index 009a499..851a475 100644 --- a/ovirt-node-image.spec.in +++ b/ovirt-node-image.spec.in @@ -1,5 +1,6 @@ #include pre-built image ISO as source %{!?source_iso: %define source_iso 0} +%{!?pungi_srpms: %define pungi_srpms 0} Summary: oVirt Node ISO image Name: ovirt-node-image @@ -29,9 +30,21 @@ Requires: appliance-tools >= 003.9 The ISO boot image for oVirt Node booting from CDROM device. At the moment, this RPM just packages prebuilt ISO. +%if %{pungi_srpms} +%package srpms +Summary: oVirt Node source ISO image +Group: Applications/System +BuildRequires: pungi + +%description srpms +The source rpms for the ISO boot image for oVirt Node. At the moment, this RPM just contains a iso of the srpms + +%define image_source_iso %{name}-source.iso +%endif + %prep %setup -q -%if ! %{source_iso} +%if ! %{source_iso} || %{pungi_srpms} ./configure %endif @@ -42,6 +55,12 @@ make %{?ovirt_cache_dir: OVIRT_CACHE_DIR=%{ovirt_cache_dir}} \ %{?ovirt_url: OVIRT_URL=%{ovirt_url}} \ %{name}.iso %endif +%if %{pungi_srpms} + make %{?ovirt_cache_dir: OVIRT_CACHE_DIR=%{ovirt_cache_dir}} \ + %{?ovirt_local_repo: OVIRT_LOCAL_REPO=%{ovirt_local_repo}} \ + %{?ovirt_url: OVIRT_URL=%{ovirt_url}} \ + %{name}.source +%endif %install %{__rm} -rf %{buildroot} @@ -49,6 +68,9 @@ mkdir %{buildroot} %{__install} -d -m0755 %{buildroot}%{app_root} %{__install} -p -m0644 %{image_iso} %{buildroot}%{app_root} +%if %{pungi_srpms} + %{__install} -p -m0644 %{image_source_iso} %{buildroot}%{app_root} +%endif %{__install} -d -m0755 %{buildroot}%{_sbindir} %{__install} -p -m0755 ovirt-pxe %{buildroot}%{_sbindir} %{__install} -p -m0755 ovirt-flash %{buildroot}%{_sbindir} @@ -71,7 +93,15 @@ mkdir %{buildroot} %{_sbindir}/edit-livecd %{_sbindir}/livecd-setauth +%if %{pungi_srpms} +%files srpms +%{app_root}/%{name}-source.iso +%endif + %changelog +* Thu Nov 20 2008 David Huff <dhuff at redhat.com> 0.93 +- add pungi source iso + * Thu Jul 03 2008 Perry Myers <pmyers at redhat.com> 0.92-0 - Only store ISO in SRPM, and generate PXE from that during build -- 1.5.5.1
Alan Pevec
2008-Nov-21 17:38 UTC
[Ovirt-devel] Re: [PATCH node-image] Added subpackage for srpms, ovirt-node-image-srpms
> +RPM_FLAGS += --define "pungi_srpms 1"we don't need to have that enabled by default, only for release builds so make it conditional on _ovirt_dev (like extra_release two lines above)