summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJames Laska <jlaska@ansible.com>2014-06-20 16:04:10 -0400
committerJames Laska <jlaska@ansible.com>2014-06-20 16:09:02 -0400
commit411311495f9293d08af6a41c3c111d30e04a95d1 (patch)
tree40b4832e9579cf316f8e3587c1b07e4d70289edf /Makefile
parent1c3a654912f5058b527458eef5b94edf40ad43e4 (diff)
downloadansible-411311495f9293d08af6a41c3c111d30e04a95d1.tar.gz
Updated DEB build workflow
Updates to Makefile include: * add targets: deb-src, deb-src-upload, deb-upload * add variables to control DEB building: DEBUILD_OPTS, DPUT_OPTS, DEB_PPA, DEB_DIST, DEB_RELEASE * create deb files for all release values in DEB_DIST Several updates to packaging/debian/* * Updated control file * Whitespace/formatting of changelog Add deb-build to .gitignore
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile67
1 files changed, 62 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index ee216b263e..36973372ee 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,9 @@
#
# useful targets:
# make sdist ---------------- produce a tarball
+# make srpm ----------------- produce a SRPM
# make rpm ----------------- produce RPMs
+# make deb-src -------------- produce a DEB source
# make deb ------------------ produce a DEB
# make docs ----------------- rebuild the manpages (results are checked in)
# make tests ---------------- run the tests
@@ -45,6 +47,29 @@ else
DATE := $(shell date --utc --date="$(GIT_DATE)" +%Y%m%d%H%M)
endif
+# DEB build parameters
+DEBUILD_BIN ?= debuild
+DEBUILD_OPTS = --source-option="-I"
+DPUT_BIN ?= dput
+DPUT_OPTS =
+ifeq ($(OFFICIAL),yes)
+ DEB_RELEASE = 1ppa
+ # Sign OFFICIAL builds using 'DEBSIGN_KEYID'
+ # DEBSIGN_KEYID is required when signing
+ ifneq ($(DEBSIGN_KEYID),)
+ DEBUILD_OPTS += -k$(DEBSIGN_KEYID)
+ endif
+else
+ DEB_RELEASE = 0.git$(DATE)
+ # Do not sign unofficial builds
+ DEBUILD_OPTS += -uc -us
+ DPUT_OPTS += -u
+endif
+DEBUILD = $(DEBUILD_BIN) $(DEBUILD_OPTS)
+DEB_PPA ?= ppa
+# Choose the desired Ubuntu release: lucid precise saucy trusty
+DEB_DIST ?= unstable
+
# RPM build parameters
RPMSPECDIR= packaging/rpm
RPMSPEC = $(RPMSPECDIR)/ansible.spec
@@ -178,12 +203,44 @@ rpm: rpmcommon
@echo "#############################################"
debian: sdist
+ @for DIST in $(DEB_DIST) ; do \
+ mkdir -p deb-build/$${DIST} ; \
+ tar -C deb-build/$${DIST} -xvf dist/$(NAME)-$(VERSION).tar.gz ; \
+ cp -a packaging/debian deb-build/$${DIST}/$(NAME)-$(VERSION)/ ; \
+ sed -ie "s#^$(NAME) (\([^)]*\)) \([^;]*\);#ansible (\1-$(DEB_RELEASE)~$${DIST}) $${DIST};#" deb-build/$${DIST}/$(NAME)-$(VERSION)/debian/changelog ; \
+ done
+
deb: debian
- cp -r packaging/debian ./
- chmod 755 debian/rules
- fakeroot debian/rules clean
- fakeroot dh_install
- fakeroot debian/rules binary
+ @for DIST in $(DEB_DIST) ; do \
+ (cd deb-build/$${DIST}/$(NAME)-$(VERSION)/ && $(DEBUILD) -b) ; \
+ 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 "#############################################"
+
+deb-src: debian
+ @for DIST in $(DEB_DIST) ; do \
+ (cd deb-build/$${DIST}/$(NAME)-$(VERSION)/ && $(DEBUILD) -S) ; \
+ done
+ @echo "#############################################"
+ @echo "Ansible DEB artifacts:"
+ @for DIST in $(DEB_DIST) ; do \
+ echo deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}_source.changes ; \
+ done
+ @echo "#############################################"
+
+deb-upload: deb
+ @for DIST in $(DEB_DIST) ; do \
+ $(DPUT_BIN) $(DPUT_OPTS) $(DEB_PPA) deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}_amd64.changes ; \
+ done
+
+deb-src-upload: deb-src
+ @for DIST in $(DEB_DIST) ; do \
+ $(DPUT_BIN) $(DPUT_OPTS) $(DEB_PPA) deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}_source.changes ; \
+ done
# for arch or gentoo, read instructions in the appropriate 'packaging' subdirectory directory