[tracker/tracker-1.0] build: Require gnome-common and build a proper Changelog



commit 6962c4588964ade0cce56d3a9fd86e541907c8d6
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Jul 16 15:31:14 2014 +0200

    build: Require gnome-common and build a proper Changelog
    
    Includes further fixes for "make distcheck"

 .gitignore                        |    1 +
 Makefile.am                       |   24 ++++++++++-----
 autogen.sh                        |   59 +++++++++----------------------------
 configure.ac                      |   18 ++++-------
 tests/libtracker-data/Makefile.am |    3 ++
 5 files changed, 41 insertions(+), 64 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e79df26..a3b31cb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,6 +17,7 @@ config.*
 ABOUT-NLS
 aclocal.m4
 autom4te.cache
+build-aux
 ChangeLog
 INSTALL
 Makefile.in
diff --git a/Makefile.am b/Makefile.am
index 3b2b2eb..388eabc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -56,16 +56,24 @@ coverage-report: coverage
        genhtml --title "@PACKAGE_STRING@" --output-directory $(top_builddir)/coverage 
$(top_builddir)/lcov.info
 #endif
 
-dist-hook: gen-ChangeLog
+distclean-local:
+       if test "x$(srcdir)" = "x."; then :; else \
+               rm -f ChangeLog; \
+       fi
 
+.PHONY: ChangeLog
 gen_start_date = 2009-04-10
-.PHONY: gen-ChangeLog
-gen-ChangeLog:
-       if test -d .git; then                          \
-         $(top_srcdir)/gitlog-to-changelog            \
-           --since=$(gen_start_date) > $(distdir)/cl-t; \
-         rm -f $(distdir)/ChangeLog;                  \
-         mv $(distdir)/cl-t $(distdir)/ChangeLog;     \
+ChangeLog:
+       $(AM_V_GEN) if test -d "$(srcdir)/.git"; then \
+         $(top_srcdir)/gitlog-to-changelog --since=$(gen_start_date) > $  tmp \
+         && mv -f $  tmp $@ \
+         || ($(RM) $  tmp; \
+             echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
+             (test -f $@ || echo git-log is required to generate this file >> $@)); \
+       else \
+         test -f $@ || \
+         (echo A git checkout and git-log is required to generate ChangeLog >&2 && \
+         echo A git checkout and git-log is required to generate this file >> $@); \
        fi
 
 functional-test:
diff --git a/autogen.sh b/autogen.sh
index 8e016e9..e5de9f6 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,55 +1,24 @@
 #!/bin/sh
 # Run this to generate all the initial makefiles, etc.
-#
-# NOTE: compare_versions() is stolen from gnome-autogen.sh
 
-REQUIRED_VALA_VERSION=0.18.0
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
 
-# Usage:
-#     compare_versions MIN_VERSION ACTUAL_VERSION
-# returns true if ACTUAL_VERSION >= MIN_VERSION
-compare_versions() {
-    ch_min_version=$1
-    ch_actual_version=$2
-    ch_status=0
-    IFS="${IFS=         }"; ch_save_IFS="$IFS"; IFS="."
-    set $ch_actual_version
-    for ch_min in $ch_min_version; do
-        ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes
-        if [ -z "$ch_min" ]; then break; fi
-        if [ -z "$ch_cur" ]; then ch_status=1; break; fi
-        if [ $ch_cur -gt $ch_min ]; then break; fi
-        if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi
-    done
-    IFS="$ch_save_IFS"
-    return $ch_status
-}
-
-# Vala version check
-test -z "$VALAC" && VALAC=valac
-VALA_VERSION=`$VALAC --version | cut -d" " -f2`
+PKG_NAME="tracker"
 
-if [ -z "$VALA_VERSION" ]; then
-    echo "**Error**: valac not installed or broken. You must have valac >= $REQUIRED_VALA_VERSION"
-    echo "installed to build."
+(test -f $srcdir/configure.ac \
+  && test -f $srcdir/autogen.sh) || {
+    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+    echo " top-level $PKG_NAME directory"
     exit 1
-fi
+}
 
-echo "Found Vala $VALA_VERSION"
+DIE=0
 
-if ! compare_versions $REQUIRED_VALA_VERSION $VALA_VERSION; then
-    echo "**Error**: You must have valac >= $REQUIRED_VALA_VERSION installed to build, you have 
$VALA_VERSION"
-    exit 1
+if ! which gnome-autogen.sh ; then
+  echo "You need to install the gnome-common module and make"
+  echo "sure the gnome-autogen.sh script is in your \$PATH."
+  exit 1
 fi
 
-# Generate required files
-test -n "$srcdir" || srcdir=`dirname "$0"`
-test -n "$srcdir" || srcdir=.
-(
-  cd "$srcdir" &&
-  touch ChangeLog && # Automake requires that ChangeLog exist
-  gtkdocize --flavour no-tmpl &&
-  autopoint --force &&
-  AUTOPOINT='intltoolize --automake --copy' autoreconf --verbose --force --install
-) || exit
-test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
+. gnome-autogen.sh
diff --git a/configure.ac b/configure.ac
index 777278d..406951f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,7 @@ AC_INIT([tracker],
         [http://www.tracker-project.org])
 
 AC_CONFIG_SRCDIR([src/tracker-store/tracker-main.vala])
+AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADERS([config.h])
 
@@ -491,24 +492,19 @@ PKG_CHECK_MODULES(TRACKER_NAUTILUS_EXTENSION, [$TRACKER_NAUTILUS_EXTENSION_REQUI
                   [have_tracker_nautilus_extension=no])
 
 # Check we have Vala valac command we need
-AC_PATH_PROG(VALAC, valac, valac)
-if test -z $VALAC; then
-   AC_MSG_ERROR([Could not find 'valac'])
+VALA_MIN_VERSION=0.18.0
+AM_PROG_VALAC([$VALA_MIN_VERSION])
+if test "x$VALAC" = "x"; then
+    AC_MSG_ERROR([Vala requested but valac >= $VALA_MIN_VERSION is not installed])
 fi
 
-AC_SUBST(VALAC)
-
 ####################################################################
 # Check gettext/intltool support
 ####################################################################
-IT_PROG_INTLTOOL([0.40.0])
-
-AM_GNU_GETTEXT_VERSION([0.17])
-AM_GNU_GETTEXT([external])
-
 GETTEXT_PACKAGE=AC_PACKAGE_NAME
 AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext translation domain])
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define the gettext package to be used])
+IT_PROG_INTLTOOL([0.40.0])
 
 ####################################################################
 # Check if we should enable GCOV coverage reporting support
diff --git a/tests/libtracker-data/Makefile.am b/tests/libtracker-data/Makefile.am
index c7623e1..beaef61 100644
--- a/tests/libtracker-data/Makefile.am
+++ b/tests/libtracker-data/Makefile.am
@@ -90,3 +90,6 @@ EXTRA_DIST += \
        ontologies/20-dc.ontology                      \
        ontologies/31-nao.ontology                     \
        ontologies/90-tracker.ontology
+
+clean-local:
+       rm -rf $(abs_builddir)/test-cache


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