-sed -i -e "s!_FIREFOX_BUILD_DIR_!${FIREFOX_BUILD_DIR}!g" .mozconfig
-
-make -f client.mk build
-make -f client.mk install
-
-# Many applications look for netscape when they need to open a browser...
-ln -v -sf firefox /usr/bin/netscape
-
-# Remove old links
-rm -f /usr/lib/mozilla
-rm -f /usr/lib/firefox
-rm -f /usr/lib/${FIREFOX_PKG_VERSION}/plugins/libjavaplugin_oji.so
-
-ln -v -sf ${FIREFOX_PKG_VERSION} /usr/lib/mozilla
-ln -v -sf ${FIREFOX_PKG_VERSION} /usr/lib/firefox
-# To use the installed Java plugin.
-ln -v -s ${JAVA_HOME}/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/${FIREFOX_PKG_VERSION}/plugins
-
-# Addition to /etc/ld.so.conf
-# This is necessary for shared library libmozjs.so (needed by gxine)
-string_add "/usr/lib/${FIREFOX_PKG_VERSION}" /etc/ld.so.conf
-
-ldconfig
-
-exit $?
+ if [ "x${HVLABEL}" = "x${FIREFOX}-browser" ]; then
+ # Point to the xulrunner libraries.
+ echo "ac_add_options --with-system-libxul" >> .mozconfig
+ echo "ac_add_options --with-libxul-sdk=/usr/lib/xulrunner-devel-${XULRUNNER_VER}" >> .mozconfig
+
+ # This option causes the installed binaries to have the official
+ # Firefox name embedded in them.
+ echo "ac_add_options --enable-official-branding" >> .mozconfig
+ fi
+
+ sed -i -e "s!_FIREFOX_BUILD_DIR_!${FIREFOX_BUILD_DIR}!g" .mozconfig
+ if [ -z "${WIFI_SUPPORT}" ]; then
+ echo "ac_add_options --disable-necko-wifi" >> .mozconfig
+ fi
+
+ make -f client.mk build
+ make -f client.mk install
+
+ if [ "x${HVLABEL}" = "x${FIREFOX}-xulrunner" ]; then
+ install -v -m755 -d /usr/lib/mozilla
+ # Remove old links (if applicable) and create new ones
+ rm -f /usr/lib/mozilla/plugins
+ ln -sv /usr/lib/xulrunner-${XULRUNNER_VER}/plugins /usr/lib/mozilla
+ chown -Rv root:root /usr/lib/xulrunner-* \
+ /usr/share/idl/xulrunner-* \
+ /usr/include/xulrunner-*
+ else
+ chown -R -v root:root /usr/share/idl/${FIREFOX_PKG_VERSION} \
+ /usr/include/${FIREFOX_PKG_VERSION} \
+ /usr/lib/firefox-devel-${FIREFOX_VERSION}/sdk/lib
+ fi
+}