X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=Makefile.in;h=bf1e66ca80026e7b2f55002e30278010eb4a5fd0;hb=1e5446a53fa072c4baadf12b2a8f7fd1adca4d19;hp=aa8d8b47d62dd6a4ae5ffd1242b92f5506fb3cb0;hpb=2f310f865b2a264bcad2a9fe15535e0d0df56f7a;p=virt-p2v.git diff --git a/Makefile.in b/Makefile.in index aa8d8b4..bf1e66c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -34,10 +34,13 @@ 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)" @@ -50,13 +53,43 @@ all: 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 p2vrepo/$(VIRTP2V_RPM) + +RPM_FLAGS := --define "_topdir %(pwd)/rpmbuild" \ + --define "_builddir %{_topdir}/BUILD" \ + --define "_rpmdir %{_topdir}/RPMS" \ + --define "_srcrpmdir %{_topdir}/SRPMS" \ + --define "_specdir %{_topdir}/SPECS" \ + --define "_sourcedir %(pwd)" + +p2vrepo/$(VIRTP2V_RPM): \ + virt-p2v.spec \ + virt-p2v virt-p2v-update-wrapper iso-attach \ + inittab + $(MAKE) dist + rm -rf rpmbuild + mkdir rpmbuild rpmbuild/{RPMS,BUILD,SRPMS,SPECS} rpmbuild/RPMS/noarch + rpmbuild $(RPM_FLAGS) -ba $< + mkdir -p p2vrepo + cp rpmbuild/RPMS/noarch/$(VIRTP2V_RPM) p2vrepo + createrepo p2vrepo + +# Make the final script. + +virt-p2v: virt-p2v.ml0 virt-p2v.ml + rm -f $@ + cat $^ > $@ + chmod 0555 $@ + # Run live CD under qemu. ifeq ($(HAVE_QEMU_KVM),qemu-kvm) @@ -106,18 +139,33 @@ 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 p2vrepo/$(VIRTP2V_RPM) + # Clean. clean: - rm -f *~ core p2v.ks pod2htm* + rm -f *~ core virt-p2v pod2htm* distclean: clean - rm -rf autom4te.cache config.log config.status configure + 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 @@ -180,11 +228,9 @@ upload_iso: # Upload PXE image. -PXE_TAR := $(PACKAGE)-$(VERSION)-pxeboot.tar - upload_pxe: tar cf $(PXE_TAR) tftpboot scp -l 300 $(PXE_TAR) et.redhat.com:public_html/tmp/ - rm $(PXE_TAR) +# rm $(PXE_TAR) .PHONY: build boot checkroot \ No newline at end of file