bug 469202. preprocess files needed for debian installer in makefile. r=mfinkle
authorStuart Parmenter <stuart@mozilla.com>
Wed, 06 Jan 2010 10:37:59 -0800
changeset 65950 9e5dba07574db05c9221babc8ffb9005d547ce3a
parent 65949 0eaaa4888a39d820c359416dcb699230cb2c1d09
child 65951 a5c155941126fa91b6ba47a1758eb723ebe8e6d0
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs469202
bug 469202. preprocess files needed for debian installer in makefile. r=mfinkle
mobile/installer/Makefile.in
mobile/installer/debian/changelog.in
mobile/installer/debian/compat.in
mobile/installer/debian/fennec.postinst.in
mobile/installer/debian/fennec.preinst.in
mobile/installer/debian/fennec.prerm.in
mobile/makefiles.sh
--- a/mobile/installer/Makefile.in
+++ b/mobile/installer/Makefile.in
@@ -42,26 +42,28 @@ srcdir    = @srcdir@
 VPATH     = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 GRE_MILESTONE = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
 GRE_BUILDID = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
 ABS_OBJDIR=`cd $(DEPTH); pwd`
 BASE64_ICON = dist/branding/fennec_maemo_icon26.txt
+MOZ_DEB_TIMESTAMP = "$(shell date  +"%a, %d  %b %Y %T %z" )"
 
 DEFINES += \
 	-DGRE_MILESTONE=$(GRE_MILESTONE) \
 	-DGRE_BUILDID=$(GRE_BUILDID) \
 	-Dinstalldir=$(installdir) \
 	-DMOZ_APP_NAME=$(MOZ_APP_NAME) \
 	-DMOZ_APP_DISPLAYNAME=$(MOZ_APP_DISPLAYNAME) \
 	-DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
 	-DABS_OBJDIR=$(ABS_OBJDIR) \
 	-DBASE64_ICON=$(BASE64_ICON) \
+	-DMOZ_DEB_TIMESTAMP=$(MOZ_DEB_TIMESTAMP) \
 	$(NULL)
 
 NO_PKG_FILES = \
 	$(MOZ_APP_NAME)-config \
 	$(MOZ_APP_NAME)-bin.elf \
 	regchrome* \
 	regxpcom* \
 	xpcshell* \
@@ -106,38 +108,45 @@ ifndef SYSTEM_LIBXUL
 	@rm -rf $(LIBXUL_DIST)/xulrunner*
 	@$(MAKE) -C $(LIBXUL_DIST)/.. package || echo "Perhaps you're trying to package a prebuilt SDK. See 'https://wiki.mozilla.org/Mobile/Build/Fennec#Build' for more information."
 	@cd $(DIST)/$(MOZ_PKG_DIR); $(UNMAKE_PACKAGE)
 else
 	@echo "Using system xulrunner..."
 endif
 
 ifeq ($(OS_TARGET),Linux)
-debian/control: $(srcdir)/debian/control.in $(LIBXUL_DIST)/bin/platform.ini
-	mkdir -p debian
-	$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
-        $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $< > $@
+PP_DEB_FILES =	debian/control \
+		debian/changelog \
+		debian/$(MOZ_APP_NAME).desktop \
+		debian/$(MOZ_APP_NAME).links \
+		debian/$(MOZ_APP_NAME).service \
+		debian/compat \
+		debian/files \
+		debian/menu \
+		debian/fennec.preinst \
+		debian/fennec.prerm \
+		debian/fennec.postinst \
+		$(NULL)
 
-debian/$(MOZ_APP_NAME).desktop: $(srcdir)/debian/$(MOZ_APP_NAME).desktop.in
-	mkdir -p debian
-	$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
-        $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $< > $@
 
-debian/$(MOZ_APP_NAME).links: $(srcdir)/debian/$(MOZ_APP_NAME).links.in
-	mkdir -p debian
-	$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
-        $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $< > $@
+$(PP_DEB_FILES):
+	@$(EXIT_ON_ERROR) \
+	for f in $(PP_DEB_FILES); do \
+           src=$(srcdir)/debian/`basename $$f`.in; \
+	   echo $$src ">" $$f ;\
+           $(RM) -f $$f; \
+           mkdir -p debian;  \
+           $(PYTHON) $(topsrcdir)/config/Preprocessor.py \
+             $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $$src > $$f; \
+         done
 
-debian/$(MOZ_APP_NAME).service: $(srcdir)/debian/$(MOZ_APP_NAME).service.in
-	mkdir -p debian
-	$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
-        $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $< > $@
 
-deb: debian/control debian/$(MOZ_APP_NAME).service debian/$(MOZ_APP_NAME).links debian/$(MOZ_APP_NAME).desktop \
-	$(DIST)/branding/$(MOZ_APP_NAME)_scalable.png $(DIST)/branding/$(MOZ_APP_NAME)_26x26.png $(DIST)/branding/$(MOZ_APP_NAME)_40x40.png
+deb: $(PP_DEB_FILES) $(DIST)/branding/$(MOZ_APP_NAME)_scalable.png \
+	$(DIST)/branding/$(MOZ_APP_NAME)_26x26.png \
+	$(DIST)/branding/$(MOZ_APP_NAME)_40x40.png
 	rm -rf $(DEBDESTDIR)/$(installdir)/*
 	$(NSINSTALL) -D $(DEBDESTDIR)/$(installdir)
 	cp -pRL $(DIST)/$(MOZ_APP_NAME)/* $(DEBDESTDIR)/$(installdir)
 	rm -rf $(DEBDESTDIR)/$(installdir)/xulrunner	
 	$(NSINSTALL)  debian/$(MOZ_APP_NAME).desktop $(DEBDESTDIR)/usr/share/applications/hildon/
 	$(NSINSTALL) -D $(DEBDESTDIR)/usr/share/dbus-1/services/
 	cp debian/$(MOZ_APP_NAME).service $(DEBDESTDIR)/usr/share/dbus-1/services/org.mozilla.$(MOZ_APP_NAME).service
 	$(NSINSTALL) -D $(DEBDESTDIR)/usr/share/icons/hicolor/scalable/hildon/
--- a/mobile/installer/debian/changelog.in
+++ b/mobile/installer/debian/changelog.in
@@ -1,5 +1,6 @@
+#filter substitution
 fennec (@MOZ_APP_VERSION@)  unstable; urgency=low
 
   * Mozilla Nightly (Closes: #nnnn)  <nnnn is the bug number of your ITP>
 
  -- Mozilla Mobile  <mobile@mozilla.com>  @MOZ_DEB_TIMESTAMP@
--- a/mobile/installer/debian/compat.in
+++ b/mobile/installer/debian/compat.in
@@ -1,1 +1,1 @@
-5
+4
--- a/mobile/installer/debian/fennec.postinst.in
+++ b/mobile/installer/debian/fennec.postinst.in
@@ -1,21 +1,22 @@
-#! /bin/sh
+#filter substitution
+#literal #! /bin/sh
 # postinst script for fennec
 #
 # see: dh_installdeb(1)
 
 set -e
 
 case "$1" in
     configure)
         # for faster initial startup
 #ifdef MOZ_PLATFORM_HILDON        
         /bin/su -l user -c "/usr/bin/fennec -silent" > /dev/null 2>&1  || echo -n ""
-#end
+#endif
         # for fennec icons
 	gtk-update-icon-cache -f /usr/share/icons/hicolor
 		
         # select where to install fennec menu
         if [ "$2" == "" ]; then
 
             if [ -x /usr/bin/update-desktop-database ]; then
                 update-desktop-database /usr/share/applications
--- a/mobile/installer/debian/fennec.preinst.in
+++ b/mobile/installer/debian/fennec.preinst.in
@@ -1,9 +1,9 @@
-#! /bin/sh
+#literal #! /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
--- a/mobile/installer/debian/fennec.prerm.in
+++ b/mobile/installer/debian/fennec.prerm.in
@@ -1,9 +1,9 @@
-#! /bin/sh
+#literal #! /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
--- a/mobile/makefiles.sh
+++ b/mobile/makefiles.sh
@@ -48,22 +48,15 @@ mobile/chrome/tests/Makefile
 mobile/components/Makefile
 mobile/components/phone/Makefile
 mobile/components/protocols/Makefile
 mobile/installer/Makefile
 mobile/locales/Makefile
 mobile/Makefile
 mobile/themes/hildon/Makefile
 mobile/themes/Makefile
-mobile/themes/wince/Makefile
-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"
+mobile/themes/wince/Makefile"
 
 if test -n "$MOZ_UPDATE_PACKAGING"; then
    add_makefiles "
      tools/update-packaging/Makefile
    "
 fi