+####################
+# invocation:
+#
+# (*) make stage1=true
+# this extracts all specfiles and computes .mk from specfiles
+# you need to specify PLDISTRO here if relevant - see below
+# (*) make help
+# for more info on how to invoke this stuff
+#
+#################### (fedora) distributions
+#
+# (*) as of nov. 2007, myplc-devel is deprecated
+# (*) instead, we create a fresh vserver that holds required tools (see e.g. planetlab-devel.lst)
+# (*) the build uses the current fedora version as a target for the produced images
+# (*) so you simply need to create a fedora 8 build image for building fedora-8 images
+#
+#################### (planetlab) distributions
+#
+# (*) see README-pldistros.txt
+# (*) then you need to run
+# make stage1=true PLDISTRO=onelab
+#
+####################
+# This build deals with 3 kinds of objects
+#
+# (*) 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 or git tree; we would wish to keep
+# these names lowercase as far as possible
+# (*) rpms are named in the spec files. A package typically defines several rpms;
+# rpms are used for defining LOCAL-DEVEL-RPMS. See also package.rpmnames
+#
+# in simple cases, one package uses one module (in which case using the same name sounds right)
+# but others might need several modules (e.g. image-creation packages like bootstrapfs need
+# bootstrapfs and build); in this case the FIRST ONE is used for locating the specfile
+#
+#################### packages
+# basics: how to build a package - you need to define the following variables
+#
+# (*) package-MODULES
+# a package needs one or several modules to build; the first one is used for
+# some special purposes, like locating the specfile
+# (*) package-SPEC
+# the package's specfile; this is relative to the FIRST module in package-MODULES
+#
+# Optional:
+#
+# (*) package-DEPEND-PACKAGES
+# a set of (obviously local) *packages* that this package depends on, e.g.
+# bootstrapfs-DEPEND-PACKAGES += kernel
+# this impacts the order of the build
+# (*) package-STOCK-DEVEL-RPMS
+# a set of stock rpms that this package needs at build-time
+# this can also be set in config.<distro>/devel.pkgs or config.planetlab/devel.pkgs as appropriate
+# (*) package-LOCAL-DEVEL-RPMS
+# a set of *local* rpms that the build will rpm-install before building <package>
+# the build will attempt to uninstall those once the package is built, this is not fatal though
+# this is intended to denote local rpms, i.e. ones that are results of our own build
+# stock rpms should be mentioned in STOCK-DEVEL-RPMS or in devel.pkgs as described above
+# (*) package-LOCAL-DEVEL-RPMS-CRUCIAL
+# like package-LOCAL-DEVEL-RPMS but for crucial packages (like autoconf) that only need an update from our build
+# rpms in this area will *not* be uninstalled after the target is made, because that would ruin the build vm for good
+# (*) package-DEPEND-FILES
+# 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
+# is refreshed with createrepo prior to running rpmbuild
+# (*) package-SPECVARS
+# space-separated list of spec variable definitions, where you can reference make variables that
+# belong to packages defined BEFORE the current one
+# note: you should use = to define these (as opposed to :=)
+# e.g. mydriver-SPECVARS = foo=$(kernel-rpm-release)
+# would let you use the %release from the kernel's package when rpmbuild'ing mydriver
+# see automatic below
+# (*) package-RPMFLAGS: Miscellaneous RPM flags
+# this is passed to rpmbuild, as well as to spec2make for "exporting" various rpm variable
+# to make; beware that some features, like --with=debug or --define 'foo bar' are not
+# well handled by spec2make as of this writing, which can cause issues.
+# hopefully this will be fixed...
+# (*) package-BUILD-FROM-SRPM: set this to any non-empty value,
+# if your package is able to produce a source rpm.
+# In this case the build will first invoke 'make srpm', and then rebuild binaries from that
+# (*) package-RPMDATE: set this to any non-empty value to get the rpm package's release field hold the current date
+# this is useful for container packages, like e.g. bootstrapfs or vserver, that contains much more than the
+# correspondng module
+#
+#################### modules
+# Required information about the various modules (set this in e.g. planetlab-tags.mk)
+#
+# (*) module-SVNPATH
+# for svn modules
+# the complete path where this module lies;
+# you can specify the trunk or a given tag with this variable
+#
+# (*) module-GITPATH
+# for git modules
+# which by analogy with svn revision scheme, is expected to be <url>@<tag>
+#
+#################### automatic variables
+#
+# the build defines some make variables that are extracted from spec files
+# to inspect those, see for example
+# (*) $ make ulogd-pkginfo
+# to see the list f variables attached to a given package
+# (*) $ make kernel-devel-rpminfo
+# to see the list of variables attached to a given rpm
+#
+####################
+
+# exported to spec files as plrelease
+PLANETLAB_RELEASE = 5.2
+
+#
+# Default values
+#
+# minimal compat with macos, just so this does not complain
+HOSTARCH := $(shell uname -i 2> /dev/null || uname -m 2> /dev/null)
+DISTRO := $(shell ./getdistro.sh)
+RELEASE := $(shell ./getrelease.sh)
+DISTRONAME := $(shell ./getdistroname.sh)