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 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE. # SUCH DAMAGE.
SUBDIRS = example man src test
doc_DATA = README.md LICENSE ChangeLog.md syslog.conf doc_DATA = README.md LICENSE ChangeLog.md syslog.conf
EXTRA_DIST = 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 if HAVE_SYSTEMD
systemd_DATA = syslogd.service systemd_DATA = syslogd.service
@ -36,22 +37,9 @@ endif
# #
# Check if tagged in git # Check if tagged in git
# #
release-hook: $(TAG):
@if [ ! `git tag -l v$(PACKAGE_VERSION) | grep $(PACKAGE_VERSION)` ]; then \ @printf "\e[1m\e[41mPlease create the \"$(PACKAGE_VERSION)\" tag first\e[0m\n"
echo; \ @exit 1
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
# #
# Generate .deb package(s) # Generate .deb package(s)

View File

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