diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..86b753281 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +/configure.ac export-subst diff --git a/.gitignore b/.gitignore index 48d733624..9ae5f5426 100644 --- a/.gitignore +++ b/.gitignore @@ -16,24 +16,32 @@ autom4te.cache/ config.status configure conftest.* -.libs -# since we use subdir-objects as automake option -.dirstamp + +# dotfiles + +.* +# - subsumed: +# .dirstamp (since we use subdir-objects as automake option) +# .libs +# .{,snapshot-,tarball-}version +# - sans: +!.git* +!/.tito +!/.travis.yml + # ignore "libtoolized" m4 files, but keep our (custom-prefixed) ones /m4/* !/m4/ax_*.m4 # build-aux/release.mk related litter -/.tarball-version /tag-* /lib/qblog_script.ld # already captured with wildcard: /lib/qblog_script.la libtool -.version libqb.spec libqb-* cov diff --git a/Makefile.am b/Makefile.am index 6ced4c185..37f578c45 100644 --- a/Makefile.am +++ b/Makefile.am @@ -48,7 +48,7 @@ doxygen: $(MAKE) -C docs doxygen dist-clean-local: - rm -f autoconf automake autoheader + rm -f .snapshot-version autoconf automake autoheader # this will also get rid of "libtoolized" m4 files maintainer-clean-local: @@ -128,8 +128,13 @@ BUILT_SOURCES = .version .version: echo $(VERSION) > $@-t && mv $@-t $@ +# also untaint configure.ac when modified upon obtaining the snapshot form dist-hook: gen-ChangeLog echo $(VERSION) > $(distdir)/.tarball-version + sed "s/\(.*git-version-gen[^']*[']\)[^']*/\1\$$Format:%h!%D\$$/" \ + $(distdir)/configure.ac > $(distdir)/configure.ac-t + touch -r $(distdir)/configure.ac $(distdir)/configure.ac-t + mv $(distdir)/configure.ac-t $(distdir)/configure.ac gen_start_date = 2000-01-01 .PHONY: gen-ChangeLog diff --git a/autogen.sh b/autogen.sh index a10bf96c3..d5bb04f80 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,3 +1,7 @@ #!/bin/sh # Run this to generate all the initial makefiles, etc. -autoreconf -i -v && echo Now run ./configure and make +autoreconf -i -v \ + && { test -s .snapshot-version \ + && echo 'USE SNAPSHOT ONLY AT YOUR RISK (official release recommended)' \ + || :; } \ + && echo Now run ./configure and make diff --git a/configure.ac b/configure.ac index d57634eb2..0b76a6499 100644 --- a/configure.ac +++ b/configure.ac @@ -3,10 +3,16 @@ AC_PREREQ([2.61]) -dnl inject zero as a "patch" component of the version if missing in tag +dnl inject zero as a "patch" component of the version if missing in tag; +dnl care to bump X.Y.Z-g* version below with each point release very desirable AC_INIT([libqb], - m4_esyscmd([build-aux/git-version-gen .tarball-version \ - 's|^\(v[0-9][0-9]*\.[0-9][0-9]*\)\([^.].*\)\?$|\1.0\2|']), + m4_esyscmd([build-aux/git-version-gen $(echo '$Format:%h!%D$' \ + | sed -ne 's/[$]Format:%h!%D[$]/.tarball-version/p;tend' \ + -e 's/.*tag: v\([^, ][^, ]*\).*/\1/;tv' \ + -e 's/^\([[:xdigit:]][[:xdigit:]]*\).*/1.0.3-g\1/' \ + -e ':v;w .snapshot-version' -e 'i .snapshot-version' \ + -e ':end;q') \ + 's/^\(v[0-9][0-9]*\.[0-9][0-9]*\)\([^.].*\)\?$/\1.0\2/']), [developers@clusterlabs.org]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR([lib/ringbuffer.c])