Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / sysui / CustomTarget_share.mk
blobc81edd50f1afb4acf49b271e9c6b5f731bcd84bd
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 include $(SRCDIR)/sysui/productlist.mk
13 ifeq ($(ENABLE_GIO),TRUE)
14 brand_URIPARAM := --urls
15 else ifeq ($(ENABLE_TDE),TRUE)
16 brand_URIPARAM := --urls
17 else ifeq ($(ENABLE_KDE4),TRUE)
18 brand_URIPARAM := --urls
19 else
20 brand_URIPARAM :=
21 endif
23 share_WORKDIR := $(call gb_CustomTarget_get_workdir,sysui/share)
24 share_SRCDIR := $(SRCDIR)/sysui/desktop
26 share_TRANSLATE := $(SRCDIR)/solenv/bin/desktop-translate.pl
28 LAUNCHERLIST_APPS := writer calc draw impress math base startcenter
29 LAUNCHERLIST := $(LAUNCHERLIST_APPS) qstart xsltfilter
30 LAUNCHERS := $(foreach launcher,$(LAUNCHERLIST),$(share_SRCDIR)/menus/$(launcher).desktop)
32 MIMELIST := \
33 text \
34 text-template \
35 spreadsheet \
36 spreadsheet-template \
37 drawing \
38 drawing-template \
39 presentation \
40 presentation-template \
41 formula \
42 master-document \
43 oasis-text \
44 oasis-text-template \
45 oasis-text-flat-xml \
46 oasis-spreadsheet \
47 oasis-spreadsheet-template \
48 oasis-spreadsheet-flat-xml \
49 oasis-drawing \
50 oasis-drawing-template \
51 oasis-drawing-flat-xml \
52 oasis-presentation \
53 oasis-presentation-template \
54 oasis-presentation-flat-xml \
55 oasis-formula \
56 oasis-master-document \
57 oasis-master-document-template \
58 oasis-database \
59 oasis-web-template \
60 ms-excel-sheet-12 \
61 ms-excel-sheet \
62 ms-excel-template-12 \
63 ms-powerpoint-presentation-12 \
64 ms-powerpoint-presentation \
65 ms-powerpoint-template-12 \
66 ms-word-document-12 \
67 ms-word-document \
68 ms-word-document2 \
69 ms-word-template-12 \
70 openxmlformats-officedocument-presentationml-presentation \
71 openxmlformats-officedocument-presentationml-template \
72 openxmlformats-officedocument-spreadsheetml-sheet \
73 openxmlformats-officedocument-spreadsheetml-template \
74 openxmlformats-officedocument-wordprocessingml-document \
75 openxmlformats-officedocument-wordprocessingml-template \
76 ms-excel-sheet-binary-12 \
77 extension
79 MIMEICONLIST := \
80 oasis-text \
81 oasis-text-template \
82 oasis-spreadsheet \
83 oasis-spreadsheet-template \
84 oasis-drawing \
85 oasis-drawing-template \
86 oasis-presentation \
87 oasis-presentation-template \
88 oasis-formula \
89 oasis-master-document \
90 oasis-master-document-template \
91 oasis-database \
92 oasis-web-template \
93 text \
94 text-template \
95 spreadsheet \
96 spreadsheet-template \
97 drawing \
98 drawing-template \
99 presentation \
100 presentation-template \
101 formula \
102 master-document \
103 database \
104 extension
106 share_ICONS := $(foreach size,16x16 32x32 48x48,\
107 $(foreach contrast,hicolor locolor,\
108 $(foreach app,$(LAUNCHERLIST_APPS),\
109 $(share_SRCDIR)/icons/$(contrast)/$(size)/apps/$(app).png) \
110 $(foreach mime,$(MIMEICONLIST),\
111 $(share_SRCDIR)/icons/$(contrast)/$(size)/mimetypes/$(mime).png)))
113 MIMEKEYS := $(foreach mime,$(MIMELIST),$(share_SRCDIR)/mimetypes/$(mime).keys)
114 MIMEDESKTOPS := $(foreach mime,$(MIMELIST),$(share_SRCDIR)/mimetypes/$(mime).desktop)
115 ULFS := documents.ulf \
116 launcher_comment.ulf \
117 launcher_genericname.ulf \
118 launcher_unityquicklist.ulf
120 $(eval $(call gb_CustomTarget_CustomTarget,sysui/share))
122 $(eval $(call gb_CustomTarget_register_targets,sysui/share,\
123 $(ULFS) \
124 $(foreach product,$(PRODUCTLIST),\
125 $(product)/build.flag \
126 $(product)/openoffice.org.xml \
127 $(product)/openoffice.mime \
128 $(product)/openoffice.applications \
129 $(product)/openoffice.keys \
130 $(product)/openoffice.sh \
131 $(product)/create_tree.sh \
132 $(product)/mimelnklist \
133 $(product)/launcherlist) \
136 $(share_WORKDIR)/%/openoffice.org.xml: $(share_WORKDIR)/documents.ulf $(MIMEDESKTOPS) $(share_SRCDIR)/share/create_mime_xml.pl
137 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,1)
138 $(PERL) $(share_SRCDIR)/share/create_mime_xml.pl $< > $@
141 $(share_WORKDIR)/%/openoffice.keys: \
142 $(share_SRCDIR)/mimetypes/openoffice.mime $(MIMEKEYS) $(share_SRCDIR)/share/brand.pl \
143 $(share_TRANSLATE) $(share_WORKDIR)/documents.ulf
144 mkdir -p $(dir $@)
145 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,1)
146 $(PERL) $(share_SRCDIR)/share/brand.pl -p $* -u $(UNIXFILENAME.$*) \
147 --iconprefix $(UNIXFILENAME.$*)- $^ $(share_WORKDIR)/$*
148 $(PERL) $(share_TRANSLATE) -p $* -d $(share_WORKDIR)/$* \
149 --ext "keys" --key "description" $(share_WORKDIR)/documents.ulf
150 cat $(MIMEKEYS) > $@
152 $(share_WORKDIR)/%/mimelnklist: $(MIMEDESKTOPS) $(share_SRCDIR)/share/brand.pl \
153 $(share_TRANSLATE) $(share_WORKDIR)/documents.ulf
154 mkdir -p $(dir $@)
155 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,1)
156 $(PERL) $(share_SRCDIR)/share/brand.pl -p $* -u $(UNIXFILENAME.$*) \
157 --iconprefix $(UNIXFILENAME.$*)- $^ $(share_WORKDIR)/$*
158 $(PERL) $(share_TRANSLATE) -p $* -d $(share_WORKDIR)/$* \
159 --ext "desktop" --key "Comment" $(share_WORKDIR)/documents.ulf
160 echo "$(MIMEDESKTOPS)" > $@
162 $(share_WORKDIR)/%/openoffice.mime: $(share_SRCDIR)/mimetypes/openoffice.mime
163 mkdir -p $(dir $@)
164 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),CAT,1)
165 cat $< | tr -d "\015" > $@
167 $(share_WORKDIR)/%/openoffice.sh: $(share_SRCDIR)/share/openoffice.sh
168 mkdir -p $(dir $@)
169 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),CAT,1)
170 cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$*)/g" > $@
172 $(share_WORKDIR)/%/create_tree.sh: $(share_SRCDIR)/share/create_tree.sh $(share_WORKDIR)/%/mimelnklist \
173 $(share_WORKDIR)/%/openoffice.org.xml $(share_WORKDIR)/%/openoffice.applications $(share_WORKDIR)/%/openoffice.mime \
174 $(share_WORKDIR)/%/openoffice.keys $(share_WORKDIR)/%/launcherlist $(if $(INTROSPECTION_SCANNER),$(call gb_Library_get_target,libreofficekitgtk))
175 mkdir -p $(dir $@)
176 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),CAT,1)
177 echo "#!/bin/sh" > $@
178 echo "PREFIX=$(UNIXFILENAME.$*)" >> $@
179 echo "ICON_PREFIX=$(UNIXFILENAME.$*)" >> $@
180 echo "ICON_SOURCE_DIR=$(SRCDIR)/sysui/desktop/icons" >> $@
181 echo "APPDATA_SOURCE_DIR=$(SRCDIR)/sysui/desktop/appstream-appdata" >> $@
182 echo "PRODUCTVERSION=$(PRODUCTVERSION)" >> $@
183 echo "INTROSPECTION_SCANNER=$(INTROSPECTION_SCANNER)" >> $@
184 cat $< >> $@
185 chmod 774 $@
188 $(share_WORKDIR)/%/launcherlist: $(LAUNCHERS)
189 mkdir -p $(dir $@)
190 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1)
191 echo "$(addsuffix .desktop,$(filter-out qstart,$(LAUNCHERLIST)))" > $@
194 $(share_WORKDIR)/%/openoffice.applications: $(share_SRCDIR)/mimetypes/openoffice.applications
195 mkdir -p $(dir $@)
196 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),CAT,1)
197 cat $< | tr -d "\015" | sed -e "s/OFFICENAME/$(UNIXFILENAME.$*)/" -e "s/%PRODUCTNAME/$(PRODUCTNAME.$*) $(PRODUCTVERSION.$*)/" > $@
199 # these .desktop files are written by brand.pl below
200 # need to have a rule for these because they are targets in Package_share
201 define sysui_Desktop_rule
202 $(share_WORKDIR)/%/$(1).desktop : $(share_WORKDIR)/%/build.flag
203 touch $$@
205 endef
207 $(foreach launcher,$(LAUNCHERLIST),$(eval $(call sysui_Desktop_rule,$(launcher))))
209 $(share_WORKDIR)/%/build.flag: $(share_SRCDIR)/share/brand.pl $(LAUNCHERS) \
210 $(share_TRANSLATE) $(addprefix $(share_WORKDIR)/,$(ULFS))
211 mkdir -p $(dir $@)
212 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,1)
213 $(PERL) $(share_SRCDIR)/share/brand.pl -p '$${PRODUCTNAME} $${PRODUCTVERSION}' -u $(UNIXFILENAME.$*) \
214 $(brand_URIPARAM) \
215 --iconprefix '$${UNIXBASISROOTNAME}-' $^ $(share_WORKDIR)/$*
216 $(PERL) $(share_TRANSLATE) -p $(PRODUCTNAME.$*)$(PRODUCTVERSION) -d $(share_WORKDIR)/$* \
217 --ext "desktop" --key "Comment" $(share_WORKDIR)/launcher_comment.ulf
218 $(PERL) $(share_TRANSLATE) -p $(PRODUCTNAME.$*)$(PRODUCTVERSION) -d $(share_WORKDIR)/$* \
219 --ext "desktop" --key "GenericName" $(share_WORKDIR)/launcher_genericname.ulf
220 $(PERL) $(share_TRANSLATE) -p $(PRODUCTNAME.$*)$(PRODUCTVERSION) -d $(share_WORKDIR)/$* \
221 --ext "desktop" --key "UnityQuickList" $(share_WORKDIR)/launcher_unityquicklist.ulf
222 touch $@
224 $(eval $(call gb_CustomTarget_ulfex_rule,\
225 $(share_WORKDIR)/%.ulf,\
226 $(share_SRCDIR)/share/%.ulf,\
227 $(foreach lang,$(gb_TRANS_LANGS),\
228 $(gb_POLOCATION)/$(lang)/sysui/desktop/share.po)))
230 # vim: set noet sw=4 ts=4: