X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Makefile;h=2441af5f8e7193cb922645eb14b74e44daf0144e;hb=5919d0191a10c9ccabd905b52092e70dd2fa79fd;hp=bbe3bea17c9c13e3ef8ca36a48d8e2a0722f3ce1;hpb=83a7514f97c21f41b01ddcd8eacd6411b137b69e;p=build.git diff --git a/Makefile b/Makefile index bbe3bea1..2441af5f 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ ### $Id$ # #################### -# invokation: +# invocation: # # (*) make stage1=true # this extracts all specfiles and computes .mk from specfiles @@ -29,17 +29,17 @@ # (*) create your main yumgroups.xml as groups/.xml # (*) there are also various places where a set of modules are defined. # check for .lst files in the various modules that build root images -# and mimick what's done for planetlab +# and mimic what's done for planetlab # (*) then you need to run # make stage1=true PLDISTRO=onelab # #################### # This build deals with 2 kinds of objects # -# (*) packages are named upon the RPM name; they are moslty lowercase +# (*) packages are named upon the RPM name; they are mostly lowercase # Add a package to ALL if you want it built as part of the default set. # (*) modules are named after the subversion tree; as of this writing their names -# are mostly mixedcase like MyPLC or Vserverreference +# are mostly mixed case like MyPLC or Vserverreference # #################### packages # basics: how to build a package - you need/may define the following variables @@ -63,7 +63,7 @@ # (*) package-DEPENDDEVELS # a set of *packages* that the build will rpm-install the -devel variant before building # (*) package-DEPENDDEVELRPMS -# a set of *rpm* that the build will rpm-install before building +# a set of *rpms* that the build will rpm-install before building # (*) package-DEPENDFILES # a set of files that the package depends on - and that make needs to know about # if this contains RPMS/yumgroups.xml, then the toplevel RPMS's index @@ -193,14 +193,14 @@ include $(ALLMKS) # this is because the inter-package dependencies are expressed like # util-vserver: util-python all: rpms +all: repo endif endif #################### # gather build information for the 'About' page -SOURCES/myplc-release: +myplc-release: @echo 'Creating myplc-release' - mkdir -p SOURCES rm -f $@ (echo -n 'Build bdate: ' ; date '+%Y.%m.%d') >> $@ (echo -n 'Build btime: ' ; date '+%H:%M') >> $@ @@ -210,6 +210,23 @@ SOURCES/myplc-release: echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx modules versions info" >> $@ $(MAKE) --no-print-directory versions >> $@ +### yumgroups.xml +# the source +ifndef YUMGROUPS +YUMGROUPS := groups/$(PLDISTRO).xml +endif + +RPMS/yumgroups.xml: $(YUMGROUPS) + mkdir -p RPMS + install -D -m 644 $(YUMGROUPS) $@ + +createrepo = createrepo --quiet -g yumgroups.xml RPMS/ + +repo: RPMS/yumgroups.xml + $(createrepo) + +.PHONY: repo + #################### # notes: # * to make configuration easier, we always use the first module's @@ -285,6 +302,7 @@ export HOME := /building echo "%_tmppath $(HOME)/tmp" >> $@ echo "%_netsharedpath /proc:/dev/pts" >> $@ echo "%_install_langs C:de:en:es:fr" >> $@ + echo "%_excludedocs yes" >> $@ ### run spec2make on the spec file and include the result # usage: spec2make package @@ -393,8 +411,8 @@ ifeq "$(subst srpm,,$(1))" "$(1)" $($(1)-SRPM): $($(1)_specpath) .rpmmacros $($(1)-TARBALLS) mkdir -p BUILD SRPMS tmp @(echo -n "XXXXXXXXXXXXXXX -- BEG SRPM $(1) " ; date) - -$(foreach devel,$($(1)-DEPENDDEVELS), $(if $($(devel)-DEVEL-RPMS),rpm -Uvh $($(devel)-DEVEL-RPMS);)) - -$(foreach rpm,$($(1)-DEPENDDEVELRPMS), rpm -Uvh $($(rpm)-RPM-PATH);) + -$(foreach devel,$($(1)-DEPENDDEVELS), $(if $($(devel)-DEVEL-RPMS),rpm --force -Uvh $($(devel)-DEVEL-RPMS);)) + -$(foreach rpm,$($(1)-DEPENDDEVELRPMS), rpm --force -Uvh $($(rpm)-RPM-PATH);) $(if $($(1)-RPMBUILD),\ $($(1)-RPMBUILD) $($(1)-RPMFLAGS) -bs $($(1)_specpath), $(RPMBUILD) $($(1)-RPMFLAGS) -bs $($(1)_specpath)) @@ -403,8 +421,8 @@ else $($(1)-SRPM): $($(1)_specpath) .rpmmacros $($(1)-CODEBASE) mkdir -p BUILD SRPMS tmp @(echo -n "XXXXXXXXXXXXXXX -- BEG SRPM $(1) (using make srpm) " ; date) - -$(foreach devel,$($(1)-DEPENDDEVELS), $(if $($(devel)-DEVEL-RPMS),rpm -Uvh $($(devel)-DEVEL-RPMS);)) - -$(foreach rpm,$($(1)-DEPENDDEVELRPMS), rpm -Uvh $($(rpm)-RPM-PATH);) + -$(foreach devel,$($(1)-DEPENDDEVELS), $(if $($(devel)-DEVEL-RPMS),rpm --force -Uvh $($(devel)-DEVEL-RPMS);)) + -$(foreach rpm,$($(1)-DEPENDDEVELRPMS), rpm --force -Uvh $($(rpm)-RPM-PATH);) make -C $($(1)-CODEBASE) srpm && \ rm -f SRPMS/$(notdir $($(1)-SRPM)) && \ ln $($(1)-CODEBASE)/$(notdir $($(1)-SRPM)) SRPMS/$(notdir $($(1)-SRPM)) @@ -427,22 +445,15 @@ define target_binary_rpm $($(1)-RPMS): $($(1)-SRPM) mkdir -p BUILD RPMS SPECS tmp @(echo -n "XXXXXXXXXXXXXXX -- BEG RPM $(1) " ; date) - $(if $(findstring RPMS/yumgroups.xml,$($(1)-DEPENDFILES)), createrepo --quiet -g yumgroups.xml RPMS/ , ) + $(if $(findstring RPMS/yumgroups.xml,$($(1)-DEPENDFILES)), $(createrepo) , ) $(if $($(1)-RPMBUILD),\ - $($(1)-RPMBUILD) $($(1)-RPMFLAGS) --rebuild $($(1)-SRPM), \ - $(RPMBUILD) $($(1)-RPMFLAGS) --rebuild $($(1)-SRPM)) + $($(1)-RPMBUILD) $($(1)-RPMFLAGS) --rebuild --define "_sourcedir $(HOME)/tmp" $($(1)-SRPM), \ + $(RPMBUILD) $($(1)-RPMFLAGS) --rebuild --define "_sourcedir $(HOME)/tmp" $($(1)-SRPM)) @(echo -n "XXXXXXXXXXXXXXX -- END RPM $(1) " ; date) endef $(foreach package,$(ALL),$(eval $(call target_binary_rpm,$(package)))) -### RPMS/yumgroups.xml -ifndef YUMGROUPS -YUMGROUPS := groups/$(PLDISTRO).xml -endif -RPMS/yumgroups.xml: $(YUMGROUPS) - install -D -m 644 $(YUMGROUPS) $@ - ### shorthand target # e.g. make proper -> does propers rpms # usage shorthand_target package