1*cdf0e10cSrcweirif [ "$1" = install ] 2*cdf0e10cSrcweirthen 3*cdf0e10cSrcweir# backing out existing entries to avoid duplicates 4*cdf0e10cSrcweirsed ' 5*cdf0e10cSrcweir/^# OpenOffice.org/d 6*cdf0e10cSrcweir/^application\/vnd\.oasis\.opendocument/d 7*cdf0e10cSrcweir/^application\/vnd\.openofficeorg/d 8*cdf0e10cSrcweir/^application\/vnd\.sun/d 9*cdf0e10cSrcweir/^application\/vnd\.stardivision/d 10*cdf0e10cSrcweir/^application\/vnd\.ms-word/d 11*cdf0e10cSrcweir/^application\/vnd\.ms-excel/d 12*cdf0e10cSrcweir/^application\/vnd\.ms-powerpoint/d 13*cdf0e10cSrcweir/^application\/x-star/d 14*cdf0e10cSrcweir/excel/d 15*cdf0e10cSrcweir/ms[-]*word/d 16*cdf0e10cSrcweir/powerpoint/d 17*cdf0e10cSrcweir' ${PKG_INSTALL_ROOT}/etc/mailcap 2>/dev/null 18*cdf0e10cSrcweir 19*cdf0e10cSrcweir# now append our stuff to the temporary file 20*cdf0e10cSrcweircat << END 21*cdf0e10cSrcweir# OpenOffice.org 22*cdf0e10cSrcweirapplication/vnd.oasis.opendocument.text; %PREFIX -view %s 23*cdf0e10cSrcweirapplication/vnd.oasis.opendocument.text-template; %PREFIX -view %s 24*cdf0e10cSrcweirapplication/vnd.oasis.opendocument.text-web; %PREFIX -view %s 25*cdf0e10cSrcweirapplication/vnd.oasis.opendocument.text-master; %PREFIX -view %s 26*cdf0e10cSrcweirapplication/vnd.sun.xml.writer; %PREFIX -view %s 27*cdf0e10cSrcweirapplication/vnd.sun.xml.writer.template; %PREFIX -view %s 28*cdf0e10cSrcweirapplication/vnd.sun.xml.writer.global; %PREFIX -view %s 29*cdf0e10cSrcweirapplication/vnd.stardivision.writer; %PREFIX -view %s 30*cdf0e10cSrcweirapplication/vnd.stardivision.writer-global; %PREFIX -view %s 31*cdf0e10cSrcweirapplication/x-starwriter; %PREFIX -view %s 32*cdf0e10cSrcweirapplication/vnd.oasis.opendocument.formula; %PREFIX -view %s 33*cdf0e10cSrcweirapplication/vnd.sun.xml.math; %PREFIX -view %s 34*cdf0e10cSrcweirapplication/vnd.stardivision.math; %PREFIX -view %s 35*cdf0e10cSrcweirapplication/x-starmath; %PREFIX -view %s 36*cdf0e10cSrcweirapplication/msword; %PREFIX -view %s 37*cdf0e10cSrcweirapplication/vnd.oasis.opendocument.spreadsheet; %PREFIX -view %s 38*cdf0e10cSrcweirapplication/vnd.oasis.opendocument.spreadsheet-template; %PREFIX -view %s 39*cdf0e10cSrcweirapplication/vnd.sun.xml.calc; %PREFIX -view %s 40*cdf0e10cSrcweirapplication/vnd.sun.xml.calc.template; %PREFIX -view %s 41*cdf0e10cSrcweirapplication/vnd.stardivision.calc; %PREFIX -view %s 42*cdf0e10cSrcweirapplication/x-starcalc; %PREFIX -view %s 43*cdf0e10cSrcweirapplication/vnd.stardivision.chart; %PREFIX -view %s 44*cdf0e10cSrcweirapplication/x-starchart; %PREFIX -view %s 45*cdf0e10cSrcweirapplication/excel; %PREFIX -view %s 46*cdf0e10cSrcweirapplication/msexcel; %PREFIX -view %s 47*cdf0e10cSrcweirapplication/vnd.ms-excel; %PREFIX -view %s 48*cdf0e10cSrcweirapplication/x-msexcel; %PREFIX -view %s 49*cdf0e10cSrcweirapplication/vnd.oasis.opendocument.presentation; %PREFIX -view %s 50*cdf0e10cSrcweirapplication/vnd.oasis.opendocument.presentation-template; %PREFIX -view %s 51*cdf0e10cSrcweirapplication/vnd.sun.xml.impress; %PREFIX -view %s 52*cdf0e10cSrcweirapplication/vnd.sun.xml.impress.template; %PREFIX -view %s 53*cdf0e10cSrcweirapplication/vnd.stardivision.impress; %PREFIX -view %s 54*cdf0e10cSrcweirapplication/x-starimpress; %PREFIX -view %s 55*cdf0e10cSrcweirapplication/powerpoint; %PREFIX -view %s 56*cdf0e10cSrcweirapplication/mspowerpoint; %PREFIX -view %s 57*cdf0e10cSrcweirapplication/vnd.ms-powerpoint; %PREFIX -view %s 58*cdf0e10cSrcweirapplication/x-mspowerpoint; %PREFIX -view %s 59*cdf0e10cSrcweirapplication/vnd.oasis.opendocument.graphics; %PREFIX -view %s 60*cdf0e10cSrcweirapplication/vnd.oasis.opendocument.graphics-template; %PREFIX -view %s 61*cdf0e10cSrcweirapplication/vnd.sun.xml.draw; %PREFIX -view %s 62*cdf0e10cSrcweirapplication/vnd.sun.xml.draw.template; %PREFIX -view %s 63*cdf0e10cSrcweirapplication/vnd.stardivision.draw; %PREFIX -view %s 64*cdf0e10cSrcweirapplication/x-stardraw; %PREFIX -view %s 65*cdf0e10cSrcweirapplication/vnd.sun.xml.base; %PREFIX -view %s 66*cdf0e10cSrcweirapplication/vnd.oasis.opendocument.database; %PREFIX -view %s 67*cdf0e10cSrcweirapplication/vnd.writerperfect; %PREFIX -view %s 68*cdf0e10cSrcweirapplication/wordperfect5.1; %PREFIX -view %s 69*cdf0e10cSrcweirapplication/x-wordperfect; %PREFIX -view %s 70*cdf0e10cSrcweirapplication/wordperfect; %PREFIX -view %s 71*cdf0e10cSrcweirapplication/wpwin; %PREFIX -view %s 72*cdf0e10cSrcweirapplication/vnd.openofficeorg.extension; %PREFIX %s 73*cdf0e10cSrcweirEND 74*cdf0e10cSrcweirelse 75*cdf0e10cSrcweir# backing all entries pointing to our binary 76*cdf0e10cSrcweirsed '/%PREFIX/d' ${PKG_INSTALL_ROOT}/etc/mailcap 2>/dev/null 77*cdf0e10cSrcweirfi 78*cdf0e10cSrcweir 79