X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=Makefile.in;h=f5df4b4c6b59a6cb9ed9c5ec7b32567343c9e0f3;hb=239238d125f4590e35f288ecfe656d2e12e756d0;hp=ad3fcdf1be66d632d5f41530a6ab00ee1c169660;hpb=1fd8358e3af30b4b34bbc28dc64ce1b11a001429;p=virt-p2v.git diff --git a/Makefile.in b/Makefile.in index ad3fcdf..f5df4b4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -30,31 +30,62 @@ HAVE_PERLDOC := @HAVE_PERLDOC@ HAVE_QEMU := @HAVE_QEMU@ HAVE_QEMU_KVM := @HAVE_QEMU_KVM@ HAVE_LIVECD_CREATOR := @HAVE_LIVECD_CREATOR@ +HAVE_LIVECD_ISO_TO_PXEBOOT := @HAVE_LIVECD_ISO_TO_PXEBOOT@ LABEL := $(PACKAGE)-$(VERSION) ISO := $(LABEL).iso +PXE_TAR := $(PACKAGE)-$(VERSION)-pxeboot.tar +VIRTP2V_RPM := $(PACKAGE)-$(VERSION)-1.noarch.rpm #---------------------------------------------------------------------- all: + @echo "make rpm Build the virt-p2v RPM" @echo "make build Build the live CD ISO" @echo "make boot [HDA=hda.img] [HDB=hdb.img] [ISO=livecd.iso]" @echo " Boot built/named ISO (uses qemu)" @echo "make update Update an existing live CD ISO with new" @echo " virt-p2v script, without doing full rebuild" + @echo "make pxe Build a PXE image (in tftpboot/ subdirectory)" @echo "make man Make man pages (needs POD)" # Build live CD. ifeq ($(HAVE_LIVECD_CREATOR),livecd-creator) -build: p2v.ks checkroot checkscript +build: checkroot checkrpm checkscript rm -f $(ISO) - livecd-creator --config=$< --fslabel=$(LABEL) + livecd-creator --config=p2v.ks --fslabel=$(LABEL) ls -lhtr *.iso endif +# Build RPM of virt-p2v. + +rpm: checknotroot rpmbuild/$(VIRTP2V_RPM) + +RPM_FLAGS := --define "_topdir %(pwd)/rpmbuild" \ + --define "_builddir %{_topdir}" \ + --define "_rpmdir %{_topdir}" \ + --define "_srcrpmdir %{_topdir}" \ + --define "_rpmfilename $(VIRTP2V_RPM)" \ + --define "_specdir %{_topdir}" \ + --define "_sourcedir %(pwd)" + +rpmbuild/$(VIRTP2V_RPM): \ + virt-p2v.spec \ + virt-p2v virt-p2v-update-wrapper iso-attach \ + inittab + mkdir -p rpmbuild + rpmbuild $(RPM_FLAGS) -ba $< + createrepo rpmbuild + +# Make the final script. + +virt-p2v: virt-p2v.ml0 virt-p2v.ml + cat $^ > $@ + chmod 0555 $@ + # Run live CD under qemu. ifeq ($(HAVE_QEMU_KVM),qemu-kvm) @@ -84,9 +115,18 @@ endif # Update an existing ISO. update: checkroot checkscript - -./iso-attach delete $(ISO) + -./iso-attach delete $(ISO) 2>/dev/null ./iso-attach add $(ISO) virt-p2v +# PXE boot. + +ifeq ($(HAVE_LIVECD_ISO_TO_PXEBOOT),livecd-iso-to-pxeboot) + +pxe: checkroot checkscript + livecd-iso-to-pxeboot $(ISO) + +endif + # Check that we are root. checkroot: @@ -95,15 +135,36 @@ checkroot: exit 1; \ fi +# Check that we are not root. + +checknotroot: + @if [ `id -u` -eq 0 ]; then \ + echo "You must not perform this step as root."; \ + exit 1; \ + fi + # Check that the script compiles. checkscript: + test -x virt-p2v ./virt-p2v --test +# Check that the RPM has been built. + +checkrpm: + test -f rpmbuild/$(VIRTP2V_RPM) + # Clean. clean: - rm -f *~ core livecd.ks livecd-post.sh + rm -f *~ core virt-p2v pod2htm* + +distclean: clean + rm -rf autom4te.cache config.log config.status configure \ + p2v.ks Makefile po/Makefile virt-p2v.spec + +reallyreallyclean: distclean + rm -f virt-p2v-*.tar.gz virt-p2v-*.iso # Manifest. @@ -152,9 +213,20 @@ website: man dist cp virt-p2v.1.css $(WEBSITE_DIR) cp $(PACKAGE)-$(VERSION).tar.gz $(WEBSITE_DIR) +# Upload everything. + +upload: upload_iso upload_pxe + # Upload ISO. upload_iso: scp -l 300 $(ISO) et.redhat.com:public_html/tmp/ +# Upload PXE image. + +upload_pxe: + tar cf $(PXE_TAR) tftpboot + scp -l 300 $(PXE_TAR) et.redhat.com:public_html/tmp/ +# rm $(PXE_TAR) + .PHONY: build boot checkroot \ No newline at end of file