#!/bin/sh # maintained in git at ssh://git.mdcc.cx/git/ad1810-stuff.git # ( view recent version online at # http://mdcc.cx/git/wd/ad1810-stuff/scripts/a1-build-deb-ez ) # Copyright (C) 2016 Tilburg University http://www.uvt.nl/ # Author: Joost van Baal-Ilić # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # a1-build-deb-ez -- build a .deb from an upstream source and a debian # directory, the "easy" way. # to be called from a directory holding a file debian/changelog # based upon # https://svn.uvt.nl/its-id/trunk/sources/deb-accountchecker/engage # used by: #svn/its-id/sources/ : # #deb-accountchecker/debian #pwdmodifier/deb-gatekeeper/debian #deb-ldapbrowser/debian # # #( both # #pwdmodifier/libpwdmodifier/debian # #and # #libpwdmodifier/debian # #??? ) # uses tar.xz or runs ./bootstrap && ./configure && make distcheck # runs debuild set -ex opwd=`pwd` source=$( dpkg-parsechangelog --show-field Source ) debian_version=$( dpkg-parsechangelog --show-field Version ) # e.g. 1.4-1 # FIXME we do not support epochs upstream_version=$( echo $debian_version | sed 's/-.*$//' ) upstream_txz=${source}-${upstream_version}.tar.xz upstream_path=$opwd/../$source upstream_txz_path=$upstream_path/$upstream_txz ##tmp=$(mktemp --tmpdir=/dev/shm -d) # comment this line to debug ## trap 'rm -rf -- "$tmp"' INT QUIT EXIT #svn=$HOME/sources/deb-ldapbrowser #svn=https://svn.uvt.nl/its-id/trunk/sources/accountchecker #svn export $svn $tmp/svn ##cd $tmp if test -f $upstream_txz_path then echo found $upstream_txz_path, reusing it else echo File $upstream_txz_path not found, please make sure it is available. echo Giving up. exit 1 fi # this code only works if upstream uses to ship a NEWS file... if false then # generating $upstream_txz_path cd $upstream_path # AC_INIT([accountchecker], [1.4]) ### FAIL upstream_upstream_version=$(grep AC_INIT configure.ac | sed 's/^[^ ]*, \[\([^\]]*\)\])$/\1/') upstream_upstream_version=$(egrep '^[0-9]+' NEWS | \ sed 's/^\([^ ]*\) .*$/\1/' | head -1) if test $upstream_upstream_version = $upstream_version then cat <