1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
#!/bin/bash
#
# libexplain - a library of system-call-specific strerror replacements
# Copyright (C) 2013 Peter Miller
# Written by Peter Miller <pmiller@opensource.org.au>
#
# 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 <http://www.gnu.org/licenses/>.
#
set -x
tarball="$1";
echo "tarball='$tarball'"
if [ -z "$tarball" ]
then
echo "Usage: $0 <tarball>"
#exit 1
tarball=$( aesub 'web-site/${project}.tar.gz' | sed 's|[.]|-|' )
fi
project_name=$( aesub '${project trunk_name}' )
DH_VERBOSE=1;
export DH_VERBOSE;
dvsn=$( aesub '${change debian-version}' );
echo "dvsn='$dvsn'";
vsn=$( aesub '${change version}' );
echo "vsn='$vsn'";
neutered_tarball="${project_name}-${dvsn}.orig.tar.gz";
#
# We fake the .orig.tar.gz file to not have a debian/ directory,
# by filtering it out with tardy(1). This silences a PITA lintian(1)
# warning, for no real benefit.
#
rm -rf web-site/debian
mkdir -p web-site/debian
tardy -rp=1 \
-exclude 'debian/*' \
-p=${project_name}-${dvsn} \
$tarball \
web-site/debian/$neutered_tarball;
user=$( bin/test_user );
key=;
if [ $user = archives ]
then
key=-k19CEC7D5
else
key="-us -uc"
fi
unset GPG_AGENT_INFO
echo Options Indexes > web-site/debian/.htaccess
# build the actual debian package
mkdir -p web-site/debian;
tar xzf $tarball -C web-site/debian
(
cd web-site/debian/$(basename $tarball .tar.gz)
ls -lA
dpkg-buildpackage -sgpg $key -sa
test $? -ne 0 && exit 1
codename=$( gawk -F= '/CODENAME/{print $2}' /etc/lsb-release )
#debuild $key -sa -changes-option\=-DDistribution\=$codename
#test $? -ne 0 && exit 1
)
# Run Lintian o fix errors.
# The SNR is pretty shabby.
(
cd web-site/debian;
lintian -iIv --pedantic *.changes
)
exit 0
# vim: set ts=8 sw=4 et :
|