mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Add version support also at the source distribution
This commit is contained in:
parent
ef84db7477
commit
06e0954d5e
3 changed files with 20 additions and 2 deletions
|
|
@ -102,8 +102,12 @@ mkstream_SOURCES = \
|
|||
cmdline/stream.c \
|
||||
raid/memory.c
|
||||
|
||||
# Add the .version file in the distribution
|
||||
dist-hook:
|
||||
$(srcdir)/autover.sh > $(distdir)/.version
|
||||
|
||||
EXTRA_DIST = \
|
||||
autogen.sh \
|
||||
autogen.sh autover.sh \
|
||||
README AUTHORS HISTORY INSTALL COPYING TODO CHECK INSTALL.windows \
|
||||
snapraid.d snapraid.1 snapraid.txt \
|
||||
test/test-par1.conf \
|
||||
|
|
|
|||
14
autover.sh
Executable file
14
autover.sh
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
|
||||
if [ -d .git ]; then
|
||||
# Get version from git tags, removing the 'v' prefix
|
||||
VERSION=`git describe --match 'v*' | sed 's/^v//'`
|
||||
elif [ -f .version ]; then
|
||||
# Get version from the .version file
|
||||
VERSION=`cat .version`
|
||||
else
|
||||
VERSION="none"
|
||||
fi
|
||||
|
||||
printf '%s' "$VERSION"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_PREREQ([2.65])
|
||||
dnl Get version number from git
|
||||
m4_define([git_revision], m4_esyscmd_s([git describe --match 'v*' | sed 's/^v//']))
|
||||
m4_define([git_revision], m4_esyscmd_s([./autover.sh]))
|
||||
AC_INIT([snapraid], [git_revision], [], [], [http://www.snapraid.it])
|
||||
AM_INIT_AUTOMAKE([foreign no-dependencies subdir-objects])
|
||||
AC_CONFIG_SRCDIR([cmdline/snapraid.c])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue