#
# spec file for package SUNWfirefox
#
# includes module(s): firefox
#
# Copyright 2007 Sun Microsystems, Inc.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Owner:davelam
#
# DO NOT REMOVE NEXT LINE
# PACKAGE NOT ARC REVIEWED BY SUN JDS TEAM
#
%include Solaris.inc
# use --without-apoc-adapter to disable building apoc adapter
# default: build apoc adapter
%define with_apoc_adapter %{?!_without_apoc_adapter:1}%{?_without_apoc_adapter:0}
%use firefox = firefox.spec
#####################################
## Package Information Section ##
#####################################
%if %option_with_ff3
# Build as Firefox2 only if "--with-ff3" is NOT specified
# =======================================================
Name: SUNWfirefox2
SUNW_Copyright:SUNWfirefox.copyright
%else
Name: SUNWfirefox
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:%{name}.copyright
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#####################################
## Package Requirements Section ##
#####################################
%include default-depend.inc
Requires: SUNWjdsrm
Requires: SUNWj5rt
Requires: SUNWgnome-base-libs
Requires: SUNWdtbas
Requires: SUNWfontconfig
Requires: SUNWfreetype2
Requires: SUNWgnome-config
Requires: SUNWgnome-libs
Requires: SUNWgnome-vfs
Requires: SUNWlibC
Requires: SUNWlibms
Requires: SUNWpr
Requires: SUNWtls
Requires: SUNWlibmsr
BuildRequires: SUNWzip
BuildRequires: SUNWgtar
BuildRequires: SUNWgnome-config-devel
BuildRequires: SUNWgnome-libs-devel
BuildRequires: SUNWgnome-vfs-devel
BuildRequires: SUNWgnome-component-devel
BuildRequires: SUNWgnome-base-libs-devel
Requires: SUNWpostrun
%if %option_with_indiana_branding
Requires: SUNWgetting-started-guide
%endif
#####################################
## Package Description Section ##
#####################################
%package devel
Summary: %{summary} - development files
SUNW_BaseDir: %{_basedir}
%include default-depend.inc
Requires: SUNWfirefox
%if %with_apoc_adapter
%package apoc-adapter
Summary: %{summary} - Apoc Adapter
SUNW_BaseDir: %{_basedir}
%include default-depend.inc
Requires: SUNWfirefox
%endif
%package root
Summary: %{summary} - / filesystem
SUNW_BaseDir: /
%include default-depend.inc
Requires: SUNWfirefox
#####################################
## Package Preparation Section ##
#####################################
%prep
rm -rf %name-%version
mkdir -p %name-%version
%firefox.prep -d %name-%version
cd %{_builddir}/%name-%version
gzcat %SOURCE0 | tar xf -
#####################################
## Package Build Section ##
#####################################
%build
export PKG_CONFIG_PATH=${_libdir}/pkgconfig:%{_pkg_config_path}
export LDFLAGS="-z ignore -L%{_libdir} -L/usr/sfw/lib -R'\$\$ORIGIN:\$\$ORIGIN/..' -R%{_libdir}/mps"
export CFLAGS="-xlibmil -I/usr/X11/include"
export CXXFLAGS="-norunpath -xlibmil -xlibmopt -features=tmplife -lCrun -lCstd"
%ifarch sparc
export CFLAGS="$CFLAGS -xO5"
export CXXFLAGS="$CXXFLAGS -xO5"
%else
export CFLAGS="$CFLAGS -xO3"
export CXXFLAGS="$CXXFLAGS -xO3"
%endif
%if %option_with_fox
export CFLAGS="$CFLAGS -I/usr/X11/include"
%endif
%firefox.build -d %name-%version
%install
%firefox.install -d %name-%version
%if %with_apoc_adapter
# creat file list for SUNWfirefox to separate
# libmozapoc.so which is delivered by SUNWfirefox-apoc-adapter
cd $RPM_BUILD_ROOT%{_libdir}
find firefox ! -type d | grep -v "libmozapoc.so" | \
sed -e 's#{#\\{#g' -e 's#}#\\}#g' -e 's#^.*$#%{_libdir}/&#' \
> %{_builddir}/%name-%version/%{name}.list
# deliver file .autoreg for triggerring Firefox auto-registration
# right after apoc adapter removal(see bug CR#6521792)
touch $RPM_BUILD_ROOT%{_libdir}/firefox/.autoreg
%endif
rm -rf $RPM_BUILD_ROOT%{_mandir}
cd %{_builddir}/%name-%version/sun-manpages
make install DESTDIR=$RPM_BUILD_ROOT
%{?pkgbuild_postprocess: %pkgbuild_postprocess -v -c "%{version}:%{jds_version}:%{name}:$RPM_ARCH:%(date +%%Y-%%m-%%d):%{support_level}" $RPM_BUILD_ROOT}
%clean
rm -rf $RPM_BUILD_ROOT
#########################################
## Package Post[Un] Install Section ##
#########################################
%post
( echo 'test -x /usr/bin/update-desktop-database || exit 0';
echo '/usr/bin/update-desktop-database'
) | $BASEDIR/lib/postrun -b -u -c JDS_wait
%postun
test -x $BASEDIR/lib/postrun || exit 0
( echo 'test -x /usr/bin/update-desktop-database || exit 0';
echo '/usr/bin/update-desktop-database'
) | $BASEDIR/lib/postrun -b -u -c JDS
%if %with_apoc_adapter
%post apoc-adapter
PKGCOND=/usr/bin/pkgcond
test -x $PKGCOND || exit 0
if $PKGCOND is_path_writable $BASEDIR/lib/firefox > /dev/null 2>&1 ; then
touch $BASEDIR/lib/firefox/.autoreg
fi
exit 0
%postun apoc-adapter
PKGCOND=/usr/bin/pkgcond
test -x $PKGCOND || exit 0
if $PKGCOND is_path_writable $BASEDIR/lib/firefox > /dev/null 2>&1 ; then
touch $BASEDIR/lib/firefox/.autoreg
fi
exit 0
%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 StarOffice/StarSuite
SO_MIMETYP_ENTRY="%{so_mimetyp_entry}"
# mailcap list for StarOffice/StarSuite
SO_MAILCAP_ENTRY="%{so_mailcap_entry}"
# Add StarOffice/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 StarOffice/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
%else
%files
%endif
%defattr(-, root, bin)
%dir %attr (0755, root, bin) %{_bindir}
%{_bindir}/firefox
%dir %attr (0755, root, bin) %{_libdir}
%if %with_apoc_adapter
%ghost %{_libdir}/firefox/.autoreg
%else
%{_libdir}/firefox
%endif
%dir %attr (0755, root, sys) %{_datadir}
%dir %attr (0755, root, other) %{_datadir}/applications
%{_datadir}/applications/firefox.desktop
%dir %attr (0755, root, other) %{_datadir}/pixmaps
%{_datadir}/pixmaps/firefox-icon.png
%dir %attr (0755, root, bin) %{_mandir}
%dir %attr (0755, root, bin) %{_mandir}/man1
%{_mandir}/man1/*
%files devel
%defattr(-, root, bin)
%dir %attr (0755, root, bin) %{_includedir}
%{_includedir}/firefox
%dir %attr (0755, root, bin) %{_libdir}
%dir %attr (0755, root, other) %{_libdir}/pkgconfig
%{_libdir}/pkgconfig/*
%dir %attr (0755, root, bin) %{_bindir}
%{_bindir}/firefox-config
%dir %attr (0755, root, sys) %{_datadir}
%{_datadir}/idl/*
%if %with_apoc_adapter
%files apoc-adapter
%defattr(-, root, bin)
%dir %attr (0755, root, bin) %{_libdir}
%{_libdir}/firefox/components/libmozapoc.so
%endif
%files root
# no file/dir delivered in this package
# endif for "if %option_with_ff3 else"
%endif
%changelog
* Tue Jun 03 2008 - [email protected]
- remove dependency SUNWsolaris-devel-docs per CR6700877
* Thu May 22 2008 - [email protected]
- change to build nothing when "--with-ff3" is specified, otherwisze build as firefox2
* Thu Mar 13 2008 - [email protected]
- Add -I/usr/X11/include to CFLAGS after update of SUNWwinc.
* Wed Jan 09 2008 - [email protected]
- roll back to FF 2
* Fri Dec 28 2007 - [email protected]
- deliver .autoreg no matter apoc enabled or not
* Thu Dec 27 2007 - [email protected]
- move to 3.0 beta2
- set not building apoc adapter as default
- remove SUNWfirefox-root pkg
- disable apoc adapter since it's not available for 3.0
* Thu Dec 27 2007 - [email protected]
- set no apoc-adapter as default
* Sat Oct 20 2007 - [email protected]
- add indiana getting started guide dependency
* Fri Oct 12 2007 - [email protected]
- add /usr/X11/include to CFLAGS if built with FOX
* Fri Sep 28 2007 - [email protected]
- delete Nevada X deps
- disable developer guide dep if sun branding is not requested
* Tue Aug 21 2007 - [email protected]
- made postremove/postinstall script more robust(CR#6594606)
* Tue Apr 24 2007 - [email protected]
- s/0755/-/ in defattr so that files are not made all executable
* Tue Apr 10 2007 - [email protected]
- remove dependency on SUNWstaroffice-menuintegration from SUNWfirefox-root
since it caused CR#6530982 fixed failed(see details in bugster)
* 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
SUNWfirefox-apoc-adapter
part2: add patch firefox-12-regenerate-compreg-file.diff
* Thu Dec 28 2006 - [email protected]
- remove %preun to fix bug CR#6502253
* Fri Dec 8 2006 - [email protected]
- add SUNWsolaris-devel-docs dependency
* Tue Nov 28 2006 - [email protected]
- add %if %with_apoc_adapter to conditinoally disable apoc adapter,
default: enable apoc adapter, use --without-apoc-adapter to disable it
* Mon Nov 27 - [email protected]
- enable apoc adapter(SUNWfirefox-apoc-adapter), CR#6478680
* Tue Sep 05 2006 - [email protected]
- New Manpage tarball
* Thu Jul 27 2006 - [email protected]
- Remove 'aclocal' dir from %files as it is now empty.
* Fri Jul 14 2006 - [email protected]
- update %post/%postun/etc scripts to support diskless client setup,
part of 6448317
* Thu Jul 13 2006 - [email protected]
- add "-lCrun -lCstd" in CXXFLAGS to improve the startup performance
* Thu Jun 29 2006 - [email protected]
- update postrun scripts
* Tue Jun 20 2006 - [email protected]
- Add SUNWpr and SUNWtls dependencies after check-deps.pl run.
* Mon Jun 12 2006 - [email protected]
- changed to let firefox use nss,nspr in /usr/lib/mps required by ARC
- remove -R%{_libdir}
* Sun Jun 11 2006 - [email protected]
- change group from other to bin/sys
* Fri Jun 09 2006 - [email protected]
- Uncomment man page lines in %files.
* Thu Jun 08 2006 - [email protected]
- add man page prepared by Leon Sha
* Thu Apr 13 2006 - [email protected]
- changed installation location from "/usr/sfw/lib" to "/usr/lib"
* Fri Feb 24 2006 - [email protected]
- Changed package category to FIREFOX
- Improved preremove script, using ${BASEDIR} instead of absolute path
* Mon Feb 20 2006 - [email protected]
- Update Build/Requires after running check-deps.pl script.
* Thu Jan 19 2006 - [email protected]
- Add BuildRequires SUNWgnome-base-libs-devel.
* Sat Dec 3 2005 - [email protected]
- add %post script that runs update-desktop-database
* Fri Dec 02 2005 - [email protected]
- Add .autoreg file introduced in 1.5.
* Mon Oct 31 2005 - [email protected]
- Merge share pkgs into base
* Mon Oct 24 2005 - [email protected]
- Add BuildRequires SUNWgtar because source tarball needs GNU tar.
* Mon Sep 26 2005 - [email protected]
- Change version same with linux verion.
* Fri Sep 02 2005 - [email protected]
- Correct ownership of %{_libdir}/pkgconfig directory.
* Fri Aug 26 2005 - [email protected]
- initial version of the spec file created