correct debian and install routines
authorKonrad Rosenbaum <konrad@silmor.de>
Mon, 23 Apr 2012 14:22:13 +0000 (16:22 +0200)
committerKonrad Rosenbaum <konrad@silmor.de>
Mon, 23 Apr 2012 14:22:13 +0000 (16:22 +0200)
.gitignore
Makefile
configure
debian/control
debian/gencl [new file with mode: 0755]
debian/rules

index 323c57f..dc7256d 100644 (file)
@@ -3,3 +3,8 @@
 *.o
 ip6calc
 help.h
+debian/changelog
+.config.make
+debian/files
+debian/ip6calc.debhelper.log
+debian/ip6calc.substvars
index dbb50b5..d17a985 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,9 @@ distclean: clean
 include .config.make
 
 install:
+       $(INSTALL) -d $(DESTDIR)$(BINDIR)
        $(INSTALL) -t $(DESTDIR)$(BINDIR) -s ip6calc
        $(INSTALL) -t $(DESTDIR)$(BINDIR) ip4toip6
+       $(INSTALL) -d $(DESTDIR)$(DOCDIR)
        $(INSTALL) -m 644 -t $(DESTDIR)$(DOCDIR) help.txt
        $(INSTALL) -m 644 -t $(DESTDIR)$(DOCDIR) README
index df0cb45..01884a5 100755 (executable)
--- a/configure
+++ b/configure
@@ -7,7 +7,7 @@ mandir=/share/man
 prefix=/usr/local
 docdir=/share/doc/ip6calc
 
-TEMP=$(getopt -l prefix: -l mandir: -l bindir: -- "" "$@")
+TEMP=$(getopt -l prefix: -l mandir: -l bindir: -- "" "$@" 2>/dev/null )
 
 eval set -- "$TEMP"
 while true ; do
index be2a1fb..dff40c5 100644 (file)
@@ -1,8 +1,8 @@
 Source: ip6calc
 Section: unknown
 Priority: extra
-Maintainer: Konrad Rosenbaum <konrad@devant.devant.lan.local>
-Build-Depends: debhelper (>= 7.0.50~)
+Maintainer: Konrad Rosenbaum <konrad@silmor.de>
+Build-Depends: debhelper (>= 7.0.50~), git2cl, git
 Standards-Version: 3.8.4
 Homepage: http://silmor.de/ipv6.calc.php
 Vcs-Git: git://git.silmor.de/konrad/ip6calc.git
diff --git a/debian/gencl b/debian/gencl
new file mode 100755 (executable)
index 0000000..5f2e197
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+cl=debian/changelog
+
+test -x "`which git`" || {
+       echo 'Warning: cannot find git - do you have package git installed?' 2>&1
+       test -f $cl && {
+               echo cannot find svn, but $cl exists - accepting it
+       } || {
+               echo 'Error: cannot find git and' $cl 'does not exist - cannot proceed.' 1>&2
+               exit 1
+       }
+}
+test -d .git || {
+       echo 'Warning: this is not a GIT checkout, building in non-dev mode...' 2>&1
+       test -f $cl && {
+               echo 'Info:' $cl 'does exist, accepting it for now'
+       } || {
+               echo 'Error:' $cl 'does not exist, cannot proceed.' 2>&1
+               exit 1
+       }
+}
+
+echo Generating $cl ...
+
+REV=`git log -1 --date=short --pretty=format:%ad-%h`
+
+if test `git status --short -uno |wc -l` -gt 0 ; then
+ REV="$REV-modified1"
+fi
+
+echo "ip6calc ($REV) unstable; urgency=low" >$cl
+echo >>$cl
+echo "  Package Generated by" `whoami`@`hostname -f` `date -R`>>$cl
+echo >>$cl
+test -x "`which git2cl`" && {
+       git2cl | sed 's/^/  /' | sed 's/\t/   /' >>$cl
+} || {
+       echo 'Warning: cannot find git2cl - do you have it installed?' 2>&1
+       echo 'Warning:' $cl 'will have an empty body, this may not be what you wanted.' 2>&1
+       echo ' ' `date +%Y-%m-%d` `whoami` >>$cl
+       echo '    * built package without git log info available, sorry.' >>$cl
+}
+echo >>$cl
+echo -n ' -- Konrad Rosenbaum <konrad@silmor.de>  ' >>$cl
+date -R >>$cl
index b760bee..8be5096 100755 (executable)
@@ -11,3 +11,7 @@
 
 %:
        dh $@ 
+
+binary:
+       debian/gencl
+       dh binary