build: initial support for in-tree autobuilding recipes
authorMatt Mackall <mpm@selenic.com>
Wed, 07 May 2014 17:58:13 -0500
changeset 21255 62a2749895e4
parent 21254 51e5c793a9f4
child 21256 750c7c14a637
build: initial support for in-tree autobuilding recipes
Makefile
contrib/docker/centos6
contrib/docker/fedora
contrib/dockerrpm
--- a/Makefile	Sun May 04 22:48:07 2014 -0700
+++ b/Makefile	Wed May 07 17:58:13 2014 -0500
@@ -132,6 +132,29 @@
 	msgmerge --no-location --update $@.tmp $^
 	mv -f $@.tmp $@
 
+# Packaging targets
+
+fedora:
+	mkdir -p build/fedora
+	echo y | contrib/buildrpm
+	cp rpmbuild/RPMS/*/* build/fedora
+	cp rpmbuild/SRPMS/* build/fedora
+	rm -rf rpmbuild
+
+docker-fedora:
+	mkdir -p build/fedora
+	contrib/dockerrpm fedora
+
+centos6:
+	mkdir -p build/centos6
+	echo y | contrib/buildrpm
+	cp rpmbuild/RPMS/*/* build/centos6
+	cp rpmbuild/SRPMS/* build/centos6
+
+docker-centos6:
+	mkdir -p build/centos6
+	contrib/dockerrpm centos6
+
 .PHONY: help all local build doc clean install install-bin install-doc \
 	install-home install-home-bin install-home-doc dist dist-notests tests \
-	update-pot
+	update-pot fedora docker-fedora
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/docker/centos6	Wed May 07 17:58:13 2014 -0500
@@ -0,0 +1,7 @@
+FROM centos
+RUN yum install -y gcc
+RUN yum install -y python-devel python-docutils
+RUN yum install -y make
+RUN yum install -y rpm-build
+RUN yum install -y gettext
+RUN yum install -y tar
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/docker/fedora	Wed May 07 17:58:13 2014 -0500
@@ -0,0 +1,6 @@
+FROM fedora
+RUN yum install -y gcc
+RUN yum install -y python-devel python-docutils
+RUN yum install -y make
+RUN yum install -y rpm-build
+RUN yum install -y gettext
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/dockerrpm	Wed May 07 17:58:13 2014 -0500
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+BUILDDIR=$(dirname $0)
+ROOTDIR=$(cd $BUILDDIR/..; pwd)
+
+if which docker >> /dev/null ; then
+  DOCKER=docker
+elif which docker.io >> /dev/null ; then
+  DOCKER=docker.io
+fi
+
+$DOCKER build --tag "hg-dockerrpm-$1" - < $BUILDDIR/docker/$1
+$DOCKER run --rm -v $ROOTDIR:/hg "hg-dockerrpm-$1" bash -c \
+    "cp -a hg hg-build; cd hg-build; make clean local $1; cp build/$1/* /hg/build/$1/"