From b2c00b3b241f57df07e21246f35c6cf53725ed58 Mon Sep 17 00:00:00 2001
From: Alfredo Cardigliano <alfredo.cardigliano@gmail.com>
Date: Fri, 7 Dec 2018 15:50:23 +0100
Subject: Added script to get the package version

---
 packages/ubuntu/configure    | 21 +++++++++++++++------
 packages/ubuntu/configure.in |  6 ++----
 2 files changed, 17 insertions(+), 10 deletions(-)

(limited to 'packages/ubuntu')

diff --git a/packages/ubuntu/configure b/packages/ubuntu/configure
index 77b5b7164..64900aa8d 100755
--- a/packages/ubuntu/configure
+++ b/packages/ubuntu/configure
@@ -584,7 +584,6 @@ PACKAGE_URL=''
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 GIT_REVISION
-GIT_RELEASE
 KERNEL
 DATE
 EXTN
@@ -609,6 +608,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -673,6 +673,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -925,6 +926,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1062,7 +1072,7 @@ fi
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1215,6 +1225,7 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -1693,9 +1704,8 @@ else
   fi
 fi
 
-NDPI_VERS=`cat ../../configure.ac|grep C_INIT|cut -c 21-|rev|cut -c 3-|rev`
-GIT_RELEASE=`git rev-parse HEAD`
-GIT_REVISION=`git rev-list --all |wc -l | tr -d '[:space:]'`
+NDPI_VERS=`../version.sh --release`
+GIT_REVISION=`../version.sh --revision`
 
 ac_config_files="$ac_config_files Makefile debian/changelog debian/files debian/control"
 
@@ -1707,7 +1717,6 @@ ac_config_files="$ac_config_files Makefile debian/changelog debian/files debian/
 
 
 
-
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
diff --git a/packages/ubuntu/configure.in b/packages/ubuntu/configure.in
index 0193b6e78..8883bdf04 100644
--- a/packages/ubuntu/configure.in
+++ b/packages/ubuntu/configure.in
@@ -24,9 +24,8 @@ else
   fi
 fi
 
-NDPI_VERS=`cat ../../configure.ac|grep C_INIT|cut -c 21-|rev|cut -c 3-|rev`
-GIT_RELEASE=`git rev-parse HEAD`
-GIT_REVISION=`git rev-list --all |wc -l | tr -d '[[:space:]]'`
+NDPI_VERS=`../version.sh --release`
+GIT_REVISION=`../version.sh --revision`
 
 AC_CONFIG_FILES([Makefile debian/changelog debian/files debian/control])
 
@@ -35,7 +34,6 @@ AC_SUBST(MACHINE)
 AC_SUBST(EXTN)
 AC_SUBST(DATE)
 AC_SUBST(KERNEL)
-AC_SUBST(GIT_RELEASE)
 AC_SUBST(GIT_REVISION)
 
 AC_OUTPUT
-- 
cgit v1.2.3