contrib/builddeb
changeset 24972 56c64c91b429
parent 24971 ab75baaf81d5
child 26090 e5f2a2a095cb
equal deleted inserted replaced
24971:ab75baaf81d5 24972:56c64c91b429
     1 #!/bin/sh -e
     1 #!/bin/sh -e
     2 #
     2 #
     3 # Build a Mercurial debian package from the current repo
     3 # Build a Mercurial debian package from the current repo
     4 #
     4 #
     5 # Tested on Jessie (stable as of original script authoring.)
     5 # Tested on Jessie (stable as of original script authoring.)
       
     6 
       
     7 . $(dirname $0)/packagelib.sh
     6 
     8 
     7 BUILD=1
     9 BUILD=1
     8 DEBBUILDDIR="$PWD/debbuild"
    10 DEBBUILDDIR="$PWD/debbuild"
     9 while [ "$1" ]; do
    11 while [ "$1" ]; do
    10     case "$1" in
    12     case "$1" in
    32 if [ ! -d .hg ]; then
    34 if [ ! -d .hg ]; then
    33     echo 'You are not inside a Mercurial repository!' 1>&2
    35     echo 'You are not inside a Mercurial repository!' 1>&2
    34     exit 1
    36     exit 1
    35 fi
    37 fi
    36 
    38 
    37 # build local hg and use it
    39 gethgversion
    38 python setup.py build_py -c -d .
       
    39 HG="$PWD/hg"
       
    40 
       
    41 $HG version > /dev/null || { echo 'abort: hg version failed!'; exit 1 ; }
       
    42 
       
    43 hgversion=`$HG version | sed -ne 's/.*(version \(.*\))$/\1/p'`
       
    44 
       
    45 if echo $hgversion | grep -- '-' > /dev/null 2>&1; then
       
    46     # nightly build case, version is like 1.3.1+250-20b91f91f9ca
       
    47     version=`echo $hgversion | cut -d- -f1`
       
    48     release=`echo $hgversion | cut -d- -f2 | sed -e 's/+.*//'`
       
    49 else
       
    50     # official tag, version is like 1.3.1
       
    51     version=`echo $hgversion | sed -e 's/+.*//'`
       
    52     release='0'
       
    53 fi
       
    54 
    40 
    55 cp -r $PWD/contrib/debian $DEBBUILDDIR/DEBIAN
    41 cp -r $PWD/contrib/debian $DEBBUILDDIR/DEBIAN
    56 chmod -R 0755 $DEBBUILDDIR/DEBIAN
    42 chmod -R 0755 $DEBBUILDDIR/DEBIAN
    57 
    43 
    58 control=$DEBBUILDDIR/DEBIAN/control
    44 control=$DEBBUILDDIR/DEBIAN/control