groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 01/01: Define a short version for data installation dir name.


From: Bertrand Garrigues
Subject: [groff] 01/01: Define a short version for data installation dir name.
Date: Wed, 28 Mar 2018 18:21:16 -0400 (EDT)

bgarrigues pushed a commit to branch master
in repository groff.

commit 00156d87619530e6807a55c27e8965b74762690f
Author: Bertrand Garrigues <address@hidden>
Date:   Tue Mar 27 23:34:06 2018 +0200

    Define a short version for data installation dir name.
    
    This is the full version stripped of any characters after the
    third digit.  Used for installation of font, macro and various
    data (by default in /usr/local/share/groff).  The various programs
    and scripts still use the full version from gnulib script
    'git-version-gen' .
    
    * configure.ac (SHORT_VERSION): short version definition.
    
    * Makefile.am: use 'SHORT_VERSION' for 'docdir' and 'datasubdir'
    definitions.
---
 ChangeLog    | 15 +++++++++++++++
 Makefile.am  | 11 ++++++++---
 configure.ac |  5 +++++
 3 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7c84c46..8553fbf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2018-03-27  Bertrand Garrigues <address@hidden>
+
+       Define a short version for data installation dir name.
+
+       This is the full version stripped of any characters after the
+       third digit.  Used for installation of font, macro and various
+       data (by default in /usr/local/share/groff).  The various programs
+       and scripts still use the full version from gnulib script
+       'git-version-gen' .
+
+       * configure.ac (SHORT_VERSION): short version definition.
+
+       * Makefile.am: use 'SHORT_VERSION' for 'docdir' and 'datasubdir'
+       definitions.
+
 2018-03-11  Bertrand Garrigues <address@hidden>
 
        Remove doc/automake_migration_tests.txt
diff --git a/Makefile.am b/Makefile.am
index 7cc50f6..6a05cca 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -154,7 +154,7 @@ address@hidden@ font/devutf8
 # datadir
 # datarootdir
 dataprogramdir=$(datadir)/groff
-datasubdir=$(dataprogramdir)/$(VERSION)
+datasubdir=$(dataprogramdir)/$(SHORT_VERSION)
 
 # infodir
 # `infodir' says where to install info files.
@@ -162,7 +162,7 @@ datasubdir=$(dataprogramdir)/$(VERSION)
 # docdir
 # `docdir' says where to install documentation files.  The default
 # location is ${datarootdir}/doc/${PACKAGE}, but we add the version
-docdir=$(datarootdir)/doc/${PACKAGE}-$(VERSION)
+docdir=$(datarootdir)/doc/${PACKAGE}-$(SHORT_VERSION)
 
 # `exampledir' says where to install example files.
 exampledir=$(docdir)/examples
@@ -633,6 +633,11 @@ endif
 #
 # REVISION is the full revision given by git-version-gen, which can
 # have non-alphanumeric symbols.
+#
+# SHORT_REVISION contains only the number of REVISION before the first
+# '.', e.g. if REVISION is '3.real.434-5aafd' then SHORT_REVISION is
+# '3'.
+
 MAJOR_VERSION =`echo $(VERSION) | sed 's/\([0-9]\+\)\.[0-9]\+.*/\1/'`
 MINOR_VERSION =`echo $(VERSION) | sed 's/[0-9]\+\.\([0-9]\+\).*/\1/'`
 REVISION = `echo $(VERSION) | sed 's/[0-9]\+\.[0-9]\+\.\(.*\)/\1/'`
@@ -770,7 +775,7 @@ install-data-hook: create_current_symlink
 create_current_symlink:
        cd $(DESTDIR)$(dataprogramdir); \
          rm -f current; \
-         $(LN_S) $(VERSION) current
+         $(LN_S) $(SHORT_VERSION) current
 
 # Hook to move the binaries that potentially have a prefix from
 # prefixexecbindir to bindir.
diff --git a/configure.ac b/configure.ac
index 9564526..152ac91 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,6 +25,11 @@ AC_INIT([GNU Troff],
 
 AC_PREREQ([2.62])
 
+# Version consisting of exactly MAJOR.MINOR.PATCH, striped of any
+# digit after PATCH.
+AC_SUBST([SHORT_VERSION],
+       m4_bregexp(AC_PACKAGE_VERSION,[^\(\w+\.\w+\.\w+\).*$],[\1]))
+
 # Directories where the helper scripts should be found. This must be consistent
 # with the variable build_aux in bootstrap.conf
 AC_CONFIG_AUX_DIR([build-aux])



reply via email to

[Prev in Thread] Current Thread [Next in Thread]