aboutsummaryrefslogtreecommitdiffstats
path: root/www/firefox36
diff options
context:
space:
mode:
authormarcus <marcus@FreeBSD.org>2005-02-26 17:32:01 +0800
committermarcus <marcus@FreeBSD.org>2005-02-26 17:32:01 +0800
commitcd91a258a3250f3b82433bd7686870a7e552ebdb (patch)
treefadb3b19045f5b23cf9c6262b4e96abc4a5b4689 /www/firefox36
parent7ba030ebaf1ef28f7d929df324888dc32fe191f0 (diff)
downloadfreebsd-ports-gnome-cd91a258a3250f3b82433bd7686870a7e552ebdb.tar.gz
freebsd-ports-gnome-cd91a258a3250f3b82433bd7686870a7e552ebdb.tar.zst
freebsd-ports-gnome-cd91a258a3250f3b82433bd7686870a7e552ebdb.zip
Add a Mozilla Mozilla Plugable Init Script (PIS) to handle automatically
sanitizing each users' home directory when starting Firefox. This should make upgrades much more painless. PR: 75816 Submitted by: Jose M Rodriguez (freebsd) <josemi@freebsd.jazztel.es>
Diffstat (limited to 'www/firefox36')
-rw-r--r--www/firefox36/Makefile17
-rw-r--r--www/firefox36/files/moz_pis_S50cleanhome31
2 files changed, 47 insertions, 1 deletions
diff --git a/www/firefox36/Makefile b/www/firefox36/Makefile
index 80a16ca84089..45a01ff1003a 100644
--- a/www/firefox36/Makefile
+++ b/www/firefox36/Makefile
@@ -7,6 +7,7 @@
PORTNAME= firefox
PORTVERSION= 1.0.1
+PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_MOZILLA}
@@ -61,7 +62,10 @@ JPI_LIST?=\
${LOCALBASE}/diablo-jdk1.3.1/jre/plugin/${ARCH}/ns600/libjavaplugin_oji.so \
${LOCALBASE}/jdk1.3.1/jre/plugin/${ARCH}/ns600/libjavaplugin_oji.so
-SYSTEM_PREFS= ${FAKEDIR}/lib/${FIREFOX}-${FF_VER}/defaults/pref/firefox.js
+SYSTEM_PREFS= ${FAKEDIR}/lib/${FIREFOX}-${FF_VER}/defaults/pref/firefox.js
+SCRIPTS_DIR= ${FAKEDIR}/lib/${FIREFOX}-${FF_VER}
+MOZ_PIS_SCRIPTS= S50cleanhome
+MOZ_PIS_DIR= ${SCRIPTS_DIR}/init.d
OPTIONS= DEBUG "Build a debugging image" off \
LOGGING "Enable additional log messages" off \
@@ -145,6 +149,12 @@ post-patch:
s|%%X11BASE%%|${X11BASE}|g' \
< ${FILESDIR}/${ii} > ${WRKDIR}/${ii}
.endfor
+.for ii in ${MOZ_PIS_SCRIPTS}
+ @${SED} -e 's|%%MOZILLA%%|${FIREFOX}|g ; \
+ s|%%PREFIX%%|${PREFIX}|g ; \
+ s|%%X11BASE%%|${X11BASE}|g' \
+ < ${FILESDIR}/moz_pis_${ii} > ${WRKDIR}/moz_pis_${ii}
+.endfor
@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \
${WRKSRC}/build/unix/run-mozilla.sh
@${REINPLACE_CMD} -e 's|-lc_r|${PTHREAD_LIBS}|g ; \
@@ -177,6 +187,8 @@ pre-install:
@${RM} -rf ${FAKEDIR} ${PLIST}
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} \
Makefile ${MAKE_ARGS} install
+ @${MKDIR} ${SCRIPTS_DIR}
+ @${MKDIR} ${MOZ_PIS_DIR}
${ECHO_CMD} 'share/gnome/pixmaps/${FIREFOX_ICON}' >> ${PLIST}
${ECHO_CMD} 'share/gnome/applications/firefox.desktop' >> ${PLIST}
${REINPLACE_CMD} -e 's|${FAKEDIR}|${PREFIX}|g; \
@@ -188,6 +200,9 @@ pre-install:
done
${ECHO_CMD} bin/firefox >> ${PLIST}
${ECHO_CMD} bin/firefox-config >> ${PLIST}
+.for ii in ${MOZ_PIS_SCRIPTS}
+ ${INSTALL_SCRIPT} ${WRKDIR}/moz_pis_${ii} ${MOZ_PIS_DIR}/${ii}
+.endfor
.if !defined(WITHOUT_NEWTAB)
${ECHO_CMD} >> ${SYSTEM_PREFS}
${ECHO_CMD} "// Open external links in new tab" >> ${SYSTEM_PREFS}
diff --git a/www/firefox36/files/moz_pis_S50cleanhome b/www/firefox36/files/moz_pis_S50cleanhome
new file mode 100644
index 000000000000..3de5565e39f2
--- /dev/null
+++ b/www/firefox36/files/moz_pis_S50cleanhome
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+
+# S50cleanhome
+# a script to clean up users' Mozilla home directories to make upgrading
+# less painful.
+
+# We run in our own subshell
+
+# First, verify protocol
+[ "$1" != "start" ] && exit 1
+[ -z "${MOZ_PIS_API}" -o ${MOZ_PIS_API} -ne 2 ] && exit 1
+[ -z "${MOZ_PIS_MOZBINDIR}" -o ! -d "${MOZ_PIS_MOZBINDIR}" ] && exit 1
+[ -z "${HOME}" -o ! -d "${HOME}" ] && exit 1
+[ -z "${MOZ_PIS_USER_DIR}" -o ! -d "${HOME}/${MOZ_PIS_USER_DIR}" ] && exit 1
+
+# Try to cleanup ${HOME}/${MOZ_PIS_USER_DIR}
+
+if [ -f "${HOME}/${MOZ_PIS_USER_DIR}/profiles.ini" ]; then
+ sed -e '/Path=/! d' -e "s,Path=,${HOME}/${MOZ_PIS_USER_DIR}/," \
+ "${HOME}/${MOZ_PIS_USER_DIR}/profiles.ini" \
+ | while read dir
+ do
+ [ ! -d "${dir}" ] && continue
+ # Debian does this for new builds
+ # rm -f "${dir}/XUL.mfasl"
+ # force a rebuild of compreg.dat and xpti.dat for new installations
+ [ "${dir}/compreg.dat" -ot "${MOZ_PIS_MOZBINDIR}/components.ini" ] &&
+ rm -f "${dir}/compatibility.ini" "${dir}/XUL.mfasl"
+ done
+fi