| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- #!/bin/sh
- set -e
- version="1.3.0"; # This line modified by Makefile
- progname="`basename \"$0\"`"
- usageversion () {
- cat >&2 <<END
- Debian GNU/Linux dpkg-buildpackage $version. Copyright (C) 1996
- Ian Jackson. This is free software; see the GNU General Public Licence
- version 2 or later for copying conditions. There is NO warranty.
- Usage: dpkg-buildpackage [options]
- Options: -r<gain-root-command>
- -p<pgp-command>
- -us unsigned source
- -uc unsigned changes
- -b binary-only, do not build source } also passed to
- -B binary-only, no arch-indep files } dpkg-genchanges
- -v<version> changes since version <version> }
- -m<maint> maintainer for release is <maint> } only passed
- -C<descfile> changes are described in <descfile> } to dpkg-
- -si (default) src includes orig for rev. 0 or 1 } genchanges
- -sa uploaded src includes orig (default) }
- -sd uploaded src is diff and .dsc only }
- -h print this message
- END
- }
- rootcommand=''
- pgpcommand=pgp
- signsource=signfile
- signchanges=signfile
- binarytarget=binary
- sourcestyle=''
- version=''
- maint=''
- desc=''
- while [ $# != 0 ]
- do
- value="`echo x\"$1\" | sed -e 's/^x-.//'`"
- case "$1" in
- -h) usageversion; exit 0 ;;
- -r*) rootcommand="$value" ;;
- -p*) pgpcommand="$value" ;;
- -us) signsource=: ;;
- -uc) signchanges=: ;;
- -si) sourcestyle=-si ;;
- -sa) sourcestyle=-sa ;;
- -sd) sourcestyle=-sd ;;
- -b) binaryonly=-b ;;
- -B) binaryonly=-b; binarytarget=binary-arch ;;
- -v*) version="$value" ;;
- -m*) maint="$value" ;;
- -C*) descfile="$value" ;;
- *) echo >&2 "$progname: unknown option or argument $1"
- usageversion; exit 2 ;;
- esac
- shift
- done
- mustsetvar () {
- if [ "x$2" = x ]; then
- echo >&2 "$progname: unable to determine $3"
- exit 1
- else
- echo "$progname: $3 is $2"
- eval "$1=\"\$2\""
- fi
- }
- curd="`pwd`"
- dirn="`basename \"$curd\"`"
- mustsetvar package "`dpkg-parsechangelog | sed -n 's/^Source: //p'`" "source package"
- mustsetvar version "`dpkg-parsechangelog | sed -n 's/^Version: //p'`" "source version"
- mustsetvar arch "`dpkg --print-architecture`" "build architecture"
- pv="${package}_${version}"
- pva="${package}_${version}_${arch}"
- signfile () {
- $pgpcommand -fast <"../$1" >"../$1.asc"
- mv -- "../$1.asc" "../$1"
- }
- set -- $binaryonly
- if [ -n "$maint" ]; then set -- "$@" "-m$maint" ; fi
- if [ -n "$version" ]; then set -- "$@" "-v$version" ; fi
- if [ -n "$desc" ]; then set -- "$@" "-C$desc" ; fi
- set -x
- $rootcommand debian/rules clean
- if [ x$binaryonly = x ]; then
- cd ..; dpkg-source -b "$dirn"; cd "$dirn"
- fi
- debian/rules build
- $rootcommand debian/rules $binarytarget
- $signsource "$pv.dsc"
- dpkg-genchanges $binaryonly $sourcestyle >../"$pva.changes"
- $signchanges "$pva.changes"
|