view contrib/packaging/dockerrpm @ 40596:252396a6a3f2

help: merge section about uisetup() and extsetup() They are technically the same callback, called only once per process. The section name "ui setup" is confusing, so shouldn't be used.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 12 Nov 2018 22:26:24 +0900
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"