xref: /trunk/main/sysui/desktop/share/makefile.mk (revision 7871dc3e)
1*7871dc3eSAndrew Rist#**************************************************************
2*7871dc3eSAndrew Rist#
3*7871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4*7871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5*7871dc3eSAndrew Rist#  distributed with this work for additional information
6*7871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7*7871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
8*7871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
9*7871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
10*7871dc3eSAndrew Rist#
11*7871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12*7871dc3eSAndrew Rist#
13*7871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
14*7871dc3eSAndrew Rist#  software distributed under the License is distributed on an
15*7871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*7871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
17*7871dc3eSAndrew Rist#  specific language governing permissions and limitations
18*7871dc3eSAndrew Rist#  under the License.
19*7871dc3eSAndrew Rist#
20*7871dc3eSAndrew Rist#**************************************************************
21*7871dc3eSAndrew Rist
22*7871dc3eSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweirPRJ=..$/..
25cdf0e10cSrcweir
26cdf0e10cSrcweirPRJNAME=sysui
27cdf0e10cSrcweirTARGET=desktopshare
28cdf0e10cSrcweir
29cdf0e10cSrcweir# --- Settings -----------------------------------------------------
30cdf0e10cSrcweir
31cdf0e10cSrcweir.INCLUDE :  settings.mk
32cdf0e10cSrcweir
33cdf0e10cSrcweir# --- Product Version Information ----------------------------------
34cdf0e10cSrcweir
35cdf0e10cSrcweir.INCLUDE :  ../productversion.mk
36cdf0e10cSrcweir
37cdf0e10cSrcweir# --- Files --------------------------------------------------------
38cdf0e10cSrcweir
39cdf0e10cSrcweir.IF "$(WITH_LANG)"!=""
40cdf0e10cSrcweirULFDIR:=$(COMMONMISC)$/$(TARGET)
41cdf0e10cSrcweir.ELSE			# "$(WITH_LANG)"!=""
42cdf0e10cSrcweirULFDIR:=.
43cdf0e10cSrcweir.ENDIF			# "$(WITH_LANG)"!=""
44cdf0e10cSrcweir
45cdf0e10cSrcweirULFFILES= \
46cdf0e10cSrcweir    documents.ulf \
47cdf0e10cSrcweir    launcher_comment.ulf \
48cdf0e10cSrcweir    launcher_genericname.ulf \
49cdf0e10cSrcweir    launcher_name.ulf
50cdf0e10cSrcweir
51cdf0e10cSrcweirLAUNCHERLIST = writer calc draw impress math base printeradmin qstart startcenter javafilter
52cdf0e10cSrcweirLAUNCHERDEPN = ../menus/{$(LAUNCHERLIST)}.desktop
53cdf0e10cSrcweir
54cdf0e10cSrcweirLAUNCHERFLAGFILE = $(COMMONMISC)/$(TARGET)/xdg.flag
55cdf0e10cSrcweir
56cdf0e10cSrcweirMIMELIST = \
57cdf0e10cSrcweir	text \
58cdf0e10cSrcweir	text-template \
59cdf0e10cSrcweir	spreadsheet \
60cdf0e10cSrcweir	spreadsheet-template \
61cdf0e10cSrcweir	drawing \
62cdf0e10cSrcweir	drawing-template \
63cdf0e10cSrcweir	presentation \
64cdf0e10cSrcweir	presentation-template \
65cdf0e10cSrcweir	formula \
66cdf0e10cSrcweir	master-document \
67cdf0e10cSrcweir	oasis-text \
68cdf0e10cSrcweir	oasis-text-template \
69cdf0e10cSrcweir	oasis-spreadsheet \
70cdf0e10cSrcweir	oasis-spreadsheet-template \
71cdf0e10cSrcweir	oasis-drawing \
72cdf0e10cSrcweir	oasis-drawing-template \
73cdf0e10cSrcweir	oasis-presentation \
74cdf0e10cSrcweir	oasis-presentation-template \
75cdf0e10cSrcweir	oasis-formula \
76cdf0e10cSrcweir	oasis-master-document \
77cdf0e10cSrcweir	oasis-database \
78cdf0e10cSrcweir	oasis-web-template \
79cdf0e10cSrcweir	ms-excel-sheet-12 \
80cdf0e10cSrcweir	ms-excel-sheet \
81cdf0e10cSrcweir	ms-excel-template-12 \
82cdf0e10cSrcweir	ms-powerpoint-presentation-12 \
83cdf0e10cSrcweir	ms-powerpoint-presentation \
84cdf0e10cSrcweir	ms-powerpoint-template-12 \
85cdf0e10cSrcweir	ms-word-document-12 \
86cdf0e10cSrcweir	ms-word-document \
87cdf0e10cSrcweir	ms-word-document2 \
88cdf0e10cSrcweir	ms-word-template-12 \
89cdf0e10cSrcweir	openxmlformats-officedocument-presentationml-presentation \
90cdf0e10cSrcweir	openxmlformats-officedocument-presentationml-template \
91cdf0e10cSrcweir	openxmlformats-officedocument-spreadsheetml-sheet \
92cdf0e10cSrcweir	openxmlformats-officedocument-spreadsheetml-template \
93cdf0e10cSrcweir	openxmlformats-officedocument-wordprocessingml-document \
94cdf0e10cSrcweir	openxmlformats-officedocument-wordprocessingml-template \
95cdf0e10cSrcweir    ms-excel-sheet-binary-12	\
96cdf0e10cSrcweir    extension
97cdf0e10cSrcweir
98cdf0e10cSrcweirMIMEICONLIST = \
99cdf0e10cSrcweir	oasis-text \
100cdf0e10cSrcweir	oasis-text-template \
101cdf0e10cSrcweir	oasis-spreadsheet \
102cdf0e10cSrcweir	oasis-spreadsheet-template \
103cdf0e10cSrcweir	oasis-drawing \
104cdf0e10cSrcweir	oasis-drawing-template \
105cdf0e10cSrcweir	oasis-presentation \
106cdf0e10cSrcweir	oasis-presentation-template \
107cdf0e10cSrcweir	oasis-formula \
108cdf0e10cSrcweir	oasis-master-document \
109cdf0e10cSrcweir	oasis-database \
110cdf0e10cSrcweir	oasis-web-template \
111cdf0e10cSrcweir	text \
112cdf0e10cSrcweir	text-template \
113cdf0e10cSrcweir	spreadsheet \
114cdf0e10cSrcweir	spreadsheet-template \
115cdf0e10cSrcweir	drawing \
116cdf0e10cSrcweir	drawing-template \
117cdf0e10cSrcweir	presentation \
118cdf0e10cSrcweir	presentation-template \
119cdf0e10cSrcweir	formula \
120cdf0e10cSrcweir	master-document \
121cdf0e10cSrcweir	database \
122cdf0e10cSrcweir    extension
123cdf0e10cSrcweir
124cdf0e10cSrcweirICONDEPN = \
125cdf0e10cSrcweir	../icons/hicolor/{16x16 32x32 48x48}/apps/{$(LAUNCHERLIST:s/qstart//:s/javafilter//)}.png \
126cdf0e10cSrcweir	../icons/hicolor/{16x16 32x32 48x48}/mimetypes/{$(MIMEICONLIST)}.png \
127cdf0e10cSrcweir	../icons/locolor/{16x16 32x32}/apps/{$(LAUNCHERLIST:s/qstart//:s/javafilter//)}.png \
128cdf0e10cSrcweir	../icons/locolor/{16x16 32x32}/mimetypes/{$(MIMEICONLIST)}.png
129cdf0e10cSrcweir
130cdf0e10cSrcweir# --- Targets ------------------------------------------------------
131cdf0e10cSrcweir
132cdf0e10cSrcweir.INCLUDE :  target.mk
133cdf0e10cSrcweir
134cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
135cdf0e10cSrcweirALLTAR : $(LAUNCHERFLAGFILE) $(SPECFILES) $(COMMONMISC)$/{$(PRODUCTLIST)}$/build.flag
136cdf0e10cSrcweir
137cdf0e10cSrcweir.ENDIF          # "$(GUI)"=="UNIX"
138cdf0e10cSrcweir
139cdf0e10cSrcweir#
140cdf0e10cSrcweir# Copy/patch the .desktop files to the output tree and
141cdf0e10cSrcweir# merge-in the translations.
142cdf0e10cSrcweir#
143cdf0e10cSrcweir
144cdf0e10cSrcweir$(LAUNCHERFLAGFILE) : ../productversion.mk brand.pl translate.pl $(ULFDIR)$/launcher_name.ulf $(ULFDIR)$/launcher_comment.ulf $(ULFDIR)/launcher_genericname.ulf
145cdf0e10cSrcweir$(LAUNCHERFLAGFILE) : $(LAUNCHERDEPN)
146cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:db).$(INPATH).$(@:f)
147cdf0e10cSrcweir	@echo Creating desktop entries for $(@:f) ..
148cdf0e10cSrcweir	@echo ---------------------------------
149cdf0e10cSrcweir	@$(PERL) brand.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -u $(UNIXWRAPPERNAME) --iconprefix '$${{WITHOUTDOTUNIXPRODUCTNAME}}${ICONVERSION}-' $< $(@:db).$(INPATH).$(@:f)
150cdf0e10cSrcweir	@$(PERL) translate.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d $(@:db).$(INPATH).$(@:f) --ext "desktop" --key "Name" $(ULFDIR)$/launcher_name.ulf
151cdf0e10cSrcweir	@$(PERL) translate.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d $(@:db).$(INPATH).$(@:f) --ext "desktop" --key "Comment" $(ULFDIR)$/launcher_comment.ulf
152cdf0e10cSrcweir	@$(PERL) translate.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d $(@:db).$(INPATH).$(@:f) --ext "desktop" --key "GenericName" $(ULFDIR)$/launcher_genericname.ulf
153cdf0e10cSrcweir.IF "$(WITH_LIBSN)"=="YES"
154cdf0e10cSrcweir	@noop x$(foreach,i,$(LAUNCHERLIST) $(shell @echo "StartupNotify=true" >> $(@:db).$(INPATH).$(@:f)/$i.desktop))x
155cdf0e10cSrcweir.ENDIF
156cdf0e10cSrcweir	@$(MV) -f $(@:db).$(INPATH).$(@:f)/* $(@:d)
157cdf0e10cSrcweir	@rmdir $(@:db).$(INPATH).$(@:f)
158cdf0e10cSrcweir	@touch $@
159cdf0e10cSrcweir
160cdf0e10cSrcweir#
161cdf0e10cSrcweir# Create shared mime info xml file
162cdf0e10cSrcweir#
163cdf0e10cSrcweir$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.org.xml : ../mimetypes/{$(MIMELIST)}.desktop create_mime_xml.pl
164cdf0e10cSrcweir$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.org.xml : $(ULFDIR)$/documents.ulf
165cdf0e10cSrcweir	@echo Create shared mime info xml file ..
166cdf0e10cSrcweir	@echo ---------------------------------
167cdf0e10cSrcweir	@$(PERL) create_mime_xml.pl $< > $@.$(INPATH)
168cdf0e10cSrcweir	@mv -f $@.$(INPATH) $@
169cdf0e10cSrcweir
170cdf0e10cSrcweir#
171cdf0e10cSrcweir# Create GNOME mime-info files
172cdf0e10cSrcweir#
173cdf0e10cSrcweir
174cdf0e10cSrcweir$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.keys : ../mimetypes/openoffice.mime brand.pl translate.pl ../productversion.mk $(ULFDIR)$/documents.ulf
175cdf0e10cSrcweir$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.keys : ../mimetypes/{$(MIMELIST)}.keys
176cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
177cdf0e10cSrcweir	@echo Creating GNOME .keys file for $(@:d:d:f) ..
178cdf0e10cSrcweir	@echo ---------------------------------
179cdf0e10cSrcweir	@$(PERL) brand.pl -p $(PRODUCTNAME.$(@:d:d:f)) -u $(UNIXFILENAME.$(@:d:d:f)) --iconprefix "$(ICONPREFIX.$(@:d:d:f))-" $< $(MISC)/$(@:d:d:f)
180cdf0e10cSrcweir	@$(PERL) translate.pl -p $(PRODUCTNAME.$(@:d:d:f)) -d $(MISC)/$(@:d:d:f) --ext "keys" --key "description" $(ULFDIR)$/documents.ulf
181cdf0e10cSrcweir	@cat $(MISC)/$(@:d:d:f)/{$(MIMELIST)}.keys > $@.$(INPATH)
182cdf0e10cSrcweir	@mv -f $@.$(INPATH) $@
183cdf0e10cSrcweir
184cdf0e10cSrcweir$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.mime : ../mimetypes/$$(@:f)
185cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
186cdf0e10cSrcweir	@echo Creating GNOME .mime file for $(@:d:d:f) ..
187cdf0e10cSrcweir	@echo ---------------------------------
188cdf0e10cSrcweir	@cat $< | tr -d "\015" > $@.$(INPATH)
189cdf0e10cSrcweir	@mv -f $@.$(INPATH) $@
190cdf0e10cSrcweir
191cdf0e10cSrcweir$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.applications : ../productversion.mk
192cdf0e10cSrcweir$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.applications : ../mimetypes/$$(@:f)
193cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
194cdf0e10cSrcweir	@echo Creating GNOME .applications file for $(@:d:d:f) ..
195cdf0e10cSrcweir	@echo ---------------------------------
196cdf0e10cSrcweir	@cat $< | tr -d "\015" | sed -e "s/OFFICENAME/$(UNIXFILENAME.$(@:d:d:f))/" -e "s/%PRODUCTNAME/$(PRODUCTNAME.$(@:d:d:f)) $(PRODUCTVERSION.$(@:d:d:f))/" > $@.$(INPATH)
197cdf0e10cSrcweir	@mv -f $@.$(INPATH) $@
198cdf0e10cSrcweir
199cdf0e10cSrcweir#
200cdf0e10cSrcweir# Create KDE mimelnk files
201cdf0e10cSrcweir#
202cdf0e10cSrcweir$(COMMONMISC)$/{$(PRODUCTLIST)}$/mimelnklist : brand.pl translate.pl ../productversion.mk $(ULFDIR)$/documents.ulf
203cdf0e10cSrcweir$(COMMONMISC)$/{$(PRODUCTLIST)}$/mimelnklist : ../mimetypes/{$(MIMELIST)}.desktop
204cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:db).$(INPATH)
205cdf0e10cSrcweir	@echo Creating KDE mimelnk entries for $(@:d:d:f) ..
206cdf0e10cSrcweir	@echo ---------------------------------
207cdf0e10cSrcweir	@$(PERL) brand.pl -p "$(PRODUCTNAME.$(@:d:d:f))" -u $(UNIXFILENAME.$(@:d:d:f)) --iconprefix "$(ICONPREFIX.$(@:d:d:f))-" $< $(@:db).$(INPATH)
208cdf0e10cSrcweir	@$(PERL) ../share/translate.pl -p "$(PRODUCTNAME.$(@:d:d:f))" -d $(@:db).$(INPATH) --ext "desktop" --key "Comment" $(ULFDIR)$/documents.ulf
209cdf0e10cSrcweir	@mv -f $(@:db).$(INPATH)/* $(@:d)
210cdf0e10cSrcweir	@rmdir $(@:db).$(INPATH)
211cdf0e10cSrcweir	@echo  "{$(MIMELIST)}.desktop" > $@
212cdf0e10cSrcweir
213cdf0e10cSrcweir#
214cdf0e10cSrcweir# Generate customized install scripts
215cdf0e10cSrcweir#
216cdf0e10cSrcweir$(COMMONMISC)$/{$(PRODUCTLIST)}$/create_tree.sh : makefile.mk
217cdf0e10cSrcweir$(COMMONMISC)$/{$(PRODUCTLIST)}$/create_tree.sh : $$(@:f)
218cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
219cdf0e10cSrcweir	@echo "#\!/bin/bash" > $@.$(INPATH)
220cdf0e10cSrcweir	@echo "PREFIX=$(UNIXFILENAME.$(@:d:d:f))" >> $@.$(INPATH)
221cdf0e10cSrcweir	@echo "ICON_PREFIX=$(ICONPREFIX.$(@:d:d:f))" >> $@.$(INPATH)
222cdf0e10cSrcweir	@echo "ICON_SOURCE_DIR=../../../desktop/icons" >> $@.$(INPATH)
223cdf0e10cSrcweir	@cat $< >> $@.$(INPATH)
224cdf0e10cSrcweir	@chmod 774 $@.$(INPATH)
225cdf0e10cSrcweir	@mv -f $@.$(INPATH) $@
226cdf0e10cSrcweir
227cdf0e10cSrcweir#
228cdf0e10cSrcweir# Create skript files
229cdf0e10cSrcweir#
230cdf0e10cSrcweir
231cdf0e10cSrcweir$(COMMONMISC)$/{$(PRODUCTLIST)}$/{openoffice printeradmin}.sh : ../productversion.mk
232cdf0e10cSrcweir$(COMMONMISC)$/{$(PRODUCTLIST)}$/{openoffice printeradmin}.sh : $$(@:f)
233cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
234cdf0e10cSrcweir	@cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(@:d:d:f))/g" > $@.$(INPATH)
235cdf0e10cSrcweir	@mv -f $@.$(INPATH) $@
236cdf0e10cSrcweir
237cdf0e10cSrcweir#
238cdf0e10cSrcweir# Launcher list
239cdf0e10cSrcweir#
240cdf0e10cSrcweir
241cdf0e10cSrcweir$(COMMONMISC)$/{$(PRODUCTLIST)}$/launcherlist : $(LAUNCHERDEPN)
242cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
243cdf0e10cSrcweir	@echo "{$(LAUNCHERLIST:s/qstart//)}.desktop" >$@.$(INPATH)
244cdf0e10cSrcweir	@mv -f $@.$(INPATH) $@
245cdf0e10cSrcweir
246cdf0e10cSrcweir#
247cdf0e10cSrcweir# Flagfile
248cdf0e10cSrcweir#
249cdf0e10cSrcweir$(COMMONMISC)$/{$(PRODUCTLIST)}$/build.flag : $(ICONDEPN) \
250cdf0e10cSrcweir	$(COMMONMISC)$/{$(PRODUCTLIST)}$/launcherlist \
251cdf0e10cSrcweir	$(COMMONMISC)$/{$(PRODUCTLIST)}$/mimelnklist \
252cdf0e10cSrcweir	$(COMMONMISC)$/{$(PRODUCTLIST)}$/create_tree.sh \
253cdf0e10cSrcweir	$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.keys \
254cdf0e10cSrcweir	$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.mime \
255cdf0e10cSrcweir	$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.org.xml	\
256cdf0e10cSrcweir	$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.applications \
257cdf0e10cSrcweir	$(COMMONMISC)$/{$(PRODUCTLIST)}$/{openoffice printeradmin}.sh
258cdf0e10cSrcweir	@touch $@
259cdf0e10cSrcweir
260