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 if [ "$1" = install ] 22 then 23 # backing out existing entries to avoid duplicates 24 sed ' 25 /^# OpenOffice.org/d 26 /^application\/vnd\.oasis\.opendocument/d 27 /^application\/vnd\.openofficeorg/d 28 /^application\/vnd\.sun/d 29 /^application\/vnd\.stardivision/d 30 /^application\/vnd\.ms-word/d 31 /^application\/vnd\.ms-excel/d 32 /^application\/vnd\.ms-powerpoint/d 33 /^application\/x-star/d 34 /excel/d 35 /ms[-]*word/d 36 /powerpoint/d 37 ' ${PKG_INSTALL_ROOT}/etc/mailcap 2>/dev/null 38 39 # now append our stuff to the temporary file 40 cat << END 41 # Apache OpenOffice 42 application/vnd.oasis.opendocument.text; %PREFIX -view %s 43 application/vnd.oasis.opendocument.text-template; %PREFIX -view %s 44 application/vnd.oasis.opendocument.text-web; %PREFIX -view %s 45 application/vnd.oasis.opendocument.text-master; %PREFIX -view %s 46 application/vnd.sun.xml.writer; %PREFIX -view %s 47 application/vnd.sun.xml.writer.template; %PREFIX -view %s 48 application/vnd.sun.xml.writer.global; %PREFIX -view %s 49 application/vnd.stardivision.writer; %PREFIX -view %s 50 application/vnd.stardivision.writer-global; %PREFIX -view %s 51 application/x-starwriter; %PREFIX -view %s 52 application/vnd.oasis.opendocument.formula; %PREFIX -view %s 53 application/vnd.sun.xml.math; %PREFIX -view %s 54 application/vnd.stardivision.math; %PREFIX -view %s 55 application/x-starmath; %PREFIX -view %s 56 application/msword; %PREFIX -view %s 57 application/vnd.oasis.opendocument.spreadsheet; %PREFIX -view %s 58 application/vnd.oasis.opendocument.spreadsheet-template; %PREFIX -view %s 59 application/vnd.sun.xml.calc; %PREFIX -view %s 60 application/vnd.sun.xml.calc.template; %PREFIX -view %s 61 application/vnd.stardivision.calc; %PREFIX -view %s 62 application/x-starcalc; %PREFIX -view %s 63 application/vnd.stardivision.chart; %PREFIX -view %s 64 application/x-starchart; %PREFIX -view %s 65 application/excel; %PREFIX -view %s 66 application/msexcel; %PREFIX -view %s 67 application/vnd.ms-excel; %PREFIX -view %s 68 application/x-msexcel; %PREFIX -view %s 69 application/vnd.oasis.opendocument.presentation; %PREFIX -view %s 70 application/vnd.oasis.opendocument.presentation-template; %PREFIX -view %s 71 application/vnd.sun.xml.impress; %PREFIX -view %s 72 application/vnd.sun.xml.impress.template; %PREFIX -view %s 73 application/vnd.stardivision.impress; %PREFIX -view %s 74 application/x-starimpress; %PREFIX -view %s 75 application/powerpoint; %PREFIX -view %s 76 application/mspowerpoint; %PREFIX -view %s 77 application/vnd.ms-powerpoint; %PREFIX -view %s 78 application/x-mspowerpoint; %PREFIX -view %s 79 application/vnd.oasis.opendocument.graphics; %PREFIX -view %s 80 application/vnd.oasis.opendocument.graphics-template; %PREFIX -view %s 81 application/vnd.sun.xml.draw; %PREFIX -view %s 82 application/vnd.sun.xml.draw.template; %PREFIX -view %s 83 application/vnd.stardivision.draw; %PREFIX -view %s 84 application/x-stardraw; %PREFIX -view %s 85 application/vnd.sun.xml.base; %PREFIX -view %s 86 application/vnd.oasis.opendocument.database; %PREFIX -view %s 87 application/wordperfect5.1; %PREFIX -view %s 88 application/x-wordperfect; %PREFIX -view %s 89 application/wordperfect; %PREFIX -view %s 90 application/wpwin; %PREFIX -view %s 91 application/vnd.openofficeorg.extension; %PREFIX %s 92 END 93 else 94 # backing all entries pointing to our binary 95 sed '/%PREFIX/d' ${PKG_INSTALL_ROOT}/etc/mailcap 2>/dev/null 96 fi 97 98