diff --git a/configure.ac b/configure.ac index 3b0c6aa..a0f4f68 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/contrib/redhat-rpm/conserver.spec b/contrib/redhat-rpm/conserver.spec index acb797e..b7b06fb 100644 --- a/contrib/redhat-rpm/conserver.spec +++ b/contrib/redhat-rpm/conserver.spec @@ -4,7 +4,7 @@ # %define pkg conserver -%define ver 8.2.3 +%define ver # define the name of the machine on which the main conserver # daemon will be running if you don't want to use the default diff --git a/contrib/solaris-package/pkginfo b/contrib/solaris-package/pkginfo index af129fb..4739b7c 100644 --- a/contrib/solaris-package/pkginfo +++ b/contrib/solaris-package/pkginfo @@ -1,7 +1,7 @@ PKG="conserver" NAME="Console server and client" CATEGORY="system" -VERSION="8.2.3" +VERSION= DESC="Console server and client" CLASSES=none ARCH=sparc diff --git a/package/README.md b/package/README.md index c833f61..53b541b 100644 --- a/package/README.md +++ b/package/README.md @@ -1,10 +1,9 @@ Creating a new release ---------------------- -- Create a new release branch `git checkout -b release-v...` -- Update `CHANGES` with output of `./package/create-changes v-xx..` +- Create a new release branch `git checkout -b release-vx.y.z` - Edit `conserver/version.h` -- Run `./package/replicate-version-number` +- Update `CHANGES` with output of `./package/create-changes vx.y.z..` - Double-check and merge release branch - Run `./package/make-and-stage-release` to create distribution, pgp sign, tag release, and push to github diff --git a/package/create-changes b/package/create-changes index 1eecb83..836221f 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'`):" -git log --no-merges --pretty=tformat:' - %s (%an <%ae>)' "$range" | tail -r | awk '{if (! l[$0]) {l[$0]++; print}}' +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}}' | sed -e 's/(Bryan Stansell )$//' 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..f1542fa 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 @@ -17,6 +15,8 @@ if [ ! -f ../conserver-$ver.tar.gz ] || $local; then cd build/conserver-$ver ../../package/setup-configure rm -rf package + sed -i "" -e "/^%define ver/s| ver.*| ver $ver|" contrib/redhat-rpm/conserver.spec + sed -i "" -e "/^VERSION=/s|.*|VERSION=\"$ver\"|" contrib/solaris-package/pkginfo ) $local && exit echo "Creating ../conserver-$ver.tar.gz" diff --git a/package/replicate-version-number b/package/replicate-version-number deleted file mode 100755 index 0d5d21c..0000000 --- a/package/replicate-version-number +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -set -e - -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" -date=`grep '^version' CHANGES | head -1 | sed -e 's/.*(\(.*\)).*/\1/'` -mandate=`date -j -f '%b %d, %Y' "$date" "+%Y/%m/%d"` - -for i in c*/*.man; do - sed -i "" -e "/^\.TH /s|\".*|\"$mandate\" \"conserver-$ver\" \"conserver\"|" "$i" -done - -sed -i "" -e "/^%define ver/s| ver .*| ver $ver|" contrib/redhat-rpm/conserver.spec -sed -i "" -e "/^VERSION=/s|.*|VERSION=\"$ver\"|" contrib/solaris-package/pkginfo diff --git a/package/setup-configure b/package/setup-configure index 9b9b75c..7648dd6 100755 --- a/package/setup-configure +++ b/package/setup-configure @@ -5,4 +5,14 @@ set -e curl -s -o config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess' curl -s -o config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub' -autoreconf +# We set lang to avoid this with the gcc docker image on cirrus: +# +# ./package/setup-configure +# perl: warning: Setting locale failed. +# perl: warning: Please check that your locale settings: +# LANGUAGE = (unset), +# LC_ALL = (unset), +# LANG = "en_US.UTF-8" +# are supported and installed on your system. + +LANG=C autoreconf