Add make sync-version to keep changelog and main.go Version the same. Update docs. Cut 1.1.2-1
This commit is contained in:
11
Makefile
11
Makefile
@ -1,6 +1,6 @@
|
||||
PROG = govpp-snmp-agentx
|
||||
|
||||
.PHONY: build test clean pkg-deb
|
||||
.PHONY: build test clean pkg-deb sync-version
|
||||
|
||||
# Build the binary
|
||||
build:
|
||||
@ -17,6 +17,13 @@ clean:
|
||||
rm -rf debian/.debhelper debian/.gocache debian/go debian/$(PROG) debian/files debian/*.substvars debian/debhelper-build-stamp
|
||||
rm -f ../$(PROG)_*.deb ../$(PROG)_*.changes ../$(PROG)_*.buildinfo
|
||||
|
||||
# Sync version from debian/changelog to main.go
|
||||
sync-version:
|
||||
@echo "Syncing version from debian/changelog to main.go..."
|
||||
@VERSION=$$(head -1 debian/changelog | sed -n 's/.*(\([^)]*\)).*/\1/p'); \
|
||||
sed -i 's/^const Version = ".*"/const Version = "'"$$VERSION"'"/' src/main.go; \
|
||||
echo "Updated Version const to: $$VERSION"
|
||||
|
||||
# Build Debian package
|
||||
pkg-deb:
|
||||
pkg-deb: sync-version
|
||||
fakeroot dpkg-buildpackage -us -uc -b
|
||||
|
Reference in New Issue
Block a user