Patchwork [07,of,10,v2] dockerrpm: prepare source outside docker and just run rpmbuild inside docker

login
register
mail settings
Submitter Mads Kiilerich
Date Aug. 31, 2014, 11:41 a.m.
Message ID <15c5b3318c2dde7527d0.1409485297@localhost.localdomain>
Download mbox | patch
Permalink /patch/5663/
State Accepted
Headers show

Comments

Mads Kiilerich - Aug. 31, 2014, 11:41 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1401452073 -7200
#      Fri May 30 14:14:33 2014 +0200
# Node ID 15c5b3318c2dde7527d0be80eed3e11139d34047
# Parent  621bc86e14384cba8819ba0d38882d84012b5e9a
dockerrpm: prepare source outside docker and just run rpmbuild inside docker

Simplifies the rpm build process.

We will use platform specific rpmbuild directories and will not clean them and
will drop the explicit copy to build directory.

Patch

diff --git a/contrib/dockerrpm b/contrib/dockerrpm
--- a/contrib/dockerrpm
+++ b/contrib/dockerrpm
@@ -31,5 +31,9 @@  echo RUN groupadd $DBUILDUSER -g `id -g`
 echo RUN useradd $DBUILDUSER -u `id -u` -g $DBUILDUSER
 ) | $DOCKER build --tag $CONTAINER -
 
-$DOCKER run -u $DBUILDUSER --rm -v $ROOTDIR:/hg $CONTAINER bash -c \
-    "cp -a hg hg-build; cd hg-build; make clean local $PLATFORM; cp packages/$PLATFORM/* /hg/packages/$PLATFORM/"
+RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM
+contrib/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare
+
+DSHARED=/mnt/shared
+$DOCKER run -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \
+    rpmbuild --define "_topdir $DSHARED" -ba $DSHARED/SPECS/mercurial.spec --clean