From cb9cadad578297ffd78fa8a33670bdf1ab669e7e Mon Sep 17 00:00:00 2001 From: Ed Warnicke Date: Tue, 8 Dec 2015 15:45:58 -0700 Subject: Initial commit of vpp code. Change-Id: Ib246f1fbfce93274020ee93ce461e3d8bd8b9f17 Signed-off-by: Ed Warnicke --- build-root/scripts/version | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 build-root/scripts/version (limited to 'build-root/scripts/version') diff --git a/build-root/scripts/version b/build-root/scripts/version new file mode 100755 index 00000000..9d236bc2 --- /dev/null +++ b/build-root/scripts/version @@ -0,0 +1,22 @@ +#!/bin/bash + +TAG=$(git describe | cut -d- -f1 | sed -e 's/^v//') +ADD=$(git describe | cut -s -d- -f2) +CMT=$(git describe --dirty --match 'v*'| cut -s -d- -f3,4) + +if [ "$1" = "rpm-version" ]; then + echo ${TAG} + exit +fi + +if [ "$1" = "rpm-release" ]; then + [ -z "${ADD}" ] && echo release && exit + echo ${ADD}~${CMT} + exit +fi + +if [ -n "${ADD}" ]; then + echo ${TAG}-${ADD}~${CMT} +else + echo ${TAG} +fi -- cgit 1.2.3-korg From 0e5e3c3b62f2e4edbd9a8cdaccd5ad838545dd00 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Mon, 25 Jan 2016 08:28:22 -0500 Subject: Fix rpm packaging bit-rot Change-Id: Ia710b0773984891ee18c6c0558cc09b984043e38 Signed-off-by: Dave Barach --- build-root/rpm/vpp.spec | 1 + build-root/scripts/version | 1 + 2 files changed, 2 insertions(+) (limited to 'build-root/scripts/version') diff --git a/build-root/rpm/vpp.spec b/build-root/rpm/vpp.spec index fbadf07c..85b1286c 100644 --- a/build-root/rpm/vpp.spec +++ b/build-root/rpm/vpp.spec @@ -113,6 +113,7 @@ sysctl --system %{_unitdir}/vpp.service /usr/bin/vpp* /usr/bin/svm* +/usr/bin/elftool %config /etc/sysctl.d/80-vpp.conf %config /etc/vpp/startup.conf diff --git a/build-root/scripts/version b/build-root/scripts/version index 9d236bc2..bbafb9bb 100755 --- a/build-root/scripts/version +++ b/build-root/scripts/version @@ -11,6 +11,7 @@ fi if [ "$1" = "rpm-release" ]; then [ -z "${ADD}" ] && echo release && exit + CMT=$(git describe --dirty --match 'v*'| cut -s -d- -f3,4 | sed 's/-/_/') echo ${ADD}~${CMT} exit fi -- cgit 1.2.3-korg From 4e6be6847fb9ccc45440e37d4343a68634915b23 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Mon, 16 May 2016 15:55:36 +0200 Subject: Add build number to VPP version if BUILD_NUMBER var is set Change-Id: I73ecc12224fdfb08b7aa6118761b368577ce33d5 Signed-off-by: Damjan Marion --- build-root/scripts/version | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'build-root/scripts/version') diff --git a/build-root/scripts/version b/build-root/scripts/version index bbafb9bb..bf7e3155 100755 --- a/build-root/scripts/version +++ b/build-root/scripts/version @@ -4,6 +4,10 @@ TAG=$(git describe | cut -d- -f1 | sed -e 's/^v//') ADD=$(git describe | cut -s -d- -f2) CMT=$(git describe --dirty --match 'v*'| cut -s -d- -f3,4) +if [ -n "${BUILD_NUMBER}" ]; then + BLD="~b${BUILD_NUMBER}" +fi + if [ "$1" = "rpm-version" ]; then echo ${TAG} exit @@ -12,12 +16,12 @@ fi if [ "$1" = "rpm-release" ]; then [ -z "${ADD}" ] && echo release && exit CMT=$(git describe --dirty --match 'v*'| cut -s -d- -f3,4 | sed 's/-/_/') - echo ${ADD}~${CMT} + echo ${ADD}~${CMT}${BLD} exit fi if [ -n "${ADD}" ]; then - echo ${TAG}-${ADD}~${CMT} + echo ${TAG}-${ADD}~${CMT}${BLD} else echo ${TAG} fi -- cgit 1.2.3-korg From 750c62548eb10e79ff35a963df248ccfb064ec24 Mon Sep 17 00:00:00 2001 From: Ed Warnicke Date: Tue, 31 May 2016 14:04:16 -0700 Subject: Fix build-root/scripts/version to not have spurious ~ Change-Id: Id28f134e3a4aa19c5756014d53004501db0d0c88 Signed-off-by: Ed Warnicke --- build-root/scripts/version | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'build-root/scripts/version') diff --git a/build-root/scripts/version b/build-root/scripts/version index bf7e3155..8724ced3 100755 --- a/build-root/scripts/version +++ b/build-root/scripts/version @@ -15,13 +15,12 @@ fi if [ "$1" = "rpm-release" ]; then [ -z "${ADD}" ] && echo release && exit - CMT=$(git describe --dirty --match 'v*'| cut -s -d- -f3,4 | sed 's/-/_/') - echo ${ADD}~${CMT}${BLD} + echo ${ADD}${CMT:+~${CMT}}${BLD} exit fi if [ -n "${ADD}" ]; then - echo ${TAG}-${ADD}~${CMT}${BLD} + echo ${TAG}-${ADD}${CMT:+~${CMT}}${BLD} else echo ${TAG} fi -- cgit 1.2.3-korg From 227fe26987738d69cdc58fbee0b2ccbecf3ae97b Mon Sep 17 00:00:00 2001 From: Ed Warnicke Date: Thu, 2 Jun 2016 17:38:22 -0500 Subject: VPP-107 Fix for mistake that breaks pkg-rpm in https://gerrit.fd.io/r/#/c/1338/ Change-Id: I8b7fffe24cbeb435b18faaada9ef1cea9fd93d39 Signed-off-by: Ed Warnicke --- build-root/scripts/version | 1 + 1 file changed, 1 insertion(+) (limited to 'build-root/scripts/version') diff --git a/build-root/scripts/version b/build-root/scripts/version index 8724ced3..84ee5dbe 100755 --- a/build-root/scripts/version +++ b/build-root/scripts/version @@ -15,6 +15,7 @@ fi if [ "$1" = "rpm-release" ]; then [ -z "${ADD}" ] && echo release && exit + CMT=$(git describe --dirty --match 'v*'| cut -s -d- -f3,4 | sed 's/-/_/') echo ${ADD}${CMT:+~${CMT}}${BLD} exit fi -- cgit 1.2.3-korg From 20a29c7b4d1b5b68112498bee21ee7f3fe123b13 Mon Sep 17 00:00:00 2001 From: Thomas F Herbert Date: Thu, 13 Oct 2016 18:36:50 -0400 Subject: VPP-498: Prepare vpp RPM packaging for use by downstream distros. Change spec to add new macros to get rid of relative dir reference and use vpp version. Store version string in .version to store metadata in dist archive. New script to create dist archive. Add dist and wipedist targets to Makefile for builds of source RPMs. Change-Id: I7cf0164f0cb094ec70f3dc323ed7fa2ee82bd902 Signed-off-by: Thomas F Herbert --- Makefile | 21 ++++++++++++++++++-- build-data/platforms.mk | 6 +++++- build-root/rpm/vpp.spec | 48 ++++++++++++++++++++++++++++------------------ build-root/scripts/verdist | 31 ++++++++++++++++++++++++++++++ build-root/scripts/version | 45 ++++++++++++++++++++++++++++++++++--------- 5 files changed, 120 insertions(+), 31 deletions(-) create mode 100755 build-root/scripts/verdist (limited to 'build-root/scripts/version') diff --git a/Makefile b/Makefile index 3a6c7834..98700864 100644 --- a/Makefile +++ b/Makefile @@ -167,10 +167,27 @@ define make @make -C $(BR) PLATFORM=$(PLATFORM) TAG=$(1) $(2) endef +$(BR)/scripts/.version: +ifneq ("$(wildcard /etc/redhat-release)","") + $(shell $(BR)/scripts/version rpm-string > $(BR)/scripts/.version) +else + $(shell $(BR)/scripts/version > $(BR)/scripts/.version) +endif + +dist: $(BR)/scripts/.version + $(MAKE) verstring=$(PLATFORM)-$(shell cat $(BR)/scripts/.version) prefix=$(PLATFORM) distversion + +distversion: $(BR)/scripts/.version + $(BR)/scripts/verdist ${BR} ${prefix}-$(shell $(BR)/scripts/version rpm-version) ${verstring} + mv $(verstring).tar.gz $(BR)/rpm + build: $(BR)/.bootstrap.ok $(call make,$(PLATFORM)_debug,vpp-install) -wipe: $(BR)/.bootstrap.ok +wipedist: + $(RM) $(BR)/scripts/.version $(BR)/rpm/*.tar.gz + +wipe: wipedist $(BR)/.bootstrap.ok $(call make,$(PLATFORM)_debug,vpp-wipe) rebuild: wipe build @@ -271,7 +288,7 @@ run-vat: pkg-deb: $(call make,$(PLATFORM),install-deb) -pkg-rpm: +pkg-rpm: dist $(call make,$(PLATFORM),install-rpm) ctags: ctags.files diff --git a/build-data/platforms.mk b/build-data/platforms.mk index 9d878151..16e61e3f 100644 --- a/build-data/platforms.mk +++ b/build-data/platforms.mk @@ -89,7 +89,11 @@ install-rpm: $(patsubst %,%-find-source,$(ROOT_PACKAGES)) $(ROOT_PACKAGES)) || exit 1; \ \ cd rpm ; \ + mkdir -p SOURCES ; \ + if test -f *.tar.gz ; then mv *.tar.gz SOURCES ; fi ; \ rpmbuild -bb --define "_topdir $$PWD" --define \ - "_install_dir $(INSTALL_PREFIX)$(ARCH)" vpp.spec ; \ + "_install_dir $(INSTALL_PREFIX)$(ARCH)" \ + --define "_mu_build_root_dir $(MU_BUILD_ROOT_DIR)" \ + vpp.spec ; \ mv $$(find RPMS -name \*.rpm -type f) .. diff --git a/build-root/rpm/vpp.spec b/build-root/rpm/vpp.spec index 8c4f4f05..7f0e2a34 100644 --- a/build-root/rpm/vpp.spec +++ b/build-root/rpm/vpp.spec @@ -1,5 +1,6 @@ -%define _vpp_install_dir ../%{_install_dir} -%define _vpp_build_dir ../build-tool-native +%define _mu_build_dir %{_mu_build_root_dir} +%define _vpp_install_dir %{_install_dir} +%define _vpp_build_dir build-tool-native %define _unitdir /lib/systemd/system %define _topdir %(pwd) %define _builddir %{_topdir} @@ -27,6 +28,8 @@ Release: %{_release} Requires: vpp-lib = %{_version}-%{_release}, net-tools, pciutils, python BuildRequires: systemd +Source: %{name}-%{_version}-%{_release}.tar.gz + %description This package provides VPP executables: vpp, vpp_api_test, vpp_json_test vpp - the vector packet engine @@ -76,6 +79,13 @@ Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release} %description python-api This package contains the python bindings for the vpp api +%prep +%setup -q -n %{name}-%{_version} + +%build +make bootstrap +make build-release + %pre # Add the vpp group groupadd -f -r vpp @@ -86,22 +96,22 @@ groupadd -f -r vpp # mkdir -p -m755 %{buildroot}%{_bindir} mkdir -p -m755 %{buildroot}%{_unitdir} -install -p -m 755 %{_vpp_install_dir}/*/bin/* %{buildroot}%{_bindir} -install -p -m 755 %{_vpp_build_dir}/vppapigen/vppapigen %{buildroot}%{_bindir} -install -p -m 755 ../../vppapigen/pyvppapigen.py %{buildroot}%{_bindir} +install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/*/bin/* %{buildroot}%{_bindir} +install -p -m 755 %{_mu_build_dir}/%{_vpp_build_dir}/vppapigen/vppapigen %{buildroot}%{_bindir} +install -p -m 755 %{_mu_build_dir}/../vppapigen/pyvppapigen.py %{buildroot}%{_bindir} # # configs # mkdir -p -m755 %{buildroot}/etc/vpp mkdir -p -m755 %{buildroot}/etc/sysctl.d -install -p -m 644 vpp.service %{buildroot}%{_unitdir} -install -p -m 644 ../../vpp/conf/startup.uiopcigeneric.conf %{buildroot}/etc/vpp/startup.conf -install -p -m 644 ../../vpp/conf/80-vpp.conf %{buildroot}/etc/sysctl.d +install -p -m 644 %{_mu_build_dir}/rpm/vpp.service %{buildroot}%{_unitdir} +install -p -m 644 %{_mu_build_dir}/../vpp/conf/startup.uiopcigeneric.conf %{buildroot}/etc/vpp/startup.conf +install -p -m 644 %{_mu_build_dir}/../vpp/conf/80-vpp.conf %{buildroot}/etc/sysctl.d # # libraries # mkdir -p -m755 %{buildroot}%{_libdir} -for file in $(find %{_vpp_install_dir}/*/lib* -type f -name '*.so.*.*.*' -print ) +for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/*/lib* -type f -name '*.so.*.*.*' -print ) do install -p -m 755 $file %{buildroot}%{_libdir} done @@ -116,7 +126,7 @@ done # Python bindings mkdir -p -m755 %{buildroot}%{python2_sitelib}/vpp_papi -for file in $(find %{_vpp_install_dir}/*/lib/python2.7/site-packages/ -type f -print | grep -v pyc | grep -v pyo) +for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/*/lib/python2.7/site-packages/ -type f -print | grep -v pyc | grep -v pyo) do install -p -m 666 $file %{buildroot}%{python2_sitelib}/vpp_papi/ done @@ -124,7 +134,7 @@ done # # devel # -for dir in $(find %{_vpp_install_dir}/*/include/ -maxdepth 0 -type d -print | grep -v dpdk) +for dir in $(find %{_mu_build_dir}/%{_vpp_install_dir}/*/include/ -maxdepth 0 -type d -print | grep -v dpdk) do for subdir in $(cd ${dir} && find . -type d -print) do @@ -137,16 +147,16 @@ do done mkdir -p -m755 %{buildroot}%{python2_sitelib}/jvppgen -install -p -m755 ../../vpp-api/java/jvpp/gen/jvpp_gen.py %{buildroot}/usr/bin -for i in $(ls ../../vpp-api/java/jvpp/gen/jvppgen/*.py); do +install -p -m755 %{_mu_build_dir}/../vpp-api/java/jvpp/gen/jvpp_gen.py %{buildroot}/usr/bin +for i in $(ls %{_mu_build_dir}/../vpp-api/java/jvpp/gen/jvppgen/*.py); do install -p -m666 ${i} %{buildroot}%{python2_sitelib}/jvppgen done; # sample plugin mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/sample -for file in $(cd %{_vpp_install_dir}/../../sample-plugin && find -type f -print) +for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../sample-plugin && find -type f -print) do - install -p -m 644 %{_vpp_install_dir}/../../sample-plugin/$file \ + install -p -m 644 %{_mu_build_dir}/%{_vpp_install_dir}/../../sample-plugin/$file \ %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/$file done @@ -156,15 +166,15 @@ done # mkdir -p -m755 %{buildroot}/usr/lib/vpp_plugins mkdir -p -m755 %{buildroot}/usr/lib/vpp_api_test_plugins -for file in $(cd %{_vpp_install_dir}/plugins/lib64/vpp_plugins && find -type f -print) +for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/plugins/lib64/vpp_plugins && find -type f -print) do - install -p -m 644 %{_vpp_install_dir}/plugins/lib64/vpp_plugins/$file \ + install -p -m 644 %{_mu_build_dir}/%{_vpp_install_dir}/plugins/lib64/vpp_plugins/$file \ %{buildroot}/usr/lib/vpp_plugins/$file done -for file in $(cd %{_vpp_install_dir}/plugins/lib64/vpp_api_test_plugins && find -type f -print) +for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/plugins/lib64/vpp_api_test_plugins && find -type f -print) do - install -p -m 644 %{_vpp_install_dir}/plugins/lib64/vpp_api_test_plugins/$file \ + install -p -m 644 %{_mu_build_dir}/%{_vpp_install_dir}/plugins/lib64/vpp_api_test_plugins/$file \ %{buildroot}/usr/lib/vpp_api_test_plugins/$file done diff --git a/build-root/scripts/verdist b/build-root/scripts/verdist new file mode 100755 index 00000000..9d1f1b5a --- /dev/null +++ b/build-root/scripts/verdist @@ -0,0 +1,31 @@ +#!/bin/bash + +# +# Add version to dist tarball. +# +BR=$1 +prefix=$2 +verstring=$3 +BASE=`pwd` + +git rev-parse 2> /dev/null +if [ $? == 0 ]; then + git archive --prefix=${prefix}/ HEAD | gzip -9 > ${verstring}.tar.gz +else + cd .. + tar -c ${prefix} | gzip -9 > ${verstring}.tar.gz + cp ${verstring}.tar.gz $BASE + cd $BASE +fi + +mkdir ${BASE}/tmp +cd ${BASE}/tmp +tar -xzf ${BASE}/${verstring}.tar.gz +rm ${BASE}/${verstring}.tar.gz + +cp ${BR}/scripts/.version ${BASE}/tmp/${prefix}/build-root/scripts +tar -c ${prefix} | gzip -9 > ${verstring}.tar.gz +mv ${verstring}.tar.gz ${BASE} + +cd ${BASE} +rm -rf tmp diff --git a/build-root/scripts/version b/build-root/scripts/version index 84ee5dbe..af447286 100755 --- a/build-root/scripts/version +++ b/build-root/scripts/version @@ -1,8 +1,32 @@ #!/bin/bash -TAG=$(git describe | cut -d- -f1 | sed -e 's/^v//') -ADD=$(git describe | cut -s -d- -f2) -CMT=$(git describe --dirty --match 'v*'| cut -s -d- -f3,4) +path=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P ) + +cd "$path" + +git rev-parse 2> /dev/null +if [ $? == 0 ]; then + vstring=$(git describe) +elif [ -f .version ]; then + vstring=$(cat .version) +else + if [ -f ../rpm/*.gz ]; then + vstring=$(ls ../rpm/*.gz) + else + exit 1 + fi +fi + +TAG=$(echo ${vstring} | cut -d- -f1 | sed -e 's/^v//') +ADD=$(echo ${vstring} | cut -s -d- -f2) + +git rev-parse 2> /dev/null +if [ $? == 0 ]; then + CMT=$(git describe --dirty --match 'v*'| cut -s -d- -f3,4) +else + CMT=$(echo ${vstring} | cut -s -d- -f3,4) +fi +CMTR=$(echo $CMT | sed 's/-/_/') if [ -n "${BUILD_NUMBER}" ]; then BLD="~b${BUILD_NUMBER}" @@ -15,13 +39,16 @@ fi if [ "$1" = "rpm-release" ]; then [ -z "${ADD}" ] && echo release && exit - CMT=$(git describe --dirty --match 'v*'| cut -s -d- -f3,4 | sed 's/-/_/') - echo ${ADD}${CMT:+~${CMT}}${BLD} + echo ${ADD}${CMTR:+~${CMTR}}${BLD} exit fi -if [ -n "${ADD}" ]; then - echo ${TAG}-${ADD}${CMT:+~${CMT}}${BLD} -else - echo ${TAG} + if [ -n "${ADD}" ]; then + if [ "$1" = "rpm-string" ]; then + echo ${TAG}-${ADD}${CMTR:+~${CMTR}}${BLD} + else + echo ${TAG}-${ADD}${CMT:+~${CMT}}${BLD} + fi + else + echo ${TAG} fi -- cgit 1.2.3-korg From 99c201964ab7514e55d66ad2ca5bbe68440bd75b Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Tue, 3 Jan 2017 19:56:43 +0100 Subject: fix version.h generation for out-of-tree builds Change-Id: Ic882f5aec74858a36533ed8cd61a7726947dceef Signed-off-by: Damjan Marion --- build-root/scripts/version | 55 +--------------------------------------------- src/scripts/version | 54 +++++++++++++++++++++++++++++++++++++++++++++ src/vpp.am | 4 ++-- 3 files changed, 57 insertions(+), 56 deletions(-) mode change 100755 => 120000 build-root/scripts/version create mode 100755 src/scripts/version (limited to 'build-root/scripts/version') diff --git a/build-root/scripts/version b/build-root/scripts/version deleted file mode 100755 index af447286..00000000 --- a/build-root/scripts/version +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash - -path=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P ) - -cd "$path" - -git rev-parse 2> /dev/null -if [ $? == 0 ]; then - vstring=$(git describe) -elif [ -f .version ]; then - vstring=$(cat .version) -else - if [ -f ../rpm/*.gz ]; then - vstring=$(ls ../rpm/*.gz) - else - exit 1 - fi -fi - -TAG=$(echo ${vstring} | cut -d- -f1 | sed -e 's/^v//') -ADD=$(echo ${vstring} | cut -s -d- -f2) - -git rev-parse 2> /dev/null -if [ $? == 0 ]; then - CMT=$(git describe --dirty --match 'v*'| cut -s -d- -f3,4) -else - CMT=$(echo ${vstring} | cut -s -d- -f3,4) -fi -CMTR=$(echo $CMT | sed 's/-/_/') - -if [ -n "${BUILD_NUMBER}" ]; then - BLD="~b${BUILD_NUMBER}" -fi - -if [ "$1" = "rpm-version" ]; then - echo ${TAG} - exit -fi - -if [ "$1" = "rpm-release" ]; then - [ -z "${ADD}" ] && echo release && exit - echo ${ADD}${CMTR:+~${CMTR}}${BLD} - exit -fi - - if [ -n "${ADD}" ]; then - if [ "$1" = "rpm-string" ]; then - echo ${TAG}-${ADD}${CMTR:+~${CMTR}}${BLD} - else - echo ${TAG}-${ADD}${CMT:+~${CMT}}${BLD} - fi - else - echo ${TAG} -fi diff --git a/build-root/scripts/version b/build-root/scripts/version new file mode 120000 index 00000000..8392c68b --- /dev/null +++ b/build-root/scripts/version @@ -0,0 +1 @@ +../../src/scripts/version \ No newline at end of file diff --git a/src/scripts/version b/src/scripts/version new file mode 100755 index 00000000..af447286 --- /dev/null +++ b/src/scripts/version @@ -0,0 +1,54 @@ +#!/bin/bash + +path=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P ) + +cd "$path" + +git rev-parse 2> /dev/null +if [ $? == 0 ]; then + vstring=$(git describe) +elif [ -f .version ]; then + vstring=$(cat .version) +else + if [ -f ../rpm/*.gz ]; then + vstring=$(ls ../rpm/*.gz) + else + exit 1 + fi +fi + +TAG=$(echo ${vstring} | cut -d- -f1 | sed -e 's/^v//') +ADD=$(echo ${vstring} | cut -s -d- -f2) + +git rev-parse 2> /dev/null +if [ $? == 0 ]; then + CMT=$(git describe --dirty --match 'v*'| cut -s -d- -f3,4) +else + CMT=$(echo ${vstring} | cut -s -d- -f3,4) +fi +CMTR=$(echo $CMT | sed 's/-/_/') + +if [ -n "${BUILD_NUMBER}" ]; then + BLD="~b${BUILD_NUMBER}" +fi + +if [ "$1" = "rpm-version" ]; then + echo ${TAG} + exit +fi + +if [ "$1" = "rpm-release" ]; then + [ -z "${ADD}" ] && echo release && exit + echo ${ADD}${CMTR:+~${CMTR}}${BLD} + exit +fi + + if [ -n "${ADD}" ]; then + if [ "$1" = "rpm-string" ]; then + echo ${TAG}-${ADD}${CMTR:+~${CMTR}}${BLD} + else + echo ${TAG}-${ADD}${CMT:+~${CMT}}${BLD} + fi + else + echo ${TAG} +fi diff --git a/src/vpp.am b/src/vpp.am index 1d07b90a..5128e8ac 100644 --- a/src/vpp.am +++ b/src/vpp.am @@ -55,8 +55,8 @@ vpp/app/version.h: @echo "#define VPP_BUILD_DATE \"$$(date)\"" > $@ @echo "#define VPP_BUILD_USER \"$$(whoami)\"" >> $@ @echo "#define VPP_BUILD_HOST \"$$(hostname)\"" >> $@ - @echo "#define VPP_BUILD_TOPDIR \"$$(git rev-parse --show-toplevel)\"" >> $@ - @echo "#define VPP_BUILD_VER \"$$(../../scripts/version)\"" >> $@ + @echo "#define VPP_BUILD_TOPDIR \"$$(cd $(srcdir) && git rev-parse --show-toplevel)\"" >> $@ + @echo "#define VPP_BUILD_VER \"$$($(srcdir)/scripts/version)\"" >> $@ # Generate a plugin configuration script. Misconfiguring a # plugin can cause very subtle problems. -- cgit 1.2.3-korg