aboutsummaryrefslogtreecommitdiffstats
path: root/extras/rpm/Makefile
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-04-18 15:26:39 +0200
committerFlorin Coras <florin.coras@gmail.com>2017-04-19 20:16:14 +0000
commitc06eeb0e3c9c1a9fa8f913e2d785b03220bfdabd (patch)
tree7ce8ea3eb0aa68f102922868c08470ecb2515c97 /extras/rpm/Makefile
parentb59a7055524bae29a328958c493d0b600776dc27 (diff)
Fix "make dist" to include version number, docouple it from rpm packaging
Change-Id: If2f9976d668089026c97b897cf449bff09050631 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'extras/rpm/Makefile')
-rw-r--r--extras/rpm/Makefile30
1 files changed, 30 insertions, 0 deletions
diff --git a/extras/rpm/Makefile b/extras/rpm/Makefile
new file mode 100644
index 00000000..1dcbb203
--- /dev/null
+++ b/extras/rpm/Makefile
@@ -0,0 +1,30 @@
+# Copyright (c) 2017 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+TARBALL=$(shell realpath ../../build-root/vpp-latest.tar.xz)
+
+BASENAME=$(shell basename $(TARBALL) | sed -e s/.tar.\*//)
+VERSION=$(shell echo $(BASENAME) | cut -f2 -d-)
+RELEASE=$(shell echo $(BASENAME) | cut -f3- -d- | sed -e s/-/_/g)
+
+all:
+ @echo $(TARBALL)
+ mkdir -p SOURCES RPMS
+ cp $(TARBALL) SOURCES/vpp-latest.tar.xz
+ rpmbuild -bb \
+ --define "_topdir $(PWD)" \
+ --define "_version $(VERSION)" \
+ --define "_release $(RELEASE)" \
+ vpp.spec
+ mv $$(find RPMS -name \*.rpm -type f) .