diff --git a/mobile/build.mk b/mobile/build.mk index ba25c884e71..f2c7def7bac 100644 --- a/mobile/build.mk +++ b/mobile/build.mk @@ -67,6 +67,9 @@ install:: @echo "Mobile can't be installed directly." @exit 1 +deb: package + @$(MAKE) -C mobile/installer deb + upload:: @$(MAKE) -C mobile/installer upload diff --git a/mobile/installer/Makefile.in b/mobile/installer/Makefile.in index 2ea66b39c67..ab68ad1d2b8 100644 --- a/mobile/installer/Makefile.in +++ b/mobile/installer/Makefile.in @@ -110,7 +110,7 @@ debian/control: $(srcdir)/debian/control.in $(LIBXUL_DIST)/bin/platform.ini mkdir -p debian $(PYTHON) $(topsrcdir)/config/Preprocessor.py \ $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $< > $@ - + debian/$(MOZ_APP_NAME).desktop: $(srcdir)/debian/$(MOZ_APP_NAME).desktop.in mkdir -p debian $(PYTHON) $(topsrcdir)/config/Preprocessor.py \ diff --git a/mobile/installer/debian/fennec.preinst.in b/mobile/installer/debian/fennec.preinst.in new file mode 100644 index 00000000000..ff14f5c0a15 --- /dev/null +++ b/mobile/installer/debian/fennec.preinst.in @@ -0,0 +1,26 @@ +#! /bin/sh + +set -e + +RUNNING=`ps -ax | grep "fennec.*/fennec" | grep -v grep | wc -l` + +if [ $RUNNING -gt 0 ]; +then + dbus-send --system --type=method_call --dest=mozilla.fennec /mozilla/fennec/request mozilla.fennec.quit + x=0 + while [ $x -lt 10 ] + do + sleep 1 + RUNNING=`ps -ax | grep "fennec.*/fennec" | grep -v grep | wc -l` + + if [ $RUNNING -eq 0 ]; + then + break + fi + + x=`expr $x + 1` + done + + pkill -9 fennec + sleep 1 +fi diff --git a/mobile/installer/debian/fennec.prerm.in b/mobile/installer/debian/fennec.prerm.in new file mode 100644 index 00000000000..ff14f5c0a15 --- /dev/null +++ b/mobile/installer/debian/fennec.prerm.in @@ -0,0 +1,26 @@ +#! /bin/sh + +set -e + +RUNNING=`ps -ax | grep "fennec.*/fennec" | grep -v grep | wc -l` + +if [ $RUNNING -gt 0 ]; +then + dbus-send --system --type=method_call --dest=mozilla.fennec /mozilla/fennec/request mozilla.fennec.quit + x=0 + while [ $x -lt 10 ] + do + sleep 1 + RUNNING=`ps -ax | grep "fennec.*/fennec" | grep -v grep | wc -l` + + if [ $RUNNING -eq 0 ]; + then + break + fi + + x=`expr $x + 1` + done + + pkill -9 fennec + sleep 1 +fi diff --git a/mobile/makefiles.sh b/mobile/makefiles.sh index b00677bdf0f..3ee7c5d7300 100644 --- a/mobile/makefiles.sh +++ b/mobile/makefiles.sh @@ -58,4 +58,6 @@ mobile/installer/debian/changelog mobile/installer/debian/compat mobile/installer/debian/files mobile/installer/debian/menu +mobile/installer/debian/fennec.preinst +mobile/installer/debian/fennec.prerm mobile/installer/debian/fennec.postinst"