[passepartout] fix make distcheck



commit c543ac786ed1d977867b759f5f8e9a6e8dcc3321
Author: Sven Herzberg <herzi lanedo com>
Date:   Mon Apr 13 18:49:41 2009 +0200

    fix make distcheck
    
    * configure.ac: added --disable-database-updates; disable the updates for
      distcheck; check for xmllint
    * Makefile.am: only run database updates if not disabled; make sure distcheck
      passes
---
 Makefile.am  |   20 ++++++++++++--------
 configure.ac |    9 ++++++++-
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index b1cd2ff..6bae247 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -25,18 +25,22 @@ check-local: $(applications_DATA)
 # FIXME: add a check rule for the mime specification
 
 update-databases:
+if DATABASE_UPDATES
 	@if test -z "$(DESTDIR)"; then \
+		echo "$(UPDATE_MIME_DATABASE) $(datadir)/mime"; \
 		$(UPDATE_MIME_DATABASE) $(datadir)/mime; \
-		$(UPDATE_DESKTOP_DATABASE); \
-	else \
-		echo "******" >&2; \
-		echo "*** don't forget to run \"$(UPDATE_MIME_DATABASE) $(datadir)/mime\"" >&2; \
-		echo "*** don't forget to run \"$(UPDATE_DESKTOP_DATABASE)\"" >&2; \
-		echo "******" >&2; \
+		echo "$(UPDATE_DESKTOP_DATABASE) $(datadir)/applications"; \
+		$(UPDATE_DESKTOP_DATABASE) $(datadir)/applications; \
+		exit; \
 	fi
+endif
+	@echo "******" >&2
+	@echo "*** don't forget to run \"$(UPDATE_MIME_DATABASE) $(datadir)/mime\"" >&2
+	@echo "*** don't forget to run \"$(UPDATE_DESKTOP_DATABASE)\"" >&2
+	@echo "******" >&2
 
-install-data-local: update-databases
-uninstall-local: update-databases
+install-data-hook: update-databases
+uninstall-hook: update-databases
 
 if DIST_INTLTOOL
 intltool_in_files=\
diff --git a/configure.ac b/configure.ac
index cda4253..5511f51 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,6 @@ dnl  ----------------
 GNOME_COMPILE_WARNINGS([maximum])
 
 DISTCHECK_CONFIGURE_FLAGS="${DISTCHECK_CONFIGURE_FLAGS} --enable-compile-warnings=error"
-AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
 
 # Checks for programs.
 AC_PROG_CXX
@@ -96,6 +95,12 @@ dnl  -------------------
 dnl | freedesktop stuff |
 dnl  -------------------
 
+AC_ARG_ENABLE([database-updates],
+	      AS_HELP_STRING([--disable-database-updates],
+			     [disable database updates (useful for distcheck and distribution packagers]))
+AM_CONDITIONAL(DATABASE_UPDATES,[test "$enable_database_updates" != "no"])
+DISTCHECK_CONFIGURE_FLAGS="${DISTCHECK_CONFIGURE_FLAGS} --disable-database-updates"
+
 AC_PATH_PROGS(UPDATE_MIME_DATABASE,[update-mime-database],[no])
 if test "$UPDATE_MIME_DATABASE" = "no"; then
 	AC_MSG_ERROR([update-mime-database not found, please install shared-mime-info from
@@ -141,6 +146,8 @@ dnl  --------
 dnl | output |
 dnl  --------
 
+AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
+
 AC_CONFIG_FILES([Makefile
 	         src/Makefile	
                  src/ps/Makefile



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]