--- /dev/null
+#!/bin/sh
+
+if test $# -ne 1; then
+ echo >&2 "usage: $0 <version file>"
+ exit 1
+fi
+
+GVF="$1"
+DEF_VER="unnamed_version"
+
+LF='
+'
+
+# First see if there is a version file (included in release tarballs),
+# then try git-describe, then default.
+if test -f VERSION
+then
+ VN=$(cat VERSION) || VN="$DEF_VER"
+elif test -d .git -o -f .git &&
+ VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
+ case "$VN" in
+ *$LF*) (exit 1) ;;
+ v[0-9]*)
+ git update-index -q --refresh
+ test -z "$(git diff-index --name-only HEAD --)" ||
+ VN="$VN-dirty" ;;
+ esac
+then
+ VN=$(echo "$VN" | sed -e 's/-/./g');
+else
+ VN="$DEF_VER"
+fi
+
+VN=$(expr "$VN" : v*'\(.*\)')
+
+if test -r $GVF
+then
+ VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
+else
+ VC=unset
+fi
+test "$VN" = "$VC" || {
+ echo >&2 "GIT_VERSION = $VN"
+ echo "GIT_VERSION = $VN" >$GVF
+}
CPPFLAGS += -I/usr/local/include
CPPFLAGS += -I$(cmdline_dir)
CPPFLAGS += @osl_cppflags@
+CPPFLAGS += -DGIT_VERSION='"$(GIT_VERSION)"'
BINARIES = para_server para_client para_audioc para_recv \
para_filter para_write para_afh @extra_binaries@
$(ggo_dir) skencil)
tarball := @PACKAGE_TARNAME@-$(PACKAGE_VERSION).tar.bz2
-.PHONY: all clean distclean maintainer-clean install man tarball
+.PHONY: all clean distclean maintainer-clean install man tarball\
+ .FORCE-GIT-VERSION-FILE
all: $(BINARIES) $(man_pages)
man: $(man_pages)
tarball: $(tarball)
+GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
+ @./GIT-VERSION-GEN GIT-VERSION-FILE
+-include GIT-VERSION-FILE
+$(BINARIES): GIT-VERSION-FILE
+
-include $(ggo_dir)/makefile
%_command_list.c: %.cmd
git archive --format=tar --prefix=$(tarball_pfx)/ HEAD \
| tar --delete $(tarball_delete) > $(tarball_pfx).tar
mkdir -p $(tarball_pfx)/$(cmdline_dir)
+ echo $(GIT_VERSION) > $(tarball_pfx)/VERSION
cp -r $(autocrap) $(tarball_pfx)
cp -r $(cmdline_generated) $(tarball_pfx)/$(cmdline_dir)
tar rf $(tarball_pfx).tar $(tarball_pfx)/*
- stronger crypto for client authentication
- the database code has been moved to a library
- improved status item handling
+ - cleanup of the build system
+ - The "-V" option now also prints the git version
- the new parser-friendly listing mode for the ls and stat commands
- mandatory rc4 encryption
- major audio format handler cleanups
va_end(argp); \
}
-/** version text used by various commands if -V switch was given */
-#define VERSION_TEXT(prefix) "para_" prefix " " PACKAGE_VERSION " (" CODENAME ")" "\n" \
+/** Version text used by various commands if -V switch was given. */
+#define VERSION_TEXT(prefix) "para_" prefix " " PACKAGE_VERSION \
+ " (" GIT_VERSION ": " CODENAME ")" "\n" \
"Copyright (C) 2009 Andre Noll\n" \
"This is free software with ABSOLUTELY NO WARRANTY." \
" See COPYING for details.\n" \