dev/debian-build/dbuild
branchdebian
changeset 280 9a171c093f61
child 281 7d59a0f92c78
equal deleted inserted replaced
279:4651aae7b330 280:9a171c093f61
       
     1 #!/bin/sh
       
     2 
       
     3 set -e
       
     4 
       
     5 cd $(hg root)
       
     6 
       
     7 PACKAGE=$(dpkg-parsechangelog | sed -n 's/^Source: \(.*\)/\1/p')
       
     8 DEBIAN_VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: \(.*\)/\1/p')
       
     9 # Lazy, but hey
       
    10 UPSTREAM_VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: \(.*\)-[^-]*/\1/p')
       
    11 UPSTREAM=$(hg log --template '{node}' -r 'heads(ancestors(.) and branch(default))')
       
    12 BUILDDIR=$(pwd)/build/debian
       
    13 
       
    14 echo PACKAGE $PACKAGE
       
    15 echo DEBIAN_VERSION $DEBIAN_VERSION
       
    16 echo UPSTREAM_VERSION $UPSTREAM_VERSION
       
    17 echo UPSTREAM $UPSTREAM
       
    18 echo BUILDDIR $BUILDDIR
       
    19 
       
    20 rm -rf ${BUILDDIR}
       
    21 mkdir -p ${BUILDDIR}
       
    22 hg archive -X '.hg*' -t tgz -r ${UPSTREAM} \
       
    23    ${BUILDDIR}/${PACKAGE}_${UPSTREAM_VERSION}.orig.tar.gz
       
    24 hg st -mac0n -X '.hg*' | cpio -p -0 -d \
       
    25    ${BUILDDIR}/${PACKAGE}-${UPSTREAM_VERSION}
       
    26 
       
    27 cd ${BUILDDIR}/${PACKAGE}-${UPSTREAM_VERSION}
       
    28 #dpkg-buildpackage -kFD56DDC0
       
    29 dpkg-buildpackage
       
    30 cd ..
       
    31 lintian -i --pedantic -IE ${PACKAGE}_${DEBIAN_VERSION}_*.changes
       
    32 sudo pbuilder --build ${PACKAGE}_${DEBIAN_VERSION}.dsc 
       
    33