]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update makefile and version generation to work with git working copy too
authorMichael Jerris <mike@jerris.com>
Fri, 2 Apr 2010 04:07:02 +0000 (00:07 -0400)
committerMichael Jerris <mike@jerris.com>
Fri, 2 Apr 2010 04:07:02 +0000 (00:07 -0400)
Makefile.am
configure.in
scripts/tagscript.sh

index afb5673877beb9ca8f8b31e8f5b2aaa3118aa8f3..8fad740092224002bfc532132683192210e39265 100644 (file)
@@ -349,7 +349,21 @@ src/include/switch_version.h: src/include/switch_version.h.in .version $(libfree
          cat src/include/switch_version.h.in > src/include/switch_version.h ; \
          touch .version ; \
        else \
-         version=`svnversion . -n || echo hacked` ; \
+         if [ -d .git ] ; then \
+           version=`git log --format="%h %ci" -1 HEAD | head -1 || echo hacked` ; \
+           if [ "x$$version" == "xhacked" ] ; then \
+             version="hacked-`date -u +%Y%m%dT%H%M%SZ`" ; \
+           else \
+             version="git-$$version" ; \
+           fi ;\
+         else \
+           version=`svnversion . -n || echo hacked` ; \
+           if [ "x$$version" == "xhacked" ] ; then \
+             version="hacked-`date -u +%Y%m%dT%H%M%SZ`" ; \
+           else \
+             version="svn-$$version" ; \
+           fi ;\
+         fi ; \
          oldversion=`cat .version 2>/dev/null || echo "0"` ; \
          if test "$$oldversion" != "$$version" || test $$force = 1 ; then \
            cat src/include/switch_version.h.in | sed "s/@SWITCH_VERSION_REVISION@/$$version/g" > src/include/switch_version.h ; \
@@ -437,23 +451,29 @@ install-data-local:
        test -d $(DESTDIR)$(sysconfdir) || $(MAKE) samples-conf
        test -d $(DESTDIR)$(htdocsdir) || $(MAKE) samples-htdocs
 
-is-svn:
-       @if [ ! -d .svn ] ; then \
+is-scm:
+       @if [ ! -d .svn -a ! -d .git ] ; then \
                echo ; echo ; \
-               echo "**************************************************************************************************" ; \
-               echo "You can not update a release tarball or without a svn working copy, please checkout fresh from svn" ; \
-               echo "**************************************************************************************************" ; \
+               echo "*****************************************************************************************************" ; \
+               echo "You can not update a release tarball or without a git or svn working copy please clone our git tree: " ; \
+               echo "git clone git://git.freeswitch.org/freeswitch.git                                                    " ; \
+               echo "or check out our read only svn mirror:                                                               " ; \
+               echo "svn checkout http://svn.freeswitch.org/svn/freeswitch/trunk                                          " ; \
+               echo "*****************************************************************************************************" ; \
                echo ; echo ; \
                exit 1; \
        fi 
 
-update: is-svn
+update: is-scm
        @if test -d .svn ; then \
          test ! -f .version || rm -f .version ; \
          echo Updating... ; \
          svn update ; \
+       elif test -d .git ; then \
+         echo "Pulling updates..." ; \
+         git pull ; \
        else \
-         echo "This source directory is not an svn working copy" ; \
+         echo "This source directory is not a git tree or svn working copy" ; \
        fi
 
 .nodepends:
@@ -483,18 +503,18 @@ core_install: install_core
 
 everything: install
 
-up: is-svn clean
-       svn update
+up: is-scm clean
+       $(MAKE) update
        $(MAKE) -j core
        $(MAKE) -j modules
        $(MAKE) install
 
-sync: is-svn
-       svn update
+sync: is-scm
+       $(MAKE) update
        $(MAKE) install
 
-speedy-sync: is-svn
-       svn update
+speedy-sync: is-scm
+       $(MAKE) update
        $(MAKE) -j install
 
 libs/openzap/Makefile:
@@ -570,15 +590,15 @@ cluecon:
        @echo
        @echo http://www.cluecon.com
        @sleep 5
-current: cluecon is-svn update-clean
-       svn update
+current: cluecon update-clean is-scm
+       $(MAKE) update
        $(MAKE) all
        $(MAKE) install
 
 installall: current
 
-speedy-current: is-svn update-clean
-       svn update
+speedy-current: update-clean is-scm
+       $(MAKE) update
        $(MAKE) speedy-sure
        $(MAKE) install
 
index de262a86dbe36ddd8a07c7f2a98a14bebc3ff709..16ba3e6999f64d5f9415d9ac7a83c39b8f2701b7 100644 (file)
@@ -3,11 +3,11 @@
 
 # Must change all of the below together
 # For a release, set revision for that tagged release as well and uncomment
-AC_INIT([freeswitch], [1.0.trunk], BUG-REPORT-ADDRESS)
+AC_INIT([freeswitch], [1.0.head], BUG-REPORT-ADDRESS)
 AC_SUBST(SWITCH_VERSION_MAJOR, [1])
 AC_SUBST(SWITCH_VERSION_MINOR, [0])
-AC_SUBST(SWITCH_VERSION_MICRO, [trunk])
-#AC_SUBST(SWITCH_VERSION_REVISION, [svn-revision-here])
+AC_SUBST(SWITCH_VERSION_MICRO, [head])
+#AC_SUBST(SWITCH_VERSION_REVISION, [])
 
 AC_CONFIG_FILES([src/include/switch_version.h.in:src/include/switch_version.h.template])
 AC_CONFIG_FILES([.version:.version.in])
index 48a377ffd79a8bb134064387ede3d18f2436540e..7556c075d02c1141c164649c2b87c0fe77f2526f 100755 (executable)
@@ -35,6 +35,7 @@ fi
 sed -e "s|\(AC_SUBST(SWITCH_VERSION_MAJOR, \[\).*\(\])\)|\1$major\2|" \
     -e "s|\(AC_SUBST(SWITCH_VERSION_MINOR, \[\).*\(\])\)|\1$minor\2|" \
     -e "s|\(AC_SUBST(SWITCH_VERSION_MICRO, \[\).*\(\])\)|\1$micro\2|" \
+    -e "s|\(AC_INIT(\[freeswitch\], \[\).*\(\], BUG-REPORT-ADDRESS)\)|\1$major.$minor.$micro\2|" \
     -i configure.in
 
 if [ -n "$rev" ]; then