dockerrpm: prepare source outside docker and just run rpmbuild inside docker
authorMads Kiilerich <madski@unity3d.com>
Fri, 30 May 2014 14:14:33 +0200
changeset 22441 bb9a06d14857
parent 22440 cf7b5c011737
child 22442 77da9c03be60
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.
contrib/dockerrpm
--- a/contrib/dockerrpm	Fri May 30 14:14:33 2014 +0200
+++ b/contrib/dockerrpm	Fri May 30 14:14:33 2014 +0200
@@ -31,5 +31,9 @@
 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