Patchwork [16,of,22] dockerrpm: prepare source outside docker and just run rpmbuild inside docker

login
register
mail settings
Submitter Mads Kiilerich
Date May 20, 2014, 2:10 a.m.
Message ID <9bb7bfeec498683597b1.1400551811@mk-desktop>
Download mbox | patch
Permalink /patch/4838/
State Superseded
Commit bb9a06d14857158d82ee5c7b3ac47d3d429da5be
Headers show

Comments

Mads Kiilerich - May 20, 2014, 2:10 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1400551681 -7200
#      Tue May 20 04:08:01 2014 +0200
# Node ID 9bb7bfeec498683597b167d0aa55422f1c36fc8a
# Parent  faa57fbb78d29a730fa2764fec50211dfc70c5b4
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
@@ -27,5 +27,10 @@  cat $DFILE
 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 $1; cp build/$1/* /hg/build/$1/"
+
+RPMBUILD=$ROOTDIR/build/$1
+contrib/buildrpm --rpmbuilddir $RPMBUILD --prepare
+
+DSHARED=/mnt/shared
+$DOCKER run -u $DBUILDUSER --rm -v $RPMBUILD:$DSHARED $CONTAINER \
+    rpmbuild --define "_topdir $DSHARED" -ba $DSHARED/SPECS/mercurial.spec --clean