1# qqwing - Sudoku solver and generator
2# Copyright (C) 2014 Stephen Ostermiller
3#
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 2 of the License, or
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with this program; if not, write to the Free Software Foundation, Inc.,
16# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17#/bin/sh
18set -e
19
20version=`build/version.sh`
21tgz=qqwing-$version.tar.gz
22
23if ls target/*.deb &> /dev/null;
24then
25	file=`ls target/*.deb -1 | head -n 1`
26	newer=`find build/debian* target/$tgz -type f -newer $file`
27	if [ "z$newer" = "z" ]
28	then
29		exit 0
30	fi
31fi
32
33echo "Building debian package"
34rm -rf target/deb
35mkdir -p target/deb
36cp target/qqwing-$version.tar.gz target/deb/qqwing_$version.orig.tar.gz
37cd target/deb
38tar xfz qqwing_$version.orig.tar.gz
39cd qqwing-$version
40export DEBEMAIL='debian@ostermiller.org'
41export DEBFULLNAME='Stephen Ostermiller'
42
43debuild -us -uc
44
45cd ../../..
46cp target/deb/qqwing*.deb target/
47ls target/*.deb
48