diff --git a/configure.ac b/configure.ac index 3b0c6aa..76ec238 100644 --- a/configure.ac +++ b/configure.ac @@ -29,7 +29,7 @@ AH_TEMPLATE([REQ_SERVER_CERT], [Defined if client requires server SSL certificat AH_TEMPLATE([TRUST_UDS_CRED], [Defined if we trust credentials from UDS client]) dnl ### Normal initialization. ###################################### -AC_INIT +AC_INIT([conserver],m4_esyscmd_s([./package/get-version number])) AC_PREREQ(2.59) AC_CONFIG_SRCDIR([conserver/main.c]) AC_CONFIG_HEADER(config.h) @@ -43,6 +43,9 @@ fi MKDIR="mkdir -p -m 755" AC_SUBST(MKDIR) +AC_SUBST(CONSERVER_VERSION, m4_esyscmd_s([./package/get-version number])) +AC_SUBST(CONSERVER_DATE, m4_esyscmd_s([./package/get-version date])) + dnl ### Custom settings. ############################################ dnl AC_MSG_CHECKING(whether to allow 64bit compilation) @@ -844,6 +847,7 @@ AC_CHECK_FUNCS(getaudit getaudit_addr) dnl ### Create output files. ####################################### AC_CONFIG_FILES([Makefile conserver/Makefile conserver.cf/Makefile console/Makefile autologin/Makefile contrib/chat/Makefile]) AC_CONFIG_FILES([conserver/conserver.rc], [chmod +x conserver/conserver.rc]) +AC_CONFIG_FILES([conserver.cf/conserver.cf.man conserver.cf/conserver.passwd.man conserver/conserver.man console/console.man]) AC_OUTPUT [ diff --git a/conserver.cf/conserver.cf.man b/conserver.cf/conserver.cf.man.in similarity index 99% rename from conserver.cf/conserver.cf.man rename to conserver.cf/conserver.cf.man.in index f98b618..77253d1 100644 --- a/conserver.cf/conserver.cf.man +++ b/conserver.cf/conserver.cf.man.in @@ -1,4 +1,4 @@ -.TH CONSERVER.CF 5 "2019/03/17" "conserver-8.2.3" "conserver" +.TH CONSERVER.CF 5 "@CONSERVER_DATE@" "conserver-@CONSERVER_VERSION@" "conserver" .SH NAME conserver.cf \- console configuration file for .BR conserver (8) diff --git a/conserver.cf/conserver.passwd.man b/conserver.cf/conserver.passwd.man.in similarity index 96% rename from conserver.cf/conserver.passwd.man rename to conserver.cf/conserver.passwd.man.in index eeb4806..6b9912f 100644 --- a/conserver.cf/conserver.passwd.man +++ b/conserver.cf/conserver.passwd.man.in @@ -1,4 +1,4 @@ -.TH CONSERVER.PASSWD 5 "2019/03/17" "conserver-8.2.3" "conserver" +.TH CONSERVER.PASSWD 5 "@CONSERVER_DATE@" "conserver-@CONSERVER_VERSION@" "conserver" .SH NAME conserver.passwd \- user access information for .BR conserver (8) diff --git a/conserver/conserver.man b/conserver/conserver.man.in similarity index 99% rename from conserver/conserver.man rename to conserver/conserver.man.in index 1dd2103..2ab2191 100644 --- a/conserver/conserver.man +++ b/conserver/conserver.man.in @@ -1,4 +1,4 @@ -.TH CONSERVER 8 "2019/03/17" "conserver-8.2.3" "conserver" +.TH CONSERVER 8 "@CONSERVER_DATE@" "conserver-@CONSERVER_VERSION@" "conserver" .SH NAME conserver \- console server daemon .SH SYNOPSIS diff --git a/conserver/version.h b/conserver/version.h index 94027e4..4e1d104 100644 --- a/conserver/version.h +++ b/conserver/version.h @@ -12,6 +12,7 @@ @(#) Copyright 2000 conserver.com.\n\ All rights reserved.\n" +#define VERSION_DATE "2019/03/17" #define VERSION_MAJOR 8 #define VERSION_MINOR 2 #define VERSION_REV 3 diff --git a/console/console.man b/console/console.man.in similarity index 99% rename from console/console.man rename to console/console.man.in index 3abefd9..9c5e9cf 100644 --- a/console/console.man +++ b/console/console.man.in @@ -1,4 +1,4 @@ -.TH CONSOLE 1 "2019/03/17" "conserver-8.2.3" "conserver" +.TH CONSOLE 1 "@CONSERVER_DATE@" "conserver-@CONSERVER_VERSION@" "conserver" .SH NAME console \- console server client program .SH SYNOPSIS diff --git a/package/create-changes b/package/create-changes index 1eecb83..362758c 100755 --- a/package/create-changes +++ b/package/create-changes @@ -4,10 +4,7 @@ set -e [ -z "$1" ] && echo "Usage: $0 tag" && exit 1 range="$1" -maj=`grep MAJOR conserver/version.h | awk '{print $NF; exit}'` -min=`grep MINOR conserver/version.h | awk '{print $NF; exit}'` -rev=`grep REV conserver/version.h | awk '{print $NF; exit}'` -ver="$maj.$min.$rev" - -echo "version $ver (`date '+%B %-d, %Y'`):" +date=`./package/get-version date` +changedate=`date -j -f '%Y/%m/%d' "$date" '+%B %-d, %Y'` +echo "version `./package/get-version number` ($changedate):" git log --no-merges --pretty=tformat:' - %s (%an <%ae>)' "$range" | tail -r | awk '{if (! l[$0]) {l[$0]++; print}}' diff --git a/package/get-version b/package/get-version new file mode 100755 index 0000000..1e60527 --- /dev/null +++ b/package/get-version @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +# awk gets stdin from /dev/null 'cause when autoconf runs this via m4_esyscmd_s, +# stdin is closed and awk assumes there will always be an open stdin and you end +# up with a bogus message: +# +# awk: i/o error occurred while closing /dev/stdin +# input record number 20, file conserver/version.h +# source line number 1 +# +# +case "$1" in + number) + awk '$2=="VERSION_MAJOR"{maj=$NF} $2=="VERSION_MINOR"{min=$NF} $2=="VERSION_REV"{rev=$NF} END{print maj "." min "." rev}' conserver/version.h < /dev/null + ;; + + date) + awk '$2=="VERSION_DATE"{print $NF}' conserver/version.h < /dev/null | tr -d '"' + ;; +esac diff --git a/package/make-and-stage-release b/package/make-and-stage-release index eebe34e..8700e91 100755 --- a/package/make-and-stage-release +++ b/package/make-and-stage-release @@ -5,10 +5,8 @@ set -e local=false && [ "$1" = "local" ] && local=true [ -f conserver/version.h ] || { echo "you are in the wrong place" ; exit 1; } -maj=`grep MAJOR conserver/version.h | awk '{print $NF; exit}'` -min=`grep MINOR conserver/version.h | awk '{print $NF; exit}'` -rev=`grep REV conserver/version.h | awk '{print $NF; exit}'` -ver="$maj.$min.$rev" + +ver=`./package/get-version number` if [ ! -f ../conserver-$ver.tar.gz ] || $local; then ( [ -d build ] && rm -rf build