Extract version from GIT, inspiration from mdio-tools

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg 2021-11-08 06:57:45 +01:00
parent 029115a23e
commit da7425f757
2 changed files with 7 additions and 19 deletions

View File

@ -25,9 +25,10 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
SUBDIRS = example man src test
doc_DATA = README.md LICENSE ChangeLog.md syslog.conf
EXTRA_DIST = README.md LICENSE ChangeLog.md syslog.conf
SUBDIRS = example man src test
TAG = $(top_srcdir)/.git/refs/tags/$(PACKAGE_VERSION)
if HAVE_SYSTEMD
systemd_DATA = syslogd.service
@ -36,22 +37,9 @@ endif
#
# Check if tagged in git
#
release-hook:
@if [ ! `git tag -l v$(PACKAGE_VERSION) | grep $(PACKAGE_VERSION)` ]; then \
echo; \
printf "\e[1m\e[41mCannot find release tag $(PACKAGE_VERSION)\e[0m\n"; \
printf "\e[1m\e[5mDo release anyway?\e[0m "; read yorn; \
if [ "$$yorn" != "y" -a "$$yorn" != "Y" ]; then \
printf "OK, aborting release.\n"; \
exit 1; \
fi; \
echo; \
else \
echo; \
printf "\e[1m\e[42mFound GIT release tag $(PACKAGE_VERSION)\e[0m\n"; \
printf "\e[1m\e[44m>>Remember to push tags!\e[0m\n"; \
echo; \
fi
$(TAG):
@printf "\e[1m\e[41mPlease create the \"$(PACKAGE_VERSION)\" tag first\e[0m\n"
@exit 1
#
# Generate .deb package(s)

View File

@ -25,8 +25,8 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
AC_INIT([sysklogd], [2.3.0-beta1], [https://github.com/troglobit/sysklogd/issues],,
[https://github.com/troglobit/sysklogd])
AC_INIT([sysklogd], m4_esyscmd_s(git describe --always --dirty --tags),
[https://github.com/troglobit/sysklogd/issues],,[https://github.com/troglobit/sysklogd])
AC_CONFIG_AUX_DIR(aux)
AM_INIT_AUTOMAKE([1.11 foreign subdir-objects])
LT_INIT([pic-only])