50-metadata.mk 1.41 KB
Newer Older
1 2 3 4 5
# step 4: build the distribution image

# package lists are needed for installer and live-install images
METADIR := files/Metadata

6
# preparation targets of features.in/build-distro/lib/build-distro.mk
7 8
WHATEVER += metadata

9
# handle these too
10
DOT_BASE += $(BASE_PACKAGES_REGEXP) $(THE_PACKAGES_REGEXP)
11

12 13 14 15 16 17
# args: type, name
define dump
if [ -n "$($(2)_$(1))" ]; then \
	echo -e "\n## $(2)_$(1)"; \
	case "$(1)" in \
	PACKAGES) echo "$($(2)_$(1))";; \
18
	LISTS) echo -e "\n# $($(2)_$(1))"; cat $($(2)_$(1));; \
19 20
	esac; \
fi;
21 22 23 24 25 26 27
endef

# BASE_PACKAGES, BASE_LISTS and whatever else goes into base install;
# thus construct requisite .base packagelist for alterator-pkg
metadata-.base:
	@cd $(call list,/); \
	{ \
28 29 30
		echo "## generated by features.in/metadata/lib/50-metadata.mk";\
		$(foreach p,SYSTEM COMMON THE BASE,$(call dump,PACKAGES,$(p))) \
		$(foreach l,THE BASE,$(call dump,LISTS,$(l))) \
31 32 33 34 35 36
		if [ -n "$(DOT_BASE)" ]; then \
			echo -e "\n## DOT_BASE\n$(DOT_BASE)"; \
		fi; \
	} | sed -re '/^[^[:space:]#]/ s/[[:space:]]+/\n/g' > .base

# see also alterator-pkg (backend3/pkg-install);
37 38 39
# we only tar up what's up to it (note that e.g.
# LIVE_LISTS are needed in the generated profile
# but not for alterator-pkg)
40 41 42
metadata: metadata-.base
	@mkdir -p $(METADIR); \
	tar -C $(PKGDIR) -cvf - \
43
		$(call rlist,.base $(call groups2lists)) \
44
		$(call rgroup,$(THE_GROUPS) $(MAIN_GROUPS)) \
45
		$(call rprofile,$(THE_PROFILES)) \
46
	> $(METADIR)/pkg-groups.tar