bump product version to 4.1.6.2
[LibreOffice.git] / sysui / CustomTarget_share.mk
blobe342cfa2afe4879ad7a5e73094a1c2a3e4f4016f
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
12 ifeq ($(ENABLE_GIO),TRUE)
13 brand_URIPARAM := --urls
14 else
15 ifeq ($(ENABLE_GNOMEVFS),TRUE)
16 brand_URIPARAM := --urls
17 else
18 brand_URIPARAM :=
19 endif
20 endif
22 share_WORKDIR := $(call gb_CustomTarget_get_workdir,sysui/share)
23 share_SRCDIR := $(SRCDIR)/sysui/desktop
25 share_TRANSLATE := $(SOLARENV)/bin/desktop-translate.pl
27 LAUNCHERLIST_APPS := writer calc draw impress math base startcenter
28 LAUNCHERLIST := $(LAUNCHERLIST_APPS) qstart xsltfilter
29 LAUNCHERS := $(foreach launcher,$(LAUNCHERLIST),$(share_SRCDIR)/menus/$(launcher).desktop)
31 MIMELIST := \
32 text \
33 text-template \
34 spreadsheet \
35 spreadsheet-template \
36 drawing \
37 drawing-template \
38 presentation \
39 presentation-template \
40 formula \
41 master-document \
42 oasis-text \
43 oasis-text-template \
44 oasis-text-flat-xml \
45 oasis-spreadsheet \
46 oasis-spreadsheet-template \
47 oasis-spreadsheet-flat-xml \
48 oasis-drawing \
49 oasis-drawing-template \
50 oasis-drawing-flat-xml \
51 oasis-presentation \
52 oasis-presentation-template \
53 oasis-presentation-flat-xml \
54 oasis-formula \
55 oasis-master-document \
56 oasis-database \
57 oasis-web-template \
58 ms-excel-sheet-12 \
59 ms-excel-sheet \
60 ms-excel-template-12 \
61 ms-powerpoint-presentation-12 \
62 ms-powerpoint-presentation \
63 ms-powerpoint-template-12 \
64 ms-word-document-12 \
65 ms-word-document \
66 ms-word-document2 \
67 ms-word-template-12 \
68 openxmlformats-officedocument-presentationml-presentation \
69 openxmlformats-officedocument-presentationml-template \
70 openxmlformats-officedocument-spreadsheetml-sheet \
71 openxmlformats-officedocument-spreadsheetml-template \
72 openxmlformats-officedocument-wordprocessingml-document \
73 openxmlformats-officedocument-wordprocessingml-template \
74 ms-excel-sheet-binary-12 \
75 extension
77 MIMEICONLIST := \
78 oasis-text \
79 oasis-text-template \
80 oasis-spreadsheet \
81 oasis-spreadsheet-template \
82 oasis-drawing \
83 oasis-drawing-template \
84 oasis-presentation \
85 oasis-presentation-template \
86 oasis-formula \
87 oasis-master-document \
88 oasis-database \
89 oasis-web-template \
90 text \
91 text-template \
92 spreadsheet \
93 spreadsheet-template \
94 drawing \
95 drawing-template \
96 presentation \
97 presentation-template \
98 formula \
99 master-document \
100 database \
101 extension
103 share_ICONS := $(foreach size,16x16 32x32 48x48,\
104 $(foreach contrast,hicolor locolor,\
105 $(foreach app,$(LAUNCHERLIST_APPS),\
106 $(share_SRCDIR)/icons/$(contrast)/$(size)/apps/$(app).png) \
107 $(foreach mime,$(MIMEICONLIST),\
108 $(share_SRCDIR)/icons/$(contrast)/$(size)/mimetypes/$(mime).png)))
110 MIMEKEYS := $(foreach mime,$(MIMELIST),$(share_SRCDIR)/mimetypes/$(mime).keys)
111 MIMEDESKTOPS := $(foreach mime,$(MIMELIST),$(share_SRCDIR)/mimetypes/$(mime).desktop)
112 ULFS := documents.ulf \
113 launcher_comment.ulf \
114 launcher_genericname.ulf \
115 launcher_unityquicklist.ulf
117 $(eval $(call gb_CustomTarget_CustomTarget,sysui/share))
119 $(eval $(call gb_CustomTarget_register_targets,sysui/share,\
120 $(ULFS) \
121 $(foreach product,$(PRODUCTLIST),\
122 $(product)/build.flag \
123 $(product)/openoffice.org.xml \
124 $(product)/openoffice.mime \
125 $(product)/openoffice.applications \
126 $(product)/openoffice.keys \
127 $(product)/openoffice.sh \
128 $(product)/printeradmin.sh \
129 $(product)/create_tree.sh \
130 $(product)/mimelnklist \
131 $(product)/launcherlist) \
134 $(share_WORKDIR)/%/openoffice.org.xml: $(share_WORKDIR)/documents.ulf $(MIMEDESKTOPS) $(share_SRCDIR)/share/create_mime_xml.pl
135 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,1)
136 $(PERL) $(share_SRCDIR)/share/create_mime_xml.pl $< > $@
139 $(share_WORKDIR)/%/openoffice.keys: \
140 $(share_SRCDIR)/mimetypes/openoffice.mime $(MIMEKEYS) $(share_SRCDIR)/share/brand.pl \
141 $(share_TRANSLATE) $(share_WORKDIR)/documents.ulf
142 mkdir -p $(dir $@)
143 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,1)
144 $(PERL) $(share_SRCDIR)/share/brand.pl -p $* -u $(UNIXFILENAME.$*) \
145 --iconprefix $(UNIXFILENAME.$*)- $^ $(share_WORKDIR)/$*
146 $(PERL) $(share_TRANSLATE) -p $* -d $(share_WORKDIR)/$* \
147 --ext "keys" --key "description" $(share_WORKDIR)/documents.ulf
148 cat $(MIMEKEYS) > $@
150 $(share_WORKDIR)/%/mimelnklist: $(MIMEDESKTOPS) $(share_SRCDIR)/share/brand.pl \
151 $(share_TRANSLATE) $(share_WORKDIR)/documents.ulf
152 mkdir -p $(dir $@)
153 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,1)
154 $(PERL) $(share_SRCDIR)/share/brand.pl -p $* -u $(UNIXFILENAME.$*) \
155 --iconprefix $(UNIXFILENAME.$*)- $^ $(share_WORKDIR)/$*
156 $(PERL) $(share_TRANSLATE) -p $* -d $(share_WORKDIR)/$* \
157 --ext "desktop" --key "Comment" $(share_WORKDIR)/documents.ulf
158 echo "$(MIMEDESKTOPS)" > $@
160 $(share_WORKDIR)/%/openoffice.mime: $(share_SRCDIR)/mimetypes/openoffice.mime
161 mkdir -p $(dir $@)
162 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),CAT,1)
163 cat $< | tr -d "\015" > $@
165 $(share_WORKDIR)/%/openoffice.sh: $(share_SRCDIR)/share/openoffice.sh
166 mkdir -p $(dir $@)
167 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),CAT,1)
168 cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$*)/g" > $@
170 $(share_WORKDIR)/%/printeradmin.sh: $(share_SRCDIR)/share/printeradmin.sh
171 mkdir -p $(dir $@)
172 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),CAT,1)
173 cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$*)/g" > $@
175 $(share_WORKDIR)/%/create_tree.sh: $(share_SRCDIR)/share/create_tree.sh $(share_WORKDIR)/%/mimelnklist $(share_WORKDIR)/%/printeradmin.sh \
176 $(share_WORKDIR)/%/openoffice.org.xml $(share_WORKDIR)/%/openoffice.applications $(share_WORKDIR)/%/openoffice.mime \
177 $(share_WORKDIR)/%/openoffice.keys $(share_WORKDIR)/%/launcherlist
178 mkdir -p $(dir $@)
179 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),CAT,1)
180 echo "#!/bin/sh" > $@
181 echo "PREFIX=$(UNIXFILENAME.$*)" >> $@
182 echo "ICON_PREFIX=$(UNIXFILENAME.$*)" >> $@
183 echo "ICON_SOURCE_DIR=$(SRCDIR)/sysui/desktop/icons" >> $@
184 echo "PRODUCTVERSION=$(PRODUCTVERSION)" >> $@
185 cat $< >> $@
186 chmod 774 $@
189 $(share_WORKDIR)/%/launcherlist: $(LAUNCHERS)
190 mkdir -p $(dir $@)
191 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1)
192 echo "$(addsuffix .desktop,$(filter-out qstart,$(LAUNCHERLIST)))" > $@
195 $(share_WORKDIR)/%/openoffice.applications: $(share_SRCDIR)/mimetypes/openoffice.applications
196 mkdir -p $(dir $@)
197 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),CAT,1)
198 cat $< | tr -d "\015" | sed -e "s/OFFICENAME/$(UNIXFILENAME.$*)/" -e "s/%PRODUCTNAME/$(PRODUCTNAME.$*) $(PRODUCTVERSION.$*)/" > $@
200 $(share_WORKDIR)/%/build.flag: $(share_SRCDIR)/share/brand.pl $(LAUNCHERS) \
201 $(share_TRANSLATE) $(addprefix $(share_WORKDIR)/,$(ULFS))
202 mkdir -p $(dir $@)
203 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,1)
204 $(PERL) $(share_SRCDIR)/share/brand.pl -p '$${PRODUCTNAME} $${PRODUCTVERSION}' -u $(UNIXFILENAME.$*) \
205 $(brand_URIPARAM) \
206 --iconprefix '$${UNIXBASISROOTNAME}-' $^ $(share_WORKDIR)/$*
207 $(PERL) $(share_TRANSLATE) -p $(PRODUCTNAME.$*)$(PRODUCTVERSION) -d $(share_WORKDIR)/$* \
208 --ext "desktop" --key "Comment" $(share_WORKDIR)/launcher_comment.ulf
209 $(PERL) $(share_TRANSLATE) -p $(PRODUCTNAME.$*)$(PRODUCTVERSION) -d $(share_WORKDIR)/$* \
210 --ext "desktop" --key "GenericName" $(share_WORKDIR)/launcher_genericname.ulf
211 $(PERL) $(share_TRANSLATE) -p $(PRODUCTNAME.$*)$(PRODUCTVERSION) -d $(share_WORKDIR)/$* \
212 --ext "desktop" --key "UnityQuickList" $(share_WORKDIR)/launcher_unityquicklist.ulf
213 touch $@
215 ifneq ($(WITH_LANG),)
216 $(share_WORKDIR)/%.ulf: $(share_SRCDIR)/share/%.ulf | $(call gb_Executable_get_runtime_dependencies,ulfex)
217 $(call gb_Output_announce,$@,$(true),SUM,1)
218 MERGEINPUT=`$(gb_MKTEMP)` && \
219 echo $(foreach lang,$(gb_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/sysui/desktop/share.po) > $${MERGEINPUT} && \
220 $(call gb_Helper_abbreviate_dirs,\
221 $(call gb_Executable_get_command,ulfex) -i $< -o $@ -m $${MERGEINPUT} -l all ) && \
222 rm -rf $${MERGEINPUT}
223 else
224 $(share_WORKDIR)/%.ulf: $(share_SRCDIR)/share/%.ulf
225 cp $< $@
226 endif
228 # vim: set noet sw=4 ts=4: