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