2 # Thierry Parmentelat - INRIA Sophia Antipolis
10 # this extracts all specfiles and computes .mk from specfiles
11 # you need to specify PLDISTRO here if relevant - see below
13 # for more info on how to invoke this stuff
15 #################### (fedora) distributions
17 # (*) as of nov. 2007, myplc-devel is deprecated
18 # (*) instead, we create a fresh vserver that holds required tools (see e.g. planetlab-devel.lst)
19 # (*) the build uses the current fedora version as a target for the produced images
20 # (*) so you simply need to create a fedora 8 build image for building fedora-8 images
22 #################### (planetlab) distributions
24 # (*) the default distribution is called 'planetlab'
25 # (*) you may define an alternative distribution, e.g. onelab
26 # in this case you need to
27 # (*) create onelab.mk that defines your *packages* (see below)
28 # (*) create onelab-tags.mk that defines where to fetch your *modules*
29 # (*) create your main yumgroups.xml as groups/<distro>.xml
30 # (*) there are also various places where a set of modules are defined.
31 # check for .lst files in the various modules that build root images
32 # and mimic what's done for planetlab
33 # (*) then you need to run
34 # make stage1=true PLDISTRO=onelab
37 # This build deals with 3 kinds of objects
39 # (*) packages are named upon the RPM name; they are mostly lowercase
40 # Add a package to ALL if you want it built as part of the default set.
41 # (*) modules are named after the subversion tree; as of this writing their names
42 # are mostly mixed case like MyPLC or VserverReference
43 # (*) rpms are named in the spec files. A package typically defines several rpms;
44 # rpms are used for defining DEPEND-DEVEL-RPMS. See also package.rpmnames
46 #################### packages
47 # basics: how to build a package - you need/may define the following variables
50 # a package needs one or several modules to build.
53 # the package's specfile; this is relative to the FIRST module in package-MODULES
54 # see 'codebase' below
58 # (*) package-SPECVARS
59 # space-separated list of spec variable definitions, where you can reference make variable that relate to
60 # packages defined BEFORE the current one (note: you should use = - as opposed to := - to define these)
61 # e.g. mydriver-SPECVARS = foo=$(kernel-rpm-release)
62 # would let you use the %release from the kernel's package when rpmbuild'ing mydriver - see automatic below
63 # (*) package-DEPEND-PACKAGES
64 # a set of *packages* that this package depends on
65 # (*) package-DEPEND-DEVEL-RPMS
66 # a set of *rpms* that the build will rpm-install before building <package>
67 # (*) package-DEPEND-FILES
68 # a set of files that the package depends on - and that make needs to know about
69 # if this contains RPMS/yumgroups.xml, then the toplevel RPMS's index
70 # is refreshed with createrepo prior to running rpmbuild
71 # (*) package-RPMFLAGS: Miscellaneous RPM flags
72 # (*) package-RPMBUILD: If not rpmbuild - mostly used for sudo'ing rpmbuild
73 # (*) package-BUILD-FROM-SRPM: set this to any non-empty value, if your package is able to produce
74 # a source rpms by running 'make srpm'
76 #################### modules
77 # Required information about the various modules (set this in e.g. planetlab-tags.mk)
80 # the complete path where this module lies;
81 # you can specify the trunk or a given tag with this variable
83 # OR if the module is managed under cvs (will be obsoleted)
88 #################### automatic variables
90 # the build defines some make variables that are extracted from spec files
92 # (*) $ make ulogd.pkginfo
93 # to see the list f variables attached to a given package
94 # (*) $ make kernel-devel.rpminfo
95 # to see the list f variables attached to a given rpm
102 HOSTARCH := $(shell uname -i)
103 DISTRO := $(shell ./getdistro.sh)
104 RELEASE := $(shell ./getrelease.sh)
105 RPM-INSTALL-DEVEL := rpm --force -Uvh
106 # cannot force rpm -e
107 RPM-UNINSTALL-DEVEL := rpm -e
109 #################### Makefile
115 PLDISTRO := planetlab
117 export CVS_RSH := ssh
119 ########## pldistro.mk holds PLDISTRO - it is generated at stage1 (see below)
124 #################### include onelab.mk
125 # describes the set of components
126 PLDISTROCONTENTS := $(PLDISTRO).mk
127 include $(PLDISTROCONTENTS)
129 #################### include <pldistro>-tags.mk
130 # describes where to fetch components, and the related tags if using cvs
131 PLDISTROTAGS := $(PLDISTRO)-tags.mk
132 include $(PLDISTROTAGS)
134 ########## stage1 and stage1iter
135 # extract specs and compute .mk files by running
137 # entering stage1, we compute all the spec files
138 # then we use stage1iter to compute the .mk iteratively,
139 # ensuring that the n-1 first makefiles are loaded when creating the n-th one
140 # when stage1iter is set, it is supposed to be an index (starting at 1) in $(ALL)
142 ALLMKS := $(foreach package, $(ALL), MAKE/$(package).mk)
144 ### stage1iter : need some arithmetic, see
145 # http://www.cmcrossroads.com/articles/ask-mr.-make/learning-gnu-make-functions-with-arithmetic.html
146 ifneq "$(stage1iter)" ""
147 # the first n packages
148 packages := $(wordlist 1,$(words $(stage1iter)),$(ALL))
150 package := $(word $(words $(packages)),$(packages))
151 # the n-1 first packages
152 stage1iter_1 := $(wordlist 2,$(words $(stage1iter)),$(stage1iter))
153 previous := $(wordlist 1,$(words $(stage1iter_1)),$(ALL))
154 previousmks := $(foreach package,$(previous),MAKE/$(package).mk)
155 include $(previousmks)
158 @echo "========== stage1iter : $(package)"
159 # @echo "stage1iter : included .mk files : $(previousmks)"
160 all: $($(package).specpath)
161 all: MAKE/$(package).mk
167 @echo "========== stage1"
170 # specs and makes are done sequentially by stage1iter
173 arg=""; for n in $(ALL) ; do arg="$$arg x"; $(MAKE) --no-print-directory stage1iter="$$arg"; done
176 ### once .mks are OK, you can run make normally
183 # mention $(ALL) here rather than rpms
184 # this is because the inter-package dependencies are expressed like
185 # util-vserver: util-python
192 # gather build information for the 'About' page
193 # uses INIT_CWD to try and guess the vserver location
195 @echo 'Creating myplc-release'
197 (echo -n 'Build bdate: ' ; date '+%Y.%m.%d') >> $@
198 (echo -n 'Build btime: ' ; date '+%H:%M') >> $@
199 (echo -n 'Build bhostname: ' ; hostname) >> $@
200 (echo "Build blocation: $(INIT_CWD)") >> $@
201 (echo -n 'Build tags file: ' ; fgrep '$$''Id' $(PLDISTROTAGS)) >> $@
202 (echo "Build tarch: $(HOSTARCH)") >> $@
203 (echo "Build tdistro: $(DISTRO)") >> $@
204 (echo "Build trelease: $(RELEASE)") >> $@
205 echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx modules versions info" >> $@
206 $(MAKE) --no-print-directory versions >> $@
207 echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx rpms list" >> $@
208 $(MAKE) --no-print-directory version-rpms >> $@
213 YUMGROUPS := groups/$(PLDISTRO).xml
216 RPMS/yumgroups.xml: $(YUMGROUPS)
218 install -D -m 644 $(YUMGROUPS) $@
220 createrepo = createrepo --quiet -g yumgroups.xml RPMS/
222 repo: RPMS/yumgroups.xml
229 # * to make configuration easier, we always use the first module's
230 # definitions (CVSROOT,TAG, or SVNPATH) to extract the spec file
231 # * for the same reason, in case cvs is used, the first module name is added to
232 # $(package)-SPEC - otherwise the cvs modules have to define spec as
233 # <module>/<module>.spec while svn modules just define it as <module>.spec
235 define stage1_variables
236 $(1).spec = $(notdir $($(1)-SPEC))
237 $(1).specpath = SPECS/$(1).spec
238 $(1).module = $(firstword $($(1)-MODULES))
241 $(foreach package, $(ALL), $(eval $(call stage1_variables,$(package))))
244 # for each package, compute whether we need to set date (i.e. whether we use the trunk)
245 # the myplc package is forced to have a date, because it is more convenient
246 # (we cannot bump its number everytime something changes in the system)
247 # myplc-native does not need this trick
249 define package_hasdate
250 $(1).has-date = $(if $(subst myplc,,$(1)), \
251 $(if $($(1)-SVNPATH),\
252 $(if $(findstring /trunk,$($(1)-SVNPATH)),yes,),\
253 $(if $(findstring HEAD,$($(1)-TAG)),yes,)), \
257 $(foreach package, $(ALL), $(eval $(call package_hasdate,$(package))))
259 ### extract spec file from scm
263 (echo -n "# Generated by planetlab build from $($(1)-SPEC) on " ; date) > $($(1).specpath)
264 echo "%define distroname $(DISTRO)" >> $($(1).specpath)
265 echo "%define distrorelease $(RELEASE)" >> $($(1).specpath)
266 echo "%define pldistro $(PLDISTRO)" >> $($(1).specpath)
267 $(if $($(1).has-date),echo "%define date $(shell date +%Y.%m.%d)" >> $($(1).specpath),)
268 $(if $($(1)-SPECVARS), \
269 $(foreach line,$($(1)-SPECVARS), \
270 echo "%define" $(word 1,$(subst =, ,$(line))) "$(word 2,$(subst =, ,$(line)))" >> $($(1).specpath) ;))
271 echo "# included from codebase specfile" >> $($(1).specpath)
272 $(if $($($(1).module)-SVNPATH),\
273 svn cat $($($(1).module)-SVNPATH)/$($(1)-SPEC) >> $($(1).specpath) || rm $($(1).specpath),\
274 cvs -d $($($(1).module)-CVSROOT) checkout \
275 -r $($($(1).module)-TAG) \
276 -p $($(1).module)/$($(1)-SPEC) >> $($(1).specpath))
279 $(foreach package,$(ALL),$(eval $(call target_spec,$(package))))
282 # Base rpmbuild in the current directory
283 # issues on fedora 8 : see the following posts
284 # http://forums.fedoraforum.org/showthread.php?t=39625 - and more specifically post#6
285 # https://www.redhat.com/archives/fedora-devel-list/2007-November/msg00171.html
287 FAKEROOT=/longbuildroot
288 PWD=$(shell /bin/pwd)
289 ifeq "$(PWD)" "$(REALROOT)"
290 export HOME := $(FAKEROOT)
292 export HOME := $(PWD)
295 ifeq "$(shell pwd)" "/build"
296 rm -f $(FAKEROOT) ; ln -s $(REALROOT) $(FAKEROOT)
299 echo "%_topdir $(HOME)" >> $@
300 echo "%_tmppath $(HOME)/tmp" >> $@
301 ./getrpmmacros.sh >> $@
303 ### this utility allows to extract various info from a spec file
304 ### and to define them in makefiles
305 spec2make: spec2make.c
306 $(CC) -g -Wall $< -o $@ -lrpm -lrpmbuild
308 ### run spec2make on the spec file and include the result
309 # usage: spec2make package
311 MAKE/$(1).mk: $($(1).specpath) spec2make .rpmmacros
313 ./spec2make $($(1)-RPMFLAGS) $($(1).specpath) $(1) > MAKE/$(1).mk
314 @if [ -z MAKE/$(1).mk ] ; then rm MAKE/$(1).mk ; exit 1 ; fi
317 $(foreach package,$(ALL),$(eval $(call target_mk,$(package))))
319 # stores PLDISTRO in a file
320 # this is done at stage1. later run wont get confused
322 echo "PLDISTRO:=$(PLDISTRO)" > $@
323 echo "PLDISTROTAGS:=$(PLDISTROTAGS)" >> $@
325 savepldistro: pldistro.mk
328 # always refresh this
331 #################### regular make
333 define stage2_variables
334 ### devel dependencies
335 $(1).rpmbuild = $(if $($(1)-RPMBUILD),$($(1)-RPMBUILD),$(RPMBUILD)) $($(1)-RPMFLAGS)
336 $(1).all-devel-rpm-paths := $(foreach rpm,$($(1)-DEPEND-DEVEL-RPMS),$($(rpm).rpm-path))
337 $(1).depend-devel-packages := $(sort $(foreach rpm,$($(1)-DEPEND-DEVEL-RPMS),$($(rpm).package)))
338 ALL-DEVEL-RPMS += $($(1)-DEPEND-DEVEL-RPMS)
341 $(foreach package,$(ALL),$(eval $(call stage2_variables,$(package))))
342 ALL-DEVEL-RPMS := $(sort $(ALL-DEVEL-RPMS))
345 ### pack sources into tarballs
346 ALLTARBALLS:= $(foreach package, $(ALL), $($(package).tarballs))
347 tarballs: $(ALLTARBALLS)
348 @echo $(words $(ALLTARBALLS)) source tarballs OK
351 SOURCES/%.tar.bz2: SOURCES/%
352 tar chpjf $@ -C SOURCES $*
354 SOURCES/%.tar.gz: SOURCES/%
355 tar chpzf $@ -C SOURCES $*
357 SOURCES/%.tgz: SOURCES/%
358 tar chpzf $@ -C SOURCES $*
361 URLS/%: url=$(subst @colon@,:,$(subst @slash@,/,$(notdir $@)))
362 URLS/%: basename=$(notdir $(url))
364 echo curl $(url) -o SOURCES/$(basename)
367 ### the directory SOURCES/<package>-<version> is made
368 # with a copy -rl from CODEBASES/<package>
369 # the former is $(package.source) and the latter is $(package.codebase)
370 ALLSOURCES:=$(foreach package, $(ALL), $($(package).source))
371 # so that make does not use the rule below directly for creating the tarball files
372 .SECONDARY: $(ALLSOURCES)
374 sources: $(ALLSOURCES)
375 @echo $(words $(ALLSOURCES)) versioned source trees OK
378 define target_link_codebase_sources
379 $($(1).source): $($(1).codebase) ; mkdir -p SOURCES ; cp -rl $($(1).codebase) $($(1).source)
382 $(foreach package,$(ALL),$(eval $(call target_link_codebase_sources,$(package))))
384 ### codebase extraction
385 ALLCODEBASES:=$(foreach package, $(ALL), $($(package).codebase))
386 # so that make does not use the rule below directly for creating the tarball files
387 .SECONDARY: $(ALLCODEBASES)
389 codebases : $(ALLCODEBASES)
390 @echo $(words $(ALLCODEBASES)) codebase OK
394 # usage: extract_single_module package
395 define extract_single_module
397 $(if $($($(1).module)-SVNPATH), cd CODEBASES && svn export $($($(1).module)-SVNPATH) $(1), cd CODEBASES && cvs -d $($($(1).module)-CVSROOT) export -r $($($(1).module)-TAG) -d $(1) $($(1).module))
400 # usage: extract_multi_module package
401 define extract_multi_module
402 mkdir -p CODEBASES/$(1) && cd CODEBASES/$(1) && (\
403 $(foreach m,$($(1)-MODULES), $(if $($(m)-SVNPATH), svn export $($(m)-SVNPATH) $(m);, cvs -d $($(m)-CVSROOT) export -r $($(m)-TAG) $(m);)))
406 CODEBASES/%: package=$(notdir $@)
407 CODEBASES/%: multi_module=$(word 2,$($(package)-MODULES))
409 @(echo -n "XXXXXXXXXXXXXXX -- BEG CODEBASE $(package) : $@ " ; date)
410 $(if $(multi_module),\
411 $(call extract_multi_module,$(package)),\
412 $(call extract_single_module,$(package)))
413 @(echo -n "XXXXXXXXXXXXXXX -- END CODEBASE $(package) : $@ " ; date)
416 ALLSRPMS:=$(foreach package,$(ALL),$($(package).srpm))
418 @echo $(words $(ALLSRPMS)) source rpms OK
421 # usage: target_source_rpm package
422 # select upon the package name, whether it contains srpm or not
423 define target_source_rpm
424 ifeq "$($(1)-BUILD-FROM-SRPM)" ""
425 $($(1).srpm): $($(1).specpath) .rpmmacros $($(1).tarballs)
426 mkdir -p BUILD SRPMS tmp
427 @(echo -n "XXXXXXXXXXXXXXX -- BEG SRPM $(1) (using SOURCES) " ; date)
428 $(if $($(1).all-devel-rpm-paths), $(RPM-INSTALL-DEVEL) $($(1).all-devel-rpm-paths))
429 $($(1).rpmbuild) -bs $($(1).specpath)
430 $(if $($(1)-DEPEND-DEVEL-RPMS), $(RPM-UNINSTALL-DEVEL) $($(1)-DEPEND-DEVEL-RPMS))
431 @(echo -n "XXXXXXXXXXXXXXX -- END SRPM $(1) " ; date)
433 $($(1).srpm): $($(1).specpath) .rpmmacros $($(1).codebase)
434 mkdir -p BUILD SRPMS tmp
435 @(echo -n "XXXXXXXXXXXXXXX -- BEG SRPM $(1) (using make srpm) " ; date)
436 $(if $($(1).all-devel-rpm-paths), $(RPM-INSTALL-DEVEL) $($(1).all-devel-rpm-paths))
437 make -C $($(1).codebase) srpm SPECFILE=$(HOME)/$($(1).specpath) && \
438 rm -f SRPMS/$(notdir $($(1).srpm)) && \
439 ln $($(1).codebase)/$(notdir $($(1).srpm)) SRPMS/$(notdir $($(1).srpm))
440 $(if $($(1)-DEPEND-DEVEL-RPMS), $(RPM-UNINSTALL-DEVEL) $($(1)-DEPEND-DEVEL-RPMS))
441 @(echo -n "XXXXXXXXXXXXXXX -- END SRPM $(1) " ; date)
445 $(foreach package,$(ALL),$(eval $(call target_source_rpm,$(package))))
447 ### binary rpms are made from source rpm
448 ALLRPMS:=$(foreach package,$(ALL),$($(package).rpms))
449 # same as above, mention $(ALL) and not $(ALLRPMS)
451 @echo $(words $(ALLRPMS)) binary rpms OK
454 # use tmp dirs when building binary rpm so make remains idempotent
455 # otherwise SOURCES/ or SPEC gets touched again - which leads to rebuilding
456 RPM-USE-TMP-DIRS = --define "_sourcedir $(HOME)/tmp" --define "_specdir $(HOME)/tmp"
458 # usage: build_binary_rpm package
459 # xxx hacky - invoke createrepo if DEPEND-FILES mentions RPMS/yumgroups.xml
460 define target_binary_rpm
461 $($(1).rpms): $($(1).srpm)
462 mkdir -p BUILD RPMS tmp
463 @(echo -n "XXXXXXXXXXXXXXX -- BEG RPM $(1) " ; date)
464 $(if $(findstring RPMS/yumgroups.xml,$($(1)-DEPEND-FILES)), $(createrepo) , )
465 $(if $($(1).all-devel-rpm-paths), $(RPM-INSTALL-DEVEL) $($(1).all-devel-rpm-paths))
466 $($(1).rpmbuild) --rebuild $(RPM-USE-TMP-DIRS) $($(1).srpm)
467 $(if $($(1)-DEPEND-DEVEL-RPMS), $(RPM-UNINSTALL-DEVEL) $($(1)-DEPEND-DEVEL-RPMS))
468 @(echo -n "XXXXXXXXXXXXXXX -- END RPM $(1) " ; date)
471 $(foreach package,$(ALL),$(eval $(call target_binary_rpm,$(package))))
474 # e.g. make proper -> does propers rpms
475 # usage shorthand_target package
476 define target_shorthand
477 $(1): $($(package).rpms)
479 $(1)-spec: $($(package)-SPEC)
481 $(1)-mk: $($(package)-MK)
483 $(1)-tarball: $($(package).tarballs)
485 $(1)-codebase: $($(package).codebase)
487 $(1)-source: $($(package).source)
488 .PHONY: $(1)-codebase
489 $(1)-rpms: $($(package).rpms)
491 $(1)-srpm: $($(package).srpm)
495 $(foreach package,$(ALL),$(eval $(call target_shorthand,$(package))))
497 ### file dependencies
498 define package_depends_on_file
503 define target_dependfiles
504 $(foreach file,$($(1)-DEPEND-FILES),$(eval $(call package_depends_on_file,$(1),$(file))))
507 $(foreach package,$(ALL),$(eval $(call target_dependfiles,$(package))))
509 ### package dependencies
510 define package_depends_on_package
513 $($(1).srpm):$($(2).rpms)
516 define target_depends
517 $(foreach package,$($(1)-DEPEND-PACKAGES) $($(1).depend-devel-packages),$(eval $(call package_depends_on_package,$(1),$(package))))
520 $(foreach package,$(ALL),$(eval $(call target_depends,$(package))))
523 # usage: target_clean package
526 rm -rf $($(1).codebase)
527 .PHONY: $(1)-clean-codebase
528 CLEANS += $(1)-clean-codebase
530 rm -rf $($(1).source)
531 .PHONY: $(1)-clean-source
532 CLEANS += $(1)-clean-source
534 rm -rf $($(1).tarballs)
535 .PHONY: $(1)-clean-tarball
536 CLEANS += $(1)-clean-tarball
538 rm -rf BUILD/$(notdir $($(1).source))
539 CLEANS += $(1)-clean-build
542 .PHONY: $(1)-clean-rpms
543 CLEANS += $(1)-clean-rpms
546 .PHONY: $(1)-clean-srpm
547 CLEANS += $(1)-clean-srpm
548 $(1)-codeclean: $(1)-clean-source $(1)-clean-tarball $(1)-clean-build $(1)-clean-rpms $(1)-clean-srpm
549 $(1)-clean: $(1)-clean-codebase $(1)-codeclean
550 .PHONY: $(1)-codeclean $(1)-clean
552 rm -rf $($(1).specpath)
553 .PHONY: $(1)-clean-spec
556 .PHONY: $(1)-clean-make
557 $(1)-distclean: $(1)-distclean1 $(1)-distclean2
558 $(1)-distclean1: $(1)-clean-spec $(1)-clean-make
559 $(1)-distclean2: $(1)-clean
560 .PHONY: $(1)-distclean $(1)-distclean1 $(1)-distclean2
563 $(foreach package,$(ALL),$(eval $(call target_clean,$(package))))
571 @echo Available clean targets
574 ### brute force clean
576 rm -rf pldistro.mk .rpmmacros spec2make SPECS MAKE
578 rm -rf CODEBASES SOURCES BUILD RPMS SRPMS tmp
579 distclean: distclean1 distclean2
580 .PHONY: distclean1 distclean2 distclean
583 $(RPM-UNINSTALL-DEVEL) $(ALL-DEVEL-RPMS)
585 #################### produce reliable version information
587 VFORMAT="%30s := %s\n"
590 @$(if $($(1)-SVNPATH),\
591 printf $(VFORMAT) $(1)-SVNPATH "$($(1)-SVNPATH)",\
592 printf $(VFORMAT) $(1)-CVSROOT "$($(1)-CVSROOT)" ; printf $(VFORMAT) $(1)-TAG "$($(1)-TAG)")
595 # compute all modules
597 $(foreach package,$(ALL), $(eval ALL-MODULES+=$($(package)-MODULES)))
598 ALL-MODULES:=$(sort $(ALL-MODULES))
600 $(foreach module,$(ALL-MODULES), $(eval $(call print_version,$(module))))
602 versions: $(foreach module, $(ALL-MODULES), $(module)-version)
604 RFORMAT="%20s :: %s\n"
607 @$(foreach rpm,$($(1).rpms),printf $(RFORMAT) $(1) $(notdir $(rpm));)
608 version-rpms: $(1)-version-rpms
611 $(foreach package,$(sort $(ALL)), $(eval $(call print_rpms,$(package))))
613 #################### include install Makefile
614 # the default is to use the distro-dependent install file
615 # however the main distro file can redefine PLDISTROINSTALL
616 ifndef PLDISTROINSTALL
617 PLDISTROINSTALL := $(PLDISTRO)-install.mk
620 -include $(PLDISTROINSTALL)
624 @echo "********** Run make in two stages:"
626 @echo "make stage1=true PLDISTRO=onelab"
627 @echo " -> extracts all spec files in SPECS/ and mk files in MAKE/"
628 @echo " as well as save PLDISTRO for subsequent runs"
630 @echo "********** Then you can use the following targets"
632 @echo " rebuilds everything"
633 @echo 'make util-vserver'
634 @echo " makes the RPMS related to util-vserver"
635 @echo " equivalent to 'make util-vserver-rpms'"
637 @echo "********** Or, vertically - step-by-step for a given package"
638 @echo 'make util-vserver-codebase'
639 @echo " performs codebase extraction in CODEBASES/util-vserver"
640 @echo 'make util-vserver-source'
641 @echo " creates source link in SOURCES/util-vserver-<version>"
642 @echo 'make util-vserver-tarball'
643 @echo " creates source tarball in SOURCES/util-vserver-<version>.<tarextension>"
644 @echo 'make util-vserver-srpm'
645 @echo " build source rpm in SRPMS/"
646 @echo 'make util-vserver-rpms'
647 @echo " build rpm(s) in RPMS/"
649 @echo "********** Or, horizontally, reach a step for all known packages"
650 @echo 'make codebases'
652 @echo 'make tarballs'
656 @echo "********** Cleaning examples"
658 @echo " removes the files made by make"
659 @echo "make distclean"
660 @echo " brute-force cleaning, removes entire directories - requires a new stage1"
661 @echo "make develclean"
662 @echo " rpm-uninstalls all devel packages installed during build"
664 @echo "make iptables-distclean"
665 @echo " deep clean for a given package"
666 @echo "make iptables-codeclean"
667 @echo " run this if you've made a change in the CODEBASES area for iptables"
669 @echo "make util-vserver-clean"
670 @echo " removes codebase, source, tarball, build, rpm and srpm for util-vserver"
671 @echo "make util-vserver-clean-codebase"
672 @echo " and so on for source, tarball, build, rpm and srpm"
674 @echo "********** Info examples"
676 @echo " Displays the value of a given variable (here ALL)"
677 @echo " with only a single plus sign only the value is displayed"
678 @echo "make ulogd.pkginfo"
679 @echo " Displays know attributes of a package"
680 @echo "make kernel-devel.rpminfo"
681 @echo " Displays know attributes of an rpm"
683 @echo "********** Known pakages are"
686 #################### convenience, for debugging only
687 # make +foo : prints the value of $(foo)
688 # make ++foo : idem but verbose, i.e. foo=$(foo)
689 ++%: varname=$(subst +,,$@)
691 @echo "$(varname)=$($(varname))"
692 +%: varname=$(subst +,,$@)
694 @echo "$($(varname))"
696 PKGKEYS := tarballs source codebase srpm rpms rpmnames rpm-release rpm-name rpm-version rpm-subversion
697 %.pkginfo: package=$(subst .pkginfo,,$@)
699 @$(foreach key,$(PKGKEYS),echo "$(package).$(key)=$($(package).$(key))";)
701 RPMKEYS := rpm-path package
702 %.rpminfo: rpm=$(subst .rpminfo,,$@)
704 @$(foreach key,$(RPMKEYS),echo "$(rpm).$(key)=$($(rpm).$(key))";)