Skip to content

Commit

Permalink
snapcraft: Add support for extra version information
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
mwinter-osr committed Apr 28, 2017
1 parent 0d4a6bd commit 8ccfe8f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions snapcraft/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
EXTRA_DIST = snapcraft.yaml \
README.snap_build.md \
README.usage.md \
extra_version_info.txt \
scripts \
defaults \
helpers \
Expand Down
9 changes: 7 additions & 2 deletions snapcraft/README.snap_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Empty file.
2 changes: 2 additions & 0 deletions snapcraft/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/

6 changes: 6 additions & 0 deletions snapcraft/scripts/show_version
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

$SNAP/sbin/zebra --version
$SNAP/bin/cat $SNAP/doc/extra_version_info.txt

exit 0
3 changes: 2 additions & 1 deletion snapcraft/snapcraft.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

0 comments on commit 8ccfe8f

Please sign in to comment.