add new package SUNWfirefox-root to fix bug CR#6530982, the package would just add staroffice entries in /etc/mime.types /etc/mailcap in postinstall
--- a/ChangeLog Sun Mar 25 13:43:40 2007 +0000
+++ b/ChangeLog Mon Mar 26 02:53:13 2007 +0000
@@ -1,3 +1,13 @@
+2007-03-26 Dave Lin <[email protected]>
+
+ * SUNWfirefox.spec:
+ * ext-sources/staroffice-mailcap.in: Added.
+ * ext-sources/staroffice-mime.types.in: Added. All the changes
+ above is to fix bug CR#6530982, the fix is that we add
+ staroffice entries in /etc/mailcap and /etc/mime.types in
+ postinstall script of SUNWfirefox-root, this solution will
+ be obsoleted in Firefox 3.0
+
2007-03-25 Wang Xin <[email protected]>
* base-specs/libnotify.spec: New.
--- a/SUNWfirefox.spec Sun Mar 25 13:43:40 2007 +0000
+++ b/SUNWfirefox.spec Mon Mar 26 02:53:13 2007 +0000
@@ -26,6 +26,10 @@
Summary: Mozilla Firefox Web browser
Version: %{firefox.version}
Source: %{name}-manpages-0.1.tar.gz
+Source1: staroffice-mime.types.in
+Source2: staroffice-mailcap.in
+%define so_mimetyp_entry %(cat %SOURCE1)
+%define so_mailcap_entry %(cat %SOURCE2)
SUNW_BaseDir: %{_basedir}
SUNW_Category: FIREFOX,application,%{jds_version}
SUNW_Copyright:firefox-copyright.txt
@@ -69,7 +73,7 @@
%package devel
Summary: %{summary} - development files
-SUNW_BaseDir: %{_basedir}
+SUNW_BaseDir: %{_basedir}
%include default-depend.inc
Requires: SUNWfirefox
@@ -81,6 +85,13 @@
Requires: SUNWfirefox
%endif
+%package root
+Summary: %{summary} - / filesystem
+SUNW_BaseDir: /
+%include default-depend.inc
+Requires: SUNWfirefox
+Requires: SUNWstaroffice-menuintegration
+
#####################################
## Package Preparation Section ##
#####################################
@@ -170,6 +181,111 @@
fi
%endif
+%post root
+#!/bin/sh
+#
+# Inherit the logic of updating mime.types and mailcap from SUNWj5cfg
+#
+umask 022
+
+SOFFICE_PATH=/usr/bin/soffice
+NS_COMMENT1="#--Netscape Communications Corporation MIME Information"
+NS_COMMENT2="#Do not delete the above line. It is used to identify the file type."
+
+MT_COMMENT="# Mime type for StarOffice and StarSuite"
+MC_COMMENT="# Mailcap entry for StarOffice and StarSuite"
+# mime type list for Startffice/StarSuite
+SO_MIMETYP_ENTRY="%{so_mimetyp_entry}"
+
+# mailcap list for Startffice/StarSuite
+SO_MAILCAP_ENTRY="%{so_mailcap_entry}"
+
+# Add Startffice/StarSuite entry to /etc/mime.types
+# Add entry only if it does not exist
+####################################################
+UpdateMimeTypes () {
+ MIMETYP_FILE=$1
+ MT_TEXT=""
+
+ # Create the file if it does not exist
+ if [ ! -f ${MIMETYP_FILE} ]; then
+ echo "${NS_COMMENT1}" >> ${MIMETYP_FILE}
+ echo "${NS_COMMENT2}" >> ${MIMETYP_FILE}
+ fi
+
+ grep "${MT_COMMENT}" ${MIMETYP_FILE} >/dev/null 2>&1
+ test $? -ne 0 && \
+ MT_TEXT="${MT_COMMENT}\n"
+
+ IFS="
+"
+ # Add entry if it does not exist
+ for ent in ${SO_MIMETYP_ENTRY}; do
+ grep "${ent}" ${MIMETYP_FILE} >/dev/null 2>&1
+ test $? -ne 0 && \
+ MT_TEXT="${MT_TEXT}${ent}\n"
+ done
+ test -n "${MT_TEXT}" && \
+ echo "${MT_TEXT}" >> ${MIMETYP_FILE}
+}
+# End of UpdateMimeTypes
+
+# Add Startffice/StarSuite entry to /etc/mailcap
+# Add entry anyway, would overwrite the older one
+####################################################
+UpdateMailcap () {
+ MAILCAP_FILE=$1
+ MC_TEXT=""
+
+ IFS="
+"
+ if [ -r ${MAILCAP_FILE} ]; then
+ # Remove existing entry, if present
+ MC_TEXT=`grep -v "${MC_COMMENT}" ${MAILCAP_FILE}`
+ for ent in ${SO_MAILCAP_ENTRY}; do
+ test -n "${MC_TEXT}" && \
+ MC_TEXT=`echo "${MC_TEXT}" | grep -v "${ent}"` || \
+ break
+ done
+ fi
+ MC_TEXT="${MC_TEXT}\n${MC_COMMENT}"
+ # Add new entry
+ for ent in ${SO_MAILCAP_ENTRY}; do
+ MC_TEXT="${MC_TEXT}\n${ent}; ${SOFFICE_PATH} %s"
+ done
+ echo "${MC_TEXT}" > ${MAILCAP_FILE}
+}
+# End of UpdateMailcap
+
+# Check the writabilty of directory - /etc
+#################################################
+CheckDirWritable () {
+ DIR=$1
+ RET_VAL=1
+
+ PKGCOND=/usr/bin/pkgcond
+ if [ -x ${PKGCOND} ]; then
+ ${PKGCOND} is_path_writable ${DIR} >/dev/null 2>&1
+ RET_VAL=$?
+ else
+ touch ${DIR}/.test.$$ >/dev/null 2>&1
+ RET_VAL=$?
+ rm -f ${DIR}/.test.$$ >/dev/null 2>&1
+ fi
+ return ${RET_VAL}
+}
+# End of CheckDirWritable
+
+# Roll it
+#################################################
+CheckDirWritable $BASEDIR/etc
+if [ $? -eq 0 ]; then
+ UpdateMailcap $BASEDIR/etc/mailcap
+ UpdateMimeTypes $BASEDIR/etc/mime.types
+fi
+
+exit 0
+
%if %with_apoc_adapter
%files -f SUNWfirefox.list
@@ -216,7 +332,14 @@
%{_libdir}/firefox/components/libmozapoc.so
%endif
+%files root
+# no file/dir delivered in this package
+
%changelog
+* Mon Mar 26 2007 - [email protected]
+- add new package SUNWfirefox-root to fix bug CR#6530982, the package
+ would just add staroffice entries in /etc/mime.types /etc/mailcap
+ in postinstall
* Tue Mar 20 2007 - [email protected]
- fix bug CR#6521792
part1: add file ".autoreg" and add postinstall/postremove scripts in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ext-sources/staroffice-mailcap.in Mon Mar 26 02:53:13 2007 +0000
@@ -0,0 +1,56 @@
+application/csv
+application/excel
+application/msexcel
+application/mspowerpoint
+application/msword
+application/rtf
+application/tab-separated-values
+application/vnd.lotus-1-2-3
+application/vnd.ms-excel
+application/vnd.ms-powerpoint
+application/vnd.ms-word
+application/vnd.oasis.opendocument.database
+application/vnd.oasis.opendocument.formula
+application/vnd.oasis.opendocument.graphics
+application/vnd.oasis.opendocument.graphics-template
+application/vnd.oasis.opendocument.presentation
+application/vnd.oasis.opendocument.presentation-template
+application/vnd.oasis.opendocument.spreadsheet
+application/vnd.oasis.opendocument.spreadsheet-template
+application/vnd.oasis.opendocument.text
+application/vnd.oasis.opendocument.text-master
+application/vnd.oasis.opendocument.text-template
+application/vnd.oasis.opendocument.text-web
+application/vnd.stardivision.calc
+application/vnd.stardivision.chart
+application/vnd.stardivision.draw
+application/vnd.stardivision.impress
+application/vnd.stardivision.math
+application/vnd.stardivision.writer
+application/vnd.sun.xml.base
+application/vnd.sun.xml.calc
+application/vnd.sun.xml.calc.template
+application/vnd.sun.xml.draw
+application/vnd.sun.xml.draw.template
+application/vnd.sun.xml.impress
+application/vnd.sun.xml.impress.template
+application/vnd.sun.xml.math
+application/vnd.sun.xml.writer
+application/vnd.sun.xml.writer.global
+application/vnd.sun.xml.writer.template
+application/vnd.wordperfect
+application/wordperfect
+application/x-123
+application/x-doc
+application/x-dos_ms_excel
+application/x-excel
+application/x-ms-excel
+application/x-msexcel
+application/x-xls
+application/xls
+text/richtext
+text/rtf
+text/spreadsheet
+text/tab-separated-values
+text/x-comma-separated-values
+zz-application/zz-winassoc-xls
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ext-sources/staroffice-mime.types.in Mon Mar 26 02:53:13 2007 +0000
@@ -0,0 +1,37 @@
+application/msword doc
+application/rtf rtf
+application/vnd.lotus-1-2-3 123 wk1 wk3 wk4 wks
+application/vnd.ms-excel xls xla xlt xlc xld
+application/vnd.ms-powerpoint ppt pps
+application/vnd.oasis.opendocument.formula odf
+application/vnd.oasis.opendocument.graphics odg
+application/vnd.oasis.opendocument.graphics-template otg
+application/vnd.oasis.opendocument.presentation odp
+application/vnd.oasis.opendocument.presentation-template otp
+application/vnd.oasis.opendocument.spreadsheet ods
+application/vnd.oasis.opendocument.spreadsheet-template ots
+application/vnd.oasis.opendocument.text odt
+application/vnd.oasis.opendocument.text-master odm
+application/vnd.oasis.opendocument.text-template ott
+application/vnd.oasis.opendocument.text-web oth
+application/vnd.stardivision.calc sdc
+application/vnd.stardivision.chart sds
+application/vnd.stardivision.draw sda
+application/vnd.stardivision.impress sdd sdp
+application/vnd.stardivision.math smf
+application/vnd.stardivision.writer sdw vor sgl
+application/vnd.sun.xml.base odb
+application/vnd.sun.xml.calc sxc
+application/vnd.sun.xml.calc.template stc
+application/vnd.sun.xml.draw sxd
+application/vnd.sun.xml.draw.template std
+application/vnd.sun.xml.impress sxi
+application/vnd.sun.xml.impress.template sti
+application/vnd.sun.xml.math sxm
+application/vnd.sun.xml.writer sxw
+application/vnd.sun.xml.writer.global sxg
+application/vnd.sun.xml.writer.template stw
+text/richtext rtx
+text/spreadsheet sylk slk
+text/tab-separated-values tsv
+text/x-comma-separated-values csv