#! /bin/bash # # Wrapper script for running debuild to build this package. # # export DEBGCC=10 # # Set DEBGCC to use a non-default version of gcc set -e shopt -s extglob eval `courierauthconfig --configfiles` f=`cd .. && ls @PACKAGE@-@VERSION@.tar* | sed -n 1p` ext=`echo $f | tr '.' '\012' | tail -1` rm -rf deb mkdir deb cp ../$f deb/`echo $f | sed 's/@PACKAGE@-/@PACKAGE@_/;s/.tar./.orig.tar./'` cd deb tar xf * cd @PACKAGE@-@VERSION@ cp -pr packaging/debian . if test "$DEBGCC" = "" then DEBGCC=`readlink /usr/bin/gcc | sed 's/gcc-//'` case "$DEBGCC" in [1-9]*([0-9])) ;; *) echo "Cannot determine gcc version" exit 1 ;; esac fi if test "$DEBGCC" = "default" then DEBGCC="" else DEBGCC="-$DEBGCC" fi # Ubuntu 20 MIME_SUPPORT="mailcap, media-types" if test "`apt-cache search mailcap`" = "" then MIME_SUPPORT="mime-support" fi if test "`apt-cache search media-types`" = "" then MIME_SUPPORT="mime-support" fi for f in debian/rules debian/control do sed " s~%DEBGCC%~$DEBGCC~g s/%MAILUSER%/$mailuser/g s/%MAILGROUP%/$mailgroup/g s/%MIME_SUPPORT%/$MIME_SUPPORT/g " $f.tmp mv $f.tmp $f done chmod +x debian/rules debuild "$@" cd .. rm -rf @PACKAGE@-@VERSION@ echo "Built packages in the deb subdirectory."