view contrib/packaging/dockerrpm @ 40703:d5b300ec2e89

sparse-revlog: add a `index_get_start` function in C We are about to implement a native version of `slicechunktodensity`. For clarity, we introduce the helper functions first. This new function provides an efficient way to retrieve some of the information needed by `slicechunktodensity`.
author Boris Feld <boris.feld@octobus.net>
date Tue, 20 Nov 2018 14:49:18 +0000
parents e5916f1236f3
children 4c0d4bbdc395
line wrap: on
line source

#!/bin/bash -e

BUILDDIR=$(dirname $0)
export ROOTDIR=$(cd $BUILDDIR/../..; pwd)

PLATFORM="$1"
shift # extra params are passed to buildrpm

DOCKER=$($BUILDDIR/hg-docker docker-path)

CONTAINER=hg-docker-$PLATFORM

$BUILDDIR/hg-docker build $BUILDDIR/docker/$PLATFORM $CONTAINER

RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM
$ROOTDIR/contrib/packaging/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare $*

DSHARED=/mnt/shared
DBUILDUSER=build

$DOCKER run -e http_proxy -e https_proxy -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \
    rpmbuild --define "_topdir $DSHARED" -ba $DSHARED/SPECS/mercurial.spec --clean

$DOCKER run -e http_proxy -e https_proxy -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \
    createrepo $DSHARED

cat << EOF > $RPMBUILDDIR/mercurial.repo
# Place this file in /etc/yum.repos.d/mercurial.repo
[mercurial]
name=Mercurial packages for $PLATFORM
# baseurl=file://$RPMBUILDDIR/
baseurl=http://hg.example.com/build/$PLATFORM/
skip_if_unavailable=True
gpgcheck=0
enabled=1
EOF

echo
echo "Build complete - results can be found in $RPMBUILDDIR"