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