[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dealing with non-standard upstream packaging?

On Mon, Mar 07, 2005 at 01:53:55PM +0800, pabs wrote:
> Hi,
> I was wondering if there is any info about best practice in the
> situation where upstream source packaging doesn't use the standard
> foo-0.1.2/ inside of foo-0.1.2.tar.gz scheme?
> I suppose repacking the tarball/etc before using dh_make is enough, but
> is there a standard way to make this a bit more automated for new
> upstream releases?

  Here is my partial solution on how to do it automatically. You'll need
to build-depends on dpatch for that, and modify debian/rules 
accordingly. Some packages use dpatch anyway. Note that this doesn't
solves the missing version of the foo directory. I guess that one would
have to tweak the dpkg-source command and do some shell trickery for 
that. Alternatively some command line parameters should be supplied.

#! /bin/sh -e
## 01_testAndCreateOrigTarBall.dpatch 
## All lines beginning with `## DP:' are a description of the patch.
## DP: test and create the .orig.tar.gz. Note that the upstream source 
##     is distributed as a .zip file.

if [ $# -lt 1 ]; then
    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
    exit 1

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"

case "$1" in
    -patch) [ ! -f ../inadyn*.orig.tar.gz ]  &&  
                [ -f ../inadyn.*.zip ]  &&
                    fakeroot debian/rules clean  &&  cd ..  &&  
                        dpkg-source -b -su -W -Idebian inadyn inadyn
    -unpatch) ;;
        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
        exit 1;;

exit 0


Reply to: