File: release.mk

package info (click to toggle)
pcs 0.12.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,580 kB
  • sloc: python: 228,655; xml: 20,710; ruby: 13,336; makefile: 1,554; sh: 485
file content (90 lines) | stat: -rw-r--r-- 2,016 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# to build official release tarballs, handle tagging and publish.

project = pcs

deliverables = $(project)-$(version).sha256 \
               $(project)-$(version).tar.bz2 \
               $(project)-$(version).tar.gz \
               $(project)-$(version).tar.xz

changelogfile = CHANGELOG.md

.PHONY: all
all: tag tarballs


.PHONY: checks
checks:
ifeq (,$(version))
	@echo ERROR: need to define version=
	@exit 1
endif
	@if [ ! -d .git ]; then \
		echo This script needs to be executed from top level cluster git tree; \
		exit 1; \
	fi
	@if [ -n "$$(git status --untracked-files=no --porcelain 2>/dev/null)" ]; then \
		echo Stash or rollback the uncommitted changes in git first; \
		exit 1; \
	fi


.PHONY: setup
setup: checks
	./autogen.sh
	./configure $(configure_options)
	$(MAKE) maintainer-clean


.PHONY: tag
tag: setup ./tag-$(version)

tag-$(version):
ifeq (,$(release))
	@echo Building test release $(version), no tagging
	echo '$(version)' > .tarball-version
else
	# following will be captured by git-version-gen automatically
	git tag -a -m "v$(version) release" v$(version) HEAD
	@touch $@
endif


.PHONY: tarballs
tarballs: tag
	./autogen.sh
	./configure $(configure_options)
	$(MAKE) distcheck "DISTCHECK_CONFIGURE_FLAGS=$(configure_options)"


.PHONY: sha256
sha256: $(project)-$(version).sha256

$(deliverables): tarballs

$(project)-$(version).sha256:
	# checksum anything from deliverables except for in-prep checksums file
	sha256sum $(deliverables:$@=) | sort -k2 > $@


.PHONY: publish
publish:
ifeq (,$(release))
	@echo Building test release $(version), no publishing!
else
	git push --follow-tags origin
	@echo Hey you!  Yeah you, looking somewhere else!
	@echo Remember to notify cluster-devel/RH and users/ClusterLabs MLs.
endif


.PHONY: bump-changelog
bump-changelog: checks
	sed -i 's/\#\# \[Unreleased\]/\#\# \[$(version)\] - $(shell date +%Y-%m-%d)/' \
		$(changelogfile)
	git commit -a -m "Bumped to $(version)"


.PHONY: clean
clean:
	rm -rf $(project)* tag-* .tarball-version