50 null derefs seen in crashreporting report
[LibreOffice.git] / instsetoo_native / CustomTarget_install.mk
blob1dd705217c6312cd127401e3de54a9e4456ed566
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 instsetoo_ULFLIST := ActionTe \
11 Control \
12 CustomAc \
13 Error \
14 LaunchCo \
15 Property \
16 RadioBut \
17 UIText
19 $(eval $(call gb_CustomTarget_CustomTarget,instsetoo_native/install))
21 $(eval $(call gb_CustomTarget_register_targets,instsetoo_native/install,\
22 install.phony \
23 $(if $(filter TRUE,$(WINDOWS_BUILD_SIGNING)),msi_signing.done) \
24 $(if $(filter-out WNT,$(OS)),\
25 bin/find-requires-gnome.sh \
26 bin/find-requires-x11.sh) \
27 $(foreach ulf,$(instsetoo_ULFLIST),win_ulffiles/$(ulf).ulf) \
30 .PHONY: $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/install.phony
32 $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/install.phony: \
33 $(SRCDIR)/solenv/bin/make_installer.pl \
34 $(foreach ulf,$(instsetoo_ULFLIST),$(call gb_CustomTarget_get_workdir,instsetoo_native/install)/win_ulffiles/$(ulf).ulf) \
35 $(if $(filter-out WNT,$(OS)),\
36 $(addprefix $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/,\
37 bin/find-requires-gnome.sh \
38 bin/find-requires-x11.sh) \
39 ) \
40 $(call gb_Postprocess_get_target,AllModulesButInstsetNative)
42 $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/bin/find-requires-%.sh: $(SRCDIR)/instsetoo_native/inc_openoffice/unix/find-requires-%.sh
43 cat $< | tr -d "\015" > $@
44 chmod a+x $@
46 $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/win_ulffiles/%.ulf: \
47 | $(call gb_Postprocess_get_target,AllModulesButInstsetNative)
49 $(eval $(call gb_CustomTarget_ulfex_rule,\
50 $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/win_ulffiles/%.ulf,\
51 $(SRCDIR)/instsetoo_native/inc_openoffice/windows/msi_languages/%.ulf,\
52 $(foreach lang,$(gb_TRANS_LANGS),\
53 $(gb_POLOCATION)/$(lang)/instsetoo_native/inc_openoffice/windows/msi_languages.po)))
55 export ENABLE_DOWNLOADSETS ?= TRUE
56 ifeq ($(OS),LINUX)
57 export DONT_REMOVE_PACKAGE := TRUE
58 endif
59 export instsetoo_OUT := $(WORKDIR)/installation
60 export LOCAL_OUT := $(instsetoo_OUT)
61 export LOCAL_COMMON_OUT := $(instsetoo_OUT)
63 instsetoo_native_WITH_LANG := en-US $(filter-out en-US,$(gb_WITH_LANG))
65 ifeq (WNT,$(OS))
66 define instsetoo_native_msitemplates
68 TEMPLATE_DIR=$(dir $@)msi_templates \
69 && rm -rf $${TEMPLATE_DIR} \
70 && mkdir -p $${TEMPLATE_DIR}/Binary \
71 && for I in $(SRCDIR)/instsetoo_native/inc_$(1)/windows/msi_templates/*.* ; do $(GREP) -v '^#' "$$I" > $${TEMPLATE_DIR}/`basename $$I` || true ; done \
72 && $(GNUCOPY) $(SRCDIR)/instsetoo_native/inc_common/windows/msi_templates/Binary/*.* $${TEMPLATE_DIR}/Binary
73 endef
74 else
75 instsetoo_native_msitemplates :=
76 endif
78 define instsetoo_native_install_command
79 $(call instsetoo_native_msitemplates,$(1))
80 $(call gb_Helper_print_on_error, \
81 cd $(dir $@) \
82 $(foreach pkgformat,$(5),\
83 && $(if $(filter-out archive,$(pkgformat)),ENABLE_STRIP=1) $(PERL) -w $< \
84 -f $(BUILDDIR)/instsetoo_native/util/openoffice.lst \
85 -l $(subst $(WHITESPACE),$(COMMA),$(strip $(2))) \
86 -p $(PRODUCTNAME_WITHOUT_SPACES)$(3) \
87 -u $(instsetoo_OUT) \
88 -buildid $(if $(filter deb0 rpm0,$(pkgformat)$(LIBO_VERSION_PATCH)),1,$(LIBO_VERSION_PATCH)) \
89 $(if $(filter WNT,$(OS)), \
90 -msitemplate $(dir $@)msi_templates \
91 -msilanguage $(dir $@)win_ulffiles \
92 ) \
93 $(4) \
94 -format $(pkgformat) \
95 $(if $(verbose),-verbose,-quiet) \
96 ),$@.log)
97 endef
99 $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/install.phony:
100 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,2)
101 $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),PRL)
102 rm -rf $(instsetoo_OUT)
103 ifeq (TRUE,$(LIBO_TEST_INSTALL))
104 $(call instsetoo_native_install_command,openoffice,en-US,,,archive)
105 unzip -q -d $(TESTINSTALLDIR) $(instsetoo_OUT)/$(PRODUCTNAME_WITHOUT_SPACES)/archive/install/en-US/LibreOffice*_archive.zip
106 mv $(TESTINSTALLDIR)/LibreOffice*_archive/LibreOffice*/* $(TESTINSTALLDIR)/
107 rmdir $(TESTINSTALLDIR)/LibreOffice*_archive/LibreOffice*
108 rmdir $(TESTINSTALLDIR)/LibreOffice*_archive
109 ifeq (ODK,$(filter ODK,$(BUILD_TYPE)))
110 $(call instsetoo_native_install_command,sdkoo,en-US,_SDK,,archive)
111 unzip -q -d $(TESTINSTALLDIR) $(instsetoo_OUT)/$(PRODUCTNAME_WITHOUT_SPACES)_SDK/archive/install/en-US/LibreOffice*_archive_sdk.zip
112 mv $(TESTINSTALLDIR)/LibreOffice*_archive_sdk/LibreOffice*_SDK/sdk \
113 $(TESTINSTALLDIR)/
114 rmdir $(TESTINSTALLDIR)/LibreOffice*_archive_sdk/LibreOffice*_SDK
115 rmdir $(TESTINSTALLDIR)/LibreOffice*_archive_sdk
116 endif
117 else # LIBO_TEST_INSTALL
118 $(call instsetoo_native_install_command,openoffice,$(if $(filter WNT,$(OS)),$(instsetoo_native_WITH_LANG),en-US),,,$(PKGFORMAT))
119 ifeq (ODK,$(filter ODK,$(BUILD_TYPE)))
120 $(call instsetoo_native_install_command,sdkoo,en-US,_SDK,,$(PKGFORMAT))
121 endif
122 ifeq (HELP,$(filter HELP,$(BUILD_TYPE))$(filter MACOSX,$(OS)))
123 $(foreach lang,$(gb_HELP_LANGS),\
124 $(call instsetoo_native_install_command,ooohelppack,$(lang),,-helppack,$(PKGFORMAT)))
125 endif
126 ifneq (WNT,$(OS))
127 $(foreach lang,$(instsetoo_native_WITH_LANG),\
128 $(call instsetoo_native_install_command,ooolangpack,$(lang),,-languagepack,$(PKGFORMAT)))
129 endif
130 endif # LIBO_TEST_INSTALL
131 touch $@
132 $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),PRL)
134 TIMESTAMPURL ?= "http://timestamp.globalsign.com/scripts/timestamp.dll"
135 $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/msi_signing.done: \
136 $(if $(filter HELP,$(BUILD_TYPE)),$(call gb_CustomTarget_get_workdir,instsetoo_native/install)/msi_helppack_signing.done) \
137 $(if $(filter ODK,$(BUILD_TYPE)),$(call gb_CustomTarget_get_workdir,instsetoo_native/install)/msi_sdk_signing.done) \
138 $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/msi_main_signing.done
139 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,2)
140 $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),PRL)
141 touch $@
142 $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),PRL)
144 $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/msi_helppack_signing.done \
145 $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/msi_sdk_signing.done \
146 $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/msi_main_signing.done \
147 : $(SRCDIR)/postprocess/signing/signing.pl $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/install.phony
149 $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/msi_main_signing.done:
150 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,2)
151 $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),PRL)
152 $(PERL) $(SRCDIR)/postprocess/signing/signing.pl \
153 -l $(subst .done,_log.txt,$@) \
154 $(if $(verbose),-v) \
155 $(if $(PFXFILE),-f $(PFXFILE)) \
156 $(if $(PFXPASSWORD),-p $(PFXPASSWORD)) \
157 $(if $(TIMESTAMPURL),-t $(TIMESTAMPURL)) \
158 -d $(PRODUCTNAME_WITHOUT_SPACES)\ $(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH) \
159 $(WORKDIR)/installation/$(PRODUCTNAME_WITHOUT_SPACES)/msi/install/*/*.msi \
160 && touch $@
161 $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),PRL)
163 $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/msi_helppack_signing.done:
164 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,2)
165 $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),PRL)
166 $(PERL) $(SRCDIR)/postprocess/signing/signing.pl \
167 -l $(subst .done,_log.txt,$@) \
168 $(if $(verbose),-v) \
169 $(if $(PFXFILE),-f $(PFXFILE)) \
170 $(if $(PFXPASSWORD),-p $(PFXPASSWORD)) \
171 $(if $(TIMESTAMPURL),-t $(TIMESTAMPURL)) \
172 -d $(PRODUCTNAME_WITHOUT_SPACES)\ $(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)\ Helppack \
173 $(WORKDIR)/installation/$(PRODUCTNAME_WITHOUT_SPACES)_helppack/msi/install/*/*.msi \
174 && touch $@
175 $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),PRL)
177 $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/msi_sdk_signing.done:
178 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,2)
179 $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),PRL)
180 $(PERL) $(SRCDIR)/postprocess/signing/signing.pl \
181 -l $(subst .done,_log.txt,$@) \
182 $(if $(verbose),-v) \
183 $(if $(PFXFILE),-f $(PFXFILE)) \
184 $(if $(PFXPASSWORD),-p $(PFXPASSWORD)) \
185 $(if $(TIMESTAMPURL),-t $(TIMESTAMPURL)) \
186 -d $(PRODUCTNAME_WITHOUT_SPACES)\ $(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)\ SDK \
187 $(WORKDIR)/installation/$(PRODUCTNAME_WITHOUT_SPACES)_SDK/msi/install/*/*.msi \
188 && touch $@
189 $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),PRL)
191 # vim: set noet sw=4 ts=4: