contrib/packaging/dockerrpm
changeset 38004 1868db0d1515
parent 33597 a3ac1ea611ce
child 38008 b7cd9e94c259
equal deleted inserted replaced
38003:1335bbfb066f 38004:1868db0d1515
       
     1 #!/bin/bash -e
       
     2 
       
     3 . $(dirname $0)/dockerlib.sh
       
     4 
       
     5 BUILDDIR=$(dirname $0)
       
     6 export ROOTDIR=$(cd $BUILDDIR/../..; pwd)
       
     7 
       
     8 checkdocker
       
     9 
       
    10 PLATFORM="$1"
       
    11 shift # extra params are passed to buildrpm
       
    12 
       
    13 initcontainer $PLATFORM
       
    14 
       
    15 RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM
       
    16 contrib/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare $*
       
    17 
       
    18 DSHARED=/mnt/shared
       
    19 $DOCKER run -e http_proxy -e https_proxy -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \
       
    20     rpmbuild --define "_topdir $DSHARED" -ba $DSHARED/SPECS/mercurial.spec --clean
       
    21 
       
    22 $DOCKER run -e http_proxy -e https_proxy -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \
       
    23     createrepo $DSHARED
       
    24 
       
    25 cat << EOF > $RPMBUILDDIR/mercurial.repo
       
    26 # Place this file in /etc/yum.repos.d/mercurial.repo
       
    27 [mercurial]
       
    28 name=Mercurial packages for $PLATFORM
       
    29 # baseurl=file://$RPMBUILDDIR/
       
    30 baseurl=http://hg.example.com/build/$PLATFORM/
       
    31 skip_if_unavailable=True
       
    32 gpgcheck=0
       
    33 enabled=1
       
    34 EOF
       
    35 
       
    36 echo
       
    37 echo "Build complete - results can be found in $RPMBUILDDIR"