From 0f1a3383100c2a604b63a5a81412340525f67ce1 Mon Sep 17 00:00:00 2001 From: David Huff Date: Fri, 9 Oct 2009 16:53:47 -0400 Subject: [PATCH] Modified makefile for Fedora --- Makefile.am | 81 +++++++++++-------------------------------------------------- 1 file changed, 14 insertions(+), 67 deletions(-) diff --git a/Makefile.am b/Makefile.am index 2316e1e..3b8ed27 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,44 +17,27 @@ OVIRT_CACHE_DIR ?= $(HOME)/ovirt-cache OVIRT_LOCAL_REPO ?= file://$(OVIRT_CACHE_DIR)/ovirt -OVIRT_URL ?= http://ovirt.org/repos/ovirt +OVIRT_NODE_RECIPE ?= /usr/share/ovirt-node-tools/ovirt-node-recipe.ks SUM ?= sha1sum PKG_FMT = iso SRC_FMT ?= tar AUTH_KEYS ?= ~/.ssh/authorized_keys -FEDORA_MIRROR = http://mirrors.fedoraproject.org/mirrorlist -CUR_RAWHIDE = 13 - -FEDORA = $(shell rpm --eval '%{fedora}') ARCH = $(shell rpm --eval '%{_arch}') -CUR_PREVIEW = 12 -PREVIEW_URL ?= http://jforbes.fedorapeople.org/virt-preview/f$(CUR_PREVIEW)/$(ARCH) - NVR = $(PACKAGE)-$(VERSION)-$(ARCH) EXTRA_DIST = \ .gitignore \ $(PACKAGE).spec \ $(PACKAGE).spec.in \ - common-blacklist.ks \ - common-install.ks \ - common-pkgs.ks \ - common-post.ks \ - $(PACKAGE).ks \ - create-ovirt-iso-nodes \ - edit-livecd \ - livecd-iso-to-iscsi \ - livecd-setauth \ - livecd-rpms \ README DISTCLEANFILES = $(PACKAGE)-$(VERSION).tar.gz \ $(PACKAGE).$(PKG_FMT) \ $(NVR).$(PKG_FMT) \ $(NVR).$(PKG_FMT).$(SUM) \ - repos.ks ovirt-authorized_keys + ovirt-authorized_keys # For Release: 0..., set _ovirt_dev=1 so that we get extra_release.GIT- # annotated rpm version strings. @@ -69,49 +52,8 @@ RPM_FLAGS = --define "ovirt_cache_dir $(OVIRT_CACHE_DIR)" RPM_FLAGS += $(if $(_ovirt_dev),--define "extra_release .$(GIT_RELEASE)") NODE_TMP = $(OVIRT_CACHE_DIR)/$(PACKAGE)-$(ARCH)-tmp SRC_KS = $(NODE_TMP)/src.ks +NODE_KS = $(NODE_TMP)/node.ks -repos.ks: - ( \ - if [ 0$(FEDORA) == 0$(CUR_RAWHIDE) ]; then \ - FEDORA_REPO=rawhide ;\ - FEDORA_REPO_LOC="$(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/development/$(ARCH)/os,--mirrorlist=$(FEDORA_MIRROR)?repo=rawhide&arch=$(ARCH))" ;\ - OVIRT_DISTRO=development ;\ - else \ - FEDORA_REPO=f$(FEDORA) ;\ - FEDORA_REPO_LOC="$(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/releases/$(FEDORA)/Everything/${ARCH}/os,--mirrorlist=$(FEDORA_MIRROR)?repo=fedora-$(FEDORA)&arch=$(ARCH))" ;\ - OVIRT_DISTRO=$(FEDORA) ;\ - UPDATE_REPO_LINE="repo --name=$${FEDORA_REPO}-updates $(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/updates/$(FEDORA)/${ARCH},--mirrorlist=$(FEDORA_MIRROR)?repo=updates-released-f$(FEDORA)&arch=$(ARCH))\n" ;\ - if [ 0$(FEDORA) == 0$(CUR_PREVIEW) ]; then \ - UPDATE_REPO_LINE="$${UPDATE_REPO_LINE}repo --name=preview --baseurl=$(PREVIEW_URL)\n" ;\ - fi ;\ - fi ;\ - echo "repo --name=$${FEDORA_REPO} $${FEDORA_REPO_LOC}" > $@ ;\ - echo "repo --name=ovirt-org --baseurl=$(OVIRT_URL)/$${OVIRT_DISTRO}/$(ARCH)" >> $@ ;\ - printf "$${UPDATE_REPO_LINE}" >> $@ ;\ - echo "repo --name=ovirt-local --baseurl=$(OVIRT_LOCAL_REPO)" >> $@ \ - ) - -src.ks: repos.ks - mkdir -p $(NODE_TMP) - ( \ - cat repos.ks ;\ - if [ 0$(FEDORA) == 0$(CUR_RAWHIDE) ]; then \ - FEDORA_REPO=rawhide ;\ - FEDORA_REPO_LOC="$(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/development/source/SRPMS,--mirrorlist=$(FEDORA_MIRROR)?repo=rawhide-source&arch=source)" ;\ - OVIRT_DISTRO=development ;\ - else \ - FEDORA_REPO=f$(FEDORA) ;\ - FEDORA_REPO_LOC="$(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/releases/$(FEDORA)/Everything/source/SRPMS,--mirrorlist=$(FEDORA_MIRROR)?repo=fedora-source-$(FEDORA)&arch=source)" ;\ - OVIRT_DISTRO=$(FEDORA) ;\ - UPDATE_REPO_LINE="repo --name=$${FEDORA_REPO}-updates-source $(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/updates/$(FEDORA)/SRPMS,--mirrorlist=$(FEDORA_MIRROR)?repo=updates-released-source-f$(FEDORA)&arch=source)" ;\ - fi ;\ - echo "repo --name=$${FEDORA_REPO}-source $${FEDORA_REPO_LOC}" ;\ - echo "repo --name=ovirt-org-source --baseurl=$(OVIRT_URL)/$${OVIRT_DISTRO}/src" ;\ - echo "$${UPDATE_REPO_LINE}" ;\ - echo "%packages --nobase" ;\ - grep -v '^-' common-pkgs.ks ;\ - echo "%end" ;\ - ) > $(SRC_KS) keys: if [ "$(_ovirt_dev)" = 1 -a -f $(AUTH_KEYS) ]; then \ @@ -119,15 +61,15 @@ keys: fi SELINUX_ENFORCING=$(shell /usr/sbin/getenforce) -$(NVR).$(PKG_FMT): no_nscd repos.ks keys +$(NVR).$(PKG_FMT): no_nscd keys mkdir -p $(NODE_TMP) mkdir -p $(OVIRT_CACHE_DIR)/yum-$(ARCH) ( \ case $(SELINUX_ENFORCING) in \ Enforcing) sudo /usr/sbin/setenforce Permissive ;; \ Permissive) ;; \ - *) if ksflatten $(PACKAGE).ks 2>/dev/null \ - | grep -q '^selinux --disabled'; then \ + *) if grep -q '^selinux --disabled' $(OVIRT_NODE_RECIPE); \ + then \ echo WARNING: SELinux disabled in kickstart ;\ else \ echo ERROR: SELinux enabled in kickstart, \ @@ -136,7 +78,12 @@ $(NVR).$(PKG_FMT): no_nscd repos.ks keys fi ;; \ esac ;\ ) - sudo livecd-creator --skip-minimize -c $(PACKAGE).ks \ + rm -f $(NODE_KS) + if [ "$(_ovirt_dev)" = 1 ]; then \ + echo "repo --name=ovirt-local --baseurl=$(OVIRT_LOCAL_REPO)" > $(NODE_KS) ;\ + fi + cat $(OVIRT_NODE_RECIPE) >> $(NODE_KS) + sudo livecd-creator --skip-minimize -c $(NODE_KS)\ -f $(PACKAGE) \ --tmpdir='$(NODE_TMP)' \ --cache='$(OVIRT_CACHE_DIR)/yum-$(ARCH)' @@ -155,7 +102,7 @@ $(NVR).$(PKG_FMT).$(SUM): $(NVR).$(PKG_FMT) $(PACKAGE).$(PKG_FMT) node: $(NVR).$(PKG_FMT).$(SUM) PUNGI = $(NODE_TMP)/tree/pungi -source: src.ks +source: @sudo rm -Rf $(PUNGI) @mkdir -p $(PUNGI) @@ -209,5 +156,5 @@ no_nscd: fi .PHONY: rpms publish srpms $(NVR).$(PKG_FMT).$(SUM) $(NVR).$(PKG_FMT) \ - $(PACKAGE).$(PKG_FMT) keys repos.ks src.ks source _publish iso_srpms \ + $(PACKAGE).$(PKG_FMT) keys src.ks source _publish iso_srpms \ no_nscd -- 2.11.4.GIT