summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Winter <mwinter@opensourcerouting.org>2017-04-28 08:41:04 +0200
committerMartin Winter <mwinter@opensourcerouting.org>2017-04-28 10:48:51 +0200
commit8ccfe8f8752a34ad3a1c85f0d29992de666a9c03 (patch)
tree708ba90ad7e818f22c11660ab27d6cf7e45e374a
parentsnapcraft: Fix missing files in "make dist" target (diff)
downloadfrr-8ccfe8f8752a34ad3a1c85f0d29992de666a9c03.tar.xz
frr-8ccfe8f8752a34ad3a1c85f0d29992de666a9c03.zip
snapcraft: Add support for extra version information
- frr.version snap command will now show the contents of extra_version_info.txt in addition to the zebra --version output Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
-rw-r--r--snapcraft/Makefile.am1
-rw-r--r--snapcraft/README.snap_build.md9
-rw-r--r--snapcraft/extra_version_info.txt0
-rw-r--r--snapcraft/scripts/Makefile2
-rw-r--r--snapcraft/scripts/show_version6
-rw-r--r--snapcraft/snapcraft.yaml.in3
6 files changed, 18 insertions, 3 deletions
diff --git a/snapcraft/Makefile.am b/snapcraft/Makefile.am
index 2ec39ce5b..a8220670d 100644
--- a/snapcraft/Makefile.am
+++ b/snapcraft/Makefile.am
@@ -1,6 +1,7 @@
EXTRA_DIST = snapcraft.yaml \
README.snap_build.md \
README.usage.md \
+ extra_version_info.txt \
scripts \
defaults \
helpers \
diff --git a/snapcraft/README.snap_build.md b/snapcraft/README.snap_build.md
index e1f2ce82d..eeee6a17a 100644
--- a/snapcraft/README.snap_build.md
+++ b/snapcraft/README.snap_build.md
@@ -12,7 +12,12 @@ which uses earlier versions of snaps)
git clone https://github.com/frrouting/frr.git
cd frr
-3. Run Bootstrap and make distribution tar.gz
+3. (Optional) Add extra version information to
+ `snapcraft/extra_version_info.txt`. Information in this file will
+ be displayed with the frr.version command (simple `cat` after
+ the display of the `zebra --version` output)
+
+4. Run Bootstrap and make distribution tar.gz
./bootstrap.sh
./configure --with-pkg-extra-version=-MySnapVersion
@@ -25,7 +30,7 @@ which uses earlier versions of snaps)
This will build `frr-something.tar.gz` - the distribution tar and
the snapcraft/snapcraft.yaml with the matching version number
-4. Create snap
+5. Create snap
cd snapcraft
snapcraft
diff --git a/snapcraft/extra_version_info.txt b/snapcraft/extra_version_info.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/snapcraft/extra_version_info.txt
diff --git a/snapcraft/scripts/Makefile b/snapcraft/scripts/Makefile
index 2a60d4d65..966623d11 100644
--- a/snapcraft/scripts/Makefile
+++ b/snapcraft/scripts/Makefile
@@ -13,3 +13,5 @@ install:
install -D -m 0755 ldpd-service $(DESTDIR)/bin/
install -D -m 0755 nhrpd-service $(DESTDIR)/bin/
install -D -m 0755 set-options $(DESTDIR)/bin/
+ install -D -m 0755 show_version $(DESTDIR)/bin/
+
diff --git a/snapcraft/scripts/show_version b/snapcraft/scripts/show_version
new file mode 100644
index 000000000..ca1c2aa28
--- /dev/null
+++ b/snapcraft/scripts/show_version
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+$SNAP/sbin/zebra --version
+$SNAP/bin/cat $SNAP/doc/extra_version_info.txt
+
+exit 0
diff --git a/snapcraft/snapcraft.yaml.in b/snapcraft/snapcraft.yaml.in
index b5fb24a36..2112e061d 100644
--- a/snapcraft/snapcraft.yaml.in
+++ b/snapcraft/snapcraft.yaml.in
@@ -17,7 +17,7 @@ apps:
- network-bind
- network-control
version:
- command: sbin/zebra --version
+ command: bin/show_version
readme:
command: bin/cat $SNAP/doc/README.usage.md
zebra:
@@ -254,4 +254,5 @@ parts:
organize:
README.usage.md: doc/README.usage.md
README.snap_build.md: doc/README.snap_build.md
+ extra_version_info.txt: doc/extra_version_info.txt