/usr/bin/emgrip-build is in emdebian-grip 3.1.0.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | #!/bin/sh
set -e
# Copyright (C) 2009 Neil Williams <codehelp@debian.org>
#
# This package 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/>.
PROG=`basename $0`
usagehelp () {
cat <<EOF
$PROG - build wrapper script for Emdebian Grip
Syntax: $PROG [COMMAND] [DPKG-OPTIONS]
Commands:
--debuild: use debuild instead of dpkg-buildpackage
-a|--arch ARCH: cross-build using dpkg-buildpackage -a
-n|--dry-run: print the commands but do not build
-V|--vendor VENDOR: DEB_VENDOR support.
-?|-h|--help|-version: print this help message and exit
Simple wrapper for dpkg-buildpackage that runs the built package
through emgrip. This results in both types of packages existing in
the parent directory.
The DEB_VENDOR environment variable is supported as well as the
-V|--vendor command line option.
DPKG-OPTIONS
Any unrecognised options are passed directly to dpkg-buildpackage,
there is no need for '--' .
EOF
}
CROSS_OPTS="nocheck"
DBO=$DEB_BUILD_OPTIONS
OPTS=""
VENDOR=$DEB_VENDOR
CMD="dpkg-buildpackage"
TMPDIR="/tmp/"
DRY=""
DCMD="mv"
while [ -n "$1" ]; do
case "$1" in
--debuild)
CMD="debuild"
shift
;;
-a|--arch)
shift
ARCH=$1
shift
;;
-n|--dry-run)
DRY="echo "
DCMD="ls"
TMPDIR="../"
shift
;;
-V|--vendor)
shift
VENDOR=$1
shift
;;
--help|-h|-?)
usagehelp
exit;
;;
*)
OPTS="$OPTS $1"
shift
ARCH=`echo $OPTS|sed -e 's/-a\(.*\)/\1/'`
OPTS=`echo $OPTS|sed -e 's/-a\(.*\)//'`
;;
esac
done
if [ ! -f debian/control ]; then
echo "Unable to find debian/control."
exit 1
fi
SRC=`grep Source: debian/control|cut -d: -f2|tr -d ' '`
VER=
if [ -x "/usr/bin/parsechangelog" ]; then
VER=`parsechangelog|grep "^Version: "|cut -d: -f2|tr -d ' '`
else
VER=`dcontrol ${SRC}/:sid@source|grep "^Version:"|cut -d: -f2|tr -d ' '`
echo "dcontrol gives version as ${VER} - checking..."
echo "If this fails, install libparse-debianchangelog-perl"
if [ -n "$VER" ]; then
grep $VER debian/changelog
fi
fi
if [ -z "$VER" ]; then
echo "ERROR: Unable to get the version string."
exit 4
fi
if [ -z "$VENDOR" ]; then
echo "ERROR: Failed to parse DEB_VENDOR name."
echo "Either set DEB_VENDOR or pass the -V option."
exit 7
fi
BUILD_ARCH=`dpkg-architecture -qDEB_BUILD_ARCH_CPU`
echo "Checking vendor settings for $VENDOR"
DBO="$DBO "
DBOV=`dpkg-vendor --vendor $VENDOR --query grip-build-option 2>/dev/null || true`
DBO="$DBO $DBOV"
NAME=`dpkg-vendor --vendor $VENDOR --query vendor-name || true`
if [ -z "$NAME" -o -z "$DBO" ]; then
echo "ERROR: $VENDOR did not set a vendor-name or grip-build-option."
exit 9
fi
AROPT=""
if [ -z "${ARCH}" ]; then
ARCH=${BUILD_ARCH}
else
AROPT="-a${ARCH}"
DBO="${DBO} ${CROSS_OPTS}"
fi
echo "Using '$DBO' for $VENDOR on $ARCH"
export DEB_BUILD_OPTIONS="$DBO"
echo DEB_BUILD_OPTIONS=\"$DBO\"
$DRY $CMD -uc -us $AROPT $OPTS
if [ ! -f "../${SRC}_${VER}.dsc" ]; then
echo "Unable to find ../${SRC}_${VER}.dsc - failed to build?"
exit 2
fi
if [ -z $TEMPDIR ]; then
DIR=/tmp
else
DIR=$TEMPDIR
fi
export DEB_BUILD_OPTIONS="$DBO"
$DRY emgrip -o ${DIR} ../${SRC}_${VER}.dsc
if [ -f "${DIR}/${SRC}_${VER}_${ARCH}.changes" ];then
$DRY dcmd $DCMD ${DIR}/${SRC}_${VER}_${ARCH}.changes ../
fi
if [ -f "${DIR}/${SRC}_${VER}em1+t1_${ARCH}.changes" ];then
$DRY dcmd $DCMD ${DIR}/${SRC}_${VER}em1+t1_${ARCH}.changes ../
fi
|