diff options
author | Shane McDonald <shanemcd@users.noreply.github.com> | 2016-10-26 17:24:15 -0400 |
---|---|---|
committer | Matt Clay <matt@mystile.com> | 2016-10-26 14:24:15 -0700 |
commit | 4ae0d5b843703175405eaabb084c5d5e985abbd7 (patch) | |
tree | d2aecf756bfc860e498be5bb76f9c0e1866864fe /Makefile | |
parent | 4c9ded9cb7f123e39fd31f9062e3c1f33a27e6d9 (diff) | |
download | ansible-4ae0d5b843703175405eaabb084c5d5e985abbd7.tar.gz |
Build debs with pbuilder (#18165)
* Build debs with pbuilder
* Update README in packaging/debian
* Add Dockerfile for building debs
* Add local_deb makefile target - Allows users to build debs using locally installed dependencies. This was the `deb` target before moving to pbuilder.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -77,6 +77,12 @@ DEB_PPA ?= ppa # Choose the desired Ubuntu release: lucid precise saucy trusty DEB_DIST ?= unstable +# pbuilder parameters +PBUILDER_ARCH ?= amd64 +PBUILDER_CACHE_DIR = /var/cache/pbuilder +PBUILDER_BIN ?= pbuilder +PBUILDER_OPTS ?= --debootstrapopts --variant=buildd --architecture $(PBUILDER_ARCH) --debbuildopts -b + # RPM build parameters RPMSPECDIR= packaging/rpm RPMSPEC = $(RPMSPECDIR)/ansible.spec @@ -230,7 +236,23 @@ debian: sdist sed -ie "s|%VERSION%|$(VERSION)|g;s|%RELEASE%|$(DEB_RELEASE)|;s|%DIST%|$${DIST}|g;s|%DATE%|$(DEB_DATE)|g" deb-build/$${DIST}/$(NAME)-$(VERSION)/debian/changelog ; \ done -deb: debian +deb: deb-src + @for DIST in $(DEB_DIST) ; do \ + PBUILDER_OPTS="$(PBUILDER_OPTS) --distribution $${DIST} --basetgz $(PBUILDER_CACHE_DIR)/$${DIST}-$(PBUILDER_ARCH)-base.tgz --buildresult $(CURDIR)/deb-build/$${DIST}" ; \ + $(PBUILDER_BIN) create $${PBUILDER_OPTS} --othermirror "deb http://archive.ubuntu.com/ubuntu $${DIST} universe" ; \ + $(PBUILDER_BIN) update $${PBUILDER_OPTS} ; \ + $(PBUILDER_BIN) build $${PBUILDER_OPTS} deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}.dsc ; \ + done + @echo "#############################################" + @echo "Ansible DEB artifacts:" + @for DIST in $(DEB_DIST) ; do \ + echo deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}_amd64.changes ; \ + done + @echo "#############################################" + +# Build package outside of pbuilder, with locally installed dependencies. +# Install BuildRequires as noted in packaging/debian/control. +local_deb: debian @for DIST in $(DEB_DIST) ; do \ (cd deb-build/$${DIST}/$(NAME)-$(VERSION)/ && $(DEBUILD) -b) ; \ done |