diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | debian/autogen.sh | 37 | ||||
-rw-r--r-- | debian/docs | 1 | ||||
-rwxr-xr-x | debian/rules | 41 | ||||
-rwxr-xr-x | mkcl | 9 | ||||
-rwxr-xr-x | mkversion | 10 | ||||
-rw-r--r-- | templates/show/version/node.def | 6 |
7 files changed, 68 insertions, 37 deletions
@@ -15,5 +15,4 @@ /INSTALL /Makefile.in /Makefile -/VERSION diff --git a/debian/autogen.sh b/debian/autogen.sh new file mode 100755 index 0000000..ff125d1 --- /dev/null +++ b/debian/autogen.sh @@ -0,0 +1,37 @@ +#!/bin/sh + + +if [ -d .git ] ; then +# generate GNU/Debian format ChangeLog from git log + + rm -f ChangeLog + + if which git2cl >/dev/null ; then + git-log --pretty --numstat --summary | git2cl >> ChangeLog + else + git-log --pretty=short >> ChangeLog + fi + +# append repository reference + + url=` git repo-config --get remote.origin.url` + test "x$url" = "x" && url=`pwd` + + branch=`git-branch --no-color | sed '/^\* /!d; s/^\* //'` + test "x$branch" = "x" && branch=master + + sha=`git log --pretty=oneline --no-color -n 1 | cut -c-8` + test "x$sha" = "x" && sha=00000000 + + echo "$url#$branch-$sha" >> ChangeLog + +fi + +rm -rf config +rm -f aclocal.m4 config.guess config.statusconfig.sub configure INSTALL + +autoreconf --force --install + +rm -f config.sub config.guess +ln -s /usr/share/misc/config.sub . +ln -s /usr/share/misc/config.guess . diff --git a/debian/docs b/debian/docs index 0e14f42..50bd824 100644 --- a/debian/docs +++ b/debian/docs @@ -1,3 +1,2 @@ NEWS README -VERSION diff --git a/debian/rules b/debian/rules index a0e3415..6c633e3 100755 --- a/debian/rules +++ b/debian/rules @@ -19,23 +19,29 @@ PKGDIR=$(CURDIR)/debian/$(PACKAGE) CFLAGS = -Wall -g +configure = ./configure +configure += --host=$(DEB_HOST_GNU_TYPE) +configure += --build=$(DEB_BUILD_GNU_TYPE) +configure += --prefix=/opt/vyatta +configure += --mandir=\$${prefix}/share/man +configure += --infodir=\$${prefix}/share/info +configure += CFLAGS="$(CFLAGS)" +configure += LDFLAGS="-Wl,-z,defs" + ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif +configure: + chmod +x debian/autogen.sh + debian/autogen.sh + config.status: configure dh_testdir - # Add here commands to configure the package. -ifneq "$(wildcard /usr/share/misc/config.sub)" "" - cp -f /usr/share/misc/config.sub config.sub -endif -ifneq "$(wildcard /usr/share/misc/config.guess)" "" - cp -f /usr/share/misc/config.guess config.guess -endif - ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/opt/vyatta --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" - + rm -f config.cache + $(configure) build: build-stamp @@ -44,14 +50,19 @@ build-stamp: config.status $(MAKE) touch $@ -clean: +clean: clean-patched + +# Clean everything up, including everything auto-generated +# at build time that needs not to be kept around in the Debian diff +clean-patched: dh_testdir dh_testroot - rm -f build-stamp - - test -f Makefile && $(MAKE) distclean || true - rm -f config.sub config.guess - + if test -f Makefile ; then $(MAKE) clean distclean ; fi + rm -f build-stamp + rm -f config.status config.sub config.guess config.log + rm -f aclocal.m4 configure Makefile.in Makefile INSTALL + rm -f etc/default/vyatta + rm -rf config dh_clean install: build @@ -1,9 +0,0 @@ -#!/bin/bash - -# generate GNU/Debian format ChangeLog from git log - -if type -t git2cl &>/dev/null ; then - git-log --pretty --numstat --summary | git2cl > ChangeLog -else - git-log --pretty=short > ChangeLog -fi diff --git a/mkversion b/mkversion deleted file mode 100755 index 03c1af1..0000000 --- a/mkversion +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# Make GIT version reference file - -url=$( git repo-config --get remote.origin.url ) -test -z "$url" && url=file://$PWD -branch=$( git-branch --no-color | sed '/^\* /!d; s/^\* //' ) -sha=$( git log --pretty=oneline --no-color -n 1 | cut -c-8 ) - -echo "${url}#${branch}-${sha}" > VERSION diff --git a/templates/show/version/node.def b/templates/show/version/node.def index fdeffc2..771e56e 100644 --- a/templates/show/version/node.def +++ b/templates/show/version/node.def @@ -1,2 +1,6 @@ help: "Show Vyatta version information" -run: cat /usr/share/doc/vyatta-*/VERSION /dev/null +run: for cl in /usr/share/doc/vyatta-*/changelog.gz ; do + pkg=${cl%/*} ; + echo -n ${pkg##*/} ; + gunzip $cl | tail -n1 ; + done |