#!/bin/bash # MIT License # # Copyright (c) 2018 Joost van Baal-Ilić # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # exit on errors set -e if test ! -f debian/control then echo "$0: file debian/control not found." exit 1 fi NAME=$(basename "${PWD}") rm -rf build mkdir -p build uscan --destdir=build --download-current-version ( cd build echo '***' "$0: starting build in" `pwd` TARDIR="$( tar tf $NAME-*.tar.?? | grep '/$' | sort | head -1 )" tar -xf "$NAME"-*.tar.?? cd "$TARDIR" cp -r ../../debian . # install build dependencies, build and sign FIXME package pdebuild echo '***' "$0: finished build in" `pwd` ", buildlog in .build" ) # add package to repository cp build/*.{deb,build,buildinfo,orig.tar.??,debian.tar.??,changes,dsc} \ /var/cache/pbuilder/apt-archive/ ( cd /var/cache/pbuilder/apt-archive/ dpkg-scanpackages . >Packages # bzip2 -kf Packages gzip -kf Packages dpkg-scansources . >Sources gzip -kf Sources echo '***' "$0: updated archive in" `pwd` )