bump product version to 7.2.5.1
[LibreOffice.git] / solenv / gbuild / ExtensionPackage.mk
blob6a86aa0270b62e10b96bff7d69b779ed78987055
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 # ExtensionPackage class
12 # Unpacks a binary .oxt file into the instdir extension directory and
13 # writes a file-list.
15 $(call gb_ExtensionPackage_get_clean_target,%) :
16 $(call gb_Output_announce,$*,$(false),OXP,3)
17 $(call gb_Helper_abbreviate_dirs,\
18 rm -rf $(INSTROOT)/$(LIBO_SHARE_FOLDER)/extensions/$* \
19 $(call gb_ExtensionPackage_get_target,$*))
21 $(call gb_ExtensionPackage_get_preparation_target,%) :
22 mkdir -p $(dir $@) && touch $@
24 $(call gb_ExtensionPackage_get_target,%) :
25 $(call gb_Output_announce,$*,$(true),OXP,3)
26 $(call gb_Trace_StartRange,$*,OXP)
27 $(call gb_Helper_abbreviate_dirs,\
28 mkdir -p $(dir $@) \
29 && rm -rf $(INSTROOT)/$(LIBO_SHARE_FOLDER)/extensions/$* \
30 && unzip -q $(ZIPFILE) -d $(INSTROOT)/$(LIBO_SHARE_FOLDER)/extensions/$* \
31 && zipinfo -1 $(ZIPFILE) | grep -v '/$$' \
32 | sed s+^+$(INSTROOT)/$(LIBO_SHARE_FOLDER)/extensions/$*/+ > $@)
33 $(call gb_Trace_EndRange,$*,OXP)
35 # call gb_ExtensionPackage_ExtensionPackage_internal,package,oxt
36 define gb_ExtensionPackage_ExtensionPackage_internal
37 $(if $(2),,$(call gb_Output_error,need 2 parameters))
38 $(call gb_ExtensionPackage_get_target,$(1)) : ZIPFILE := $(2)
39 $(call gb_ExtensionPackage_get_target,$(1)) : $(2)
40 $(call gb_ExtensionPackage_get_target,$(1)) :| \
41 $(INSTROOT)/$(LIBO_SHARE_FOLDER)/extensions/.dir
43 endef
45 # call gb_ExtensionPackage_ExtensionPackage,package,oxt
46 define gb_ExtensionPackage_ExtensionPackage
47 $(call gb_ExtensionPackage_ExtensionPackage_internal,$(1),$(2))
48 $(2) : $(call gb_ExtensionPackage_get_preparation_target,$(1))
49 touch $$@
51 $$(eval $$(call gb_Module_register_target,$(call gb_ExtensionPackage_get_target,$(1)),$(call gb_ExtensionPackage_get_clean_target,$(1))))
52 $(call gb_Helper_make_userfriendly_targets,$(1),ExtensionPackage)
54 endef
56 # call gb_ExtensionPackage_use_external_project,package,externalproject
57 define gb_ExtensionPackage_use_external_project
58 $(call gb_ExtensionPackage_get_preparation_target,$(1)) : \
59 $(call gb_ExternalProject_get_target,$(2))
61 endef
63 # ExtensionPackage class
65 # This is less boring than writing a dozen 1-line ExtensionPackage files.
67 $(call gb_ExtensionPackageSet_get_clean_target,%) :
68 $(call gb_Output_announce,$*,$(false),OXS,3)
69 $(call gb_Helper_abbreviate_dirs,\
70 rm -rf $(call gb_ExtensionPackageSet_get_target,$*))
72 $(call gb_ExtensionPackageSet_get_target,%) :
73 $(call gb_Output_announce,$*,$(true),OXS,3)
74 $(call gb_Trace_MakeMark,$*,OXS)
75 mkdir -p $(dir $@) && touch $@
77 # call gb_ExtensionPackageSet_ExtensionPackageSet,set
78 define gb_ExtensionPackageSet_ExtensionPackageSet
79 $$(eval $$(call gb_Module_register_target,$(call gb_ExtensionPackageSet_get_target,$(1)),$(call gb_ExtensionPackageSet_get_clean_target,$(1))))
80 $(call gb_Helper_make_userfriendly_targets,$(1),ExtensionPackageSet)
82 endef
84 # call gb_ExtensionPackageSet_add_extension,set,package,oxt-filename
85 define gb_ExtensionPackageSet_add_extension
86 $(call gb_ExtensionPackage_ExtensionPackage_internal,$(2),$(TARFILE_LOCATION)/$(3))
88 $(call gb_ExtensionPackageSet_get_target,$(1)) : \
89 $(call gb_ExtensionPackage_get_target,$(2))
90 $(call gb_ExtensionPackageSet_get_clean_target,$(1)) : \
91 $(call gb_ExtensionPackage_get_clean_target,$(2))
93 endef
95 # vim: set noet sw=4 ts=4: