From 4d36f9f6135a19684c3509566de007b27ab31abc Mon Sep 17 00:00:00 2001 From: emanuele-f Date: Sat, 6 Jul 2019 14:40:16 +0200 Subject: [PATCH] Package fixes --- Makefile.in | 9 ++++++++- configure.seed | 7 +++++-- packages/debian/configure | 8 +++----- packages/debian/configure.in | 6 ++++++ packages/rpm/configure | 27 ++++++++++++++------------- packages/rpm/configure.in | 23 +++++++++++++++++------ 6 files changed, 53 insertions(+), 27 deletions(-) diff --git a/Makefile.in b/Makefile.in index 4cc8570..030cc33 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,3 +1,10 @@ + +# NOTE: these are needed by the configure.in inside the packages folder +N2N_VERSION_SHORT=@N2N_VERSION_SHORT@ +GIT_COMMITS=@GIT_COMMITS@ + +######## + CC?=gcc DEBUG?=-g3 #OPTIMIZATION?=-O2 @@ -97,7 +104,7 @@ install: edge supernode edge.8.gz supernode.1.gz n2n.7.gz # Docker builder section DOCKER_IMAGE_NAME=ntop/supernode -DOCKER_IMAGE_VERSION=@N2N_VERSION_SHORT@ +DOCKER_IMAGE_VERSION=$N2N_VERSION_SHORT N2N_COMMIT_HASH=@GIT_REVISION@ default: steps diff --git a/configure.seed b/configure.seed index 15e5554..1faea83 100644 --- a/configure.seed +++ b/configure.seed @@ -2,12 +2,15 @@ odnl> Do not add anything above AC_INIT([edge],@N2N_VERSION_SHORT@) dnl> Do not add anything above +N2N_VERSION_SHORT=${PACKAGE_VERSION} + if test -d ".git"; then +# NOTE: keep in sync with the definitions for configure.in files under the packages folder GIT_COMMITS=`git rev-list --count HEAD` GIT_REVISION=`git rev-parse --short HEAD` -GIT_RELEASE="@N2N_VERSION_SHORT@.r${GIT_COMMITS}.${GIT_REVISION}" +GIT_RELEASE="${N2N_VERSION_SHORT}.r${GIT_COMMITS}.${GIT_REVISION}" else -GIT_RELEASE=@N2N_VERSION_SHORT@ +GIT_RELEASE=${N2N_VERSION_SHORT} fi AC_CHECK_LIB([crypto], [AES_cbc_encrypt]) diff --git a/packages/debian/configure b/packages/debian/configure index bbcc4bd..f5333e2 100755 --- a/packages/debian/configure +++ b/packages/debian/configure @@ -583,12 +583,11 @@ PACKAGE_URL='' ac_subst_vars='LTLIBOBJS LIBOBJS +N2N_VERSION_SHORT GIT_COMMITS -GIT_RELEASE DATE EXTN MACHINE -N2N_VERS APP target_alias host_alias @@ -1706,9 +1705,8 @@ else fi APP=n2n -N2N_VERS=`grep N2N_VERSION ../../Makefile | head -1| cut -d "=" -f 2` -GIT_RELEASE=`git rev-parse HEAD` -GIT_COMMITS=`git rev-list --all |wc -l | tr -d '[:space:]'` +N2N_VERSION_SHORT=`grep N2N_VERSION_SHORT ../../Makefile | head -1| cut -d "=" -f 2` +GIT_COMMITS=`grep GIT_COMMITS ../../Makefile | head -1| cut -d "=" -f 2` DATE=`date -R` diff --git a/packages/debian/configure.in b/packages/debian/configure.in index cd5186c..fe86b74 100644 --- a/packages/debian/configure.in +++ b/packages/debian/configure.in @@ -1,5 +1,9 @@ AC_INIT([Makefile.in], 1.0) +# NOTE: this file is not actually used. You need to edit configure as well! +N2N_VERSION_SHORT=`grep N2N_VERSION_SHORT ../../Makefile | head -1| cut -d "=" -f 2` +GIT_COMMITS=`grep GIT_COMMITS ../../Makefile | head -1| cut -d "=" -f 2` + MACHINE=`uname -m` SHORT_MACHINE=`uname -m | cut -b1-3` @@ -29,6 +33,8 @@ DATE=`date -R` AC_SUBST(APP) AC_SUBST(MACHINE) +AC_SUBST(N2N_VERSION_SHORT) +AC_SUBST(GIT_COMMITS) AC_SUBST(EXTN) AC_SUBST(DATE) diff --git a/packages/rpm/configure b/packages/rpm/configure index 4ca467b..4fbdb80 100755 --- a/packages/rpm/configure +++ b/packages/rpm/configure @@ -583,13 +583,11 @@ PACKAGE_URL='' ac_subst_vars='LTLIBOBJS LIBOBJS -REVISION +N2N_VERSION_SHORT GIT_COMMITS -GIT_RELEASE DATE EXTN MACHINE -N2N_VERS APP target_alias host_alias @@ -1676,25 +1674,28 @@ SHORT_MACHINE=`uname -m | cut -b1-3` if test $MACHINE = "x86_64"; then EXTN="amd64" else - if test $SHORT_MACHINE = "arm"; then - EXTN="armhf" + if test $SHORT_MACHINE = "aar"; then + EXTN="arm64" EXTRA_DEPS="" else - if test $SHORT_MACHINE = "mip"; then - EXTN="mips" + if test $SHORT_MACHINE = "arm"; then + EXTN="armhf" EXTRA_DEPS="" - else - EXTN="i386" + else + if test $SHORT_MACHINE = "mip"; then + EXTN="mips" + EXTRA_DEPS="" + else + EXTN="i386" + fi fi fi fi APP=n2n -N2N_VERS=`grep N2N_VERSION ../../Makefile | head -1| cut -d "=" -f 2` -GIT_RELEASE=`git rev-parse HEAD` -GIT_COMMITS=`git rev-list --all |wc -l | tr -d '[:space:]'` +N2N_VERSION_SHORT=`grep N2N_VERSION_SHORT ../../Makefile | head -1| cut -d "=" -f 2` +GIT_COMMITS=`grep GIT_COMMITS ../../Makefile | head -1| cut -d "=" -f 2` DATE=`date -R` -REVISION=`git log --pretty=oneline | wc -l` diff --git a/packages/rpm/configure.in b/packages/rpm/configure.in index fa71a81..6b99c15 100644 --- a/packages/rpm/configure.in +++ b/packages/rpm/configure.in @@ -1,20 +1,29 @@ AC_INIT([Makefile.in], 1.0) +# NOTE: this file is not actually used. You need to edit configure as well! +N2N_VERSION_SHORT=`grep N2N_VERSION_SHORT ../../Makefile | head -1| cut -d "=" -f 2` +GIT_COMMITS=`grep GIT_COMMITS ../../Makefile | head -1| cut -d "=" -f 2` + MACHINE=`uname -m` SHORT_MACHINE=`uname -m | cut -b1-3` if test $MACHINE = "x86_64"; then EXTN="amd64" else - if test $SHORT_MACHINE = "arm"; then - EXTN="armhf" + if test $SHORT_MACHINE = "aar"; then + EXTN="arm64" EXTRA_DEPS="" else - if test $SHORT_MACHINE = "mip"; then - EXTN="mips" + if test $SHORT_MACHINE = "arm"; then + EXTN="armhf" EXTRA_DEPS="" - else - EXTN="i386" + else + if test $SHORT_MACHINE = "mip"; then + EXTN="mips" + EXTRA_DEPS="" + else + EXTN="i386" + fi fi fi fi @@ -24,6 +33,8 @@ DATE=`date -R` AC_SUBST(APP) AC_SUBST(MACHINE) +AC_SUBST(N2N_VERSION_SHORT) +AC_SUBST(GIT_COMMITS) AC_SUBST(EXTN) AC_SUBST(DATE)