diff options
author | David Tardon <dtardon@redhat.com> | 2013-04-07 09:45:19 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2013-04-11 03:39:36 +0000 |
commit | 9d54f0e1dec4d84f914f17c8c2445dfc53190d8a (patch) | |
tree | 2e96630a6fbc976e5c6156b5df9da3b9492a6a84 /solenv/gbuild/PackageSet.mk | |
parent | deliver all uiconfig files by UIConfig (diff) | |
download | core-9d54f0e1dec4d84f914f17c8c2445dfc53190d8a.tar.gz core-9d54f0e1dec4d84f914f17c8c2445dfc53190d8a.zip |
add gbuild class PackageSet
This is intended for bundling filelists of multiple Packages together,
to simplify the scp2 configuration.
Change-Id: I6f700f691b37375a09a5400166aac80a8bb2a2b4
Reviewed-on: https://gerrit.libreoffice.org/3230
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'solenv/gbuild/PackageSet.mk')
-rw-r--r-- | solenv/gbuild/PackageSet.mk | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/solenv/gbuild/PackageSet.mk b/solenv/gbuild/PackageSet.mk new file mode 100644 index 000000000000..8ba3273f459b --- /dev/null +++ b/solenv/gbuild/PackageSet.mk @@ -0,0 +1,75 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +# class PackageSet + +# Allows to bundle a set of packages under one name. +# +# This is intended to be used by gbuild classes that want to provide a +# filelist for installer, but for implementation reasons have to use +# several Packages internally (e.g., because of different source dirs). + +$(dir $(call gb_PackageSet_get_target,%)).dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) + +$(dir $(call gb_PackageSet_get_target,%))%/.dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) + +$(call gb_PackageSet_get_target,%) : + $(call gb_Output_announce,$*,$(true),PKS,2) + cat $(sort $(FILELISTS)) > $@ + +.PHONY : $(call gb_PackageSet_get_clean_target,%) +$(call gb_PackageSet_get_clean_target,%) : + $(call gb_Output_announce,$*,$(false),PKS,2) + rm -f $(call gb_PackageSet_get_target,$*) + +# Create and register a package set. +# +# gb_PackageSet_PackageSet set +define gb_PackageSet_PackageSet +$(call gb_PackageSet_PackageSet_internal,$(1)) + +$$(eval $$(call gb_Module_register_target,$(call gb_PackageSet_get_target,$(1)),$(call gb_PackageSet_get_clean_target,$(1)))) +$(call gb_Helper_make_userfriendly_targets,$(1),PackageSet) + +endef + +# Create a package set. +# +# gb_PackageSet_PackageSet_internal set +define gb_PackageSet_PackageSet_internal +$(call gb_PackageSet_get_target,$(1)) : FILELISTS := + +$(call gb_PackageSet_get_target,$(1)) :| $(dir $(call gb_PackageSet_get_target,$(1))).dir + +endef + +# Add a package to the set. +# +# A package can be added more than once. +# +# gb_PackageSet_add_package set package +define gb_PackageSet_add_package +$(call gb_PackageSet_get_target,$(1)) : FILELISTS += $(call gb_Package_get_target,$(2)) + +$(call gb_PackageSet_get_target,$(1)) : $(call gb_Package_get_target,$(2)) +$(call gb_PackageSet_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(2)) + +endef + +# Add several packages to the set at once. +# +# gb_PackageSet_add_packages set package(s) +define gb_PackageSet_add_packages +$(foreach package,$(2),$(call gb_PackageSet_add_package,$(1),$(package))) + +endef + +# vim: set noet sw=4 ts=4: |