-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile.am
71 lines (58 loc) · 2.29 KB
/
Makefile.am
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
SUBDIRS = lib python tests include ruby apidoc
# Automatic update of libtool.
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status libtool
bin_PROGRAMS = satyr
satyr_CFLAGS = -Wall -Iinclude -Ilib $(GLIB_CFLAGS) $(JSON_CFLAGS)
satyr_SOURCES = satyr.c
satyr_LDADD = lib/libsatyr.la
man_MANS = satyr.1
EXTRA_DIST = \
satyr.1.in \
satyr-version
dist_doc_DATA = README.md
satyr.1: satyr.1.in
sed -e "s,\@PACKAGE_STRING\@,$(PACKAGE_STRING),g" $< > $@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = satyr.pc
DISTCLEANFILES = $(pkgconfig_DATA)
EXTRA_DIST += satyr.pc.in
EXTRA_DIST += autogen.sh RELEASE
#UPLOAD_URI = user@fedorahosted.org:abrt
#.PHONY: upload
#upload:
# make dist
# scp $(distdir).tar.gz $(UPLOAD_URI)
RPM_DIRS = --define "_sourcedir `pwd`" \
--define "_rpmdir `pwd`/build" \
--define "_specdir `pwd`" \
--define "_builddir `pwd`/build" \
--define "_srcrpmdir `pwd`/build"
EXTRA_DIST += satyr.spec.in
rpm: dist satyr.spec
rpmbuild $(RPM_DIRS) $(RPM_FLAGS) -ba satyr.spec
srpm: dist satyr.spec
rpmbuild $(RPM_DIRS) -bs satyr.spec
.PHONY: release-minor
release-minor:
OLD_VER=$$(git describe --tags --match "[0-9]*" --abbrev=0 HEAD 2>/dev/null); \
MAJOR_VER=$$(echo $$OLD_VER | cut -d. -f 1); \
MINOR_VER=$$(echo $$OLD_VER | cut -d. -f 2); \
$(MAKE) release OLD_VER=$$OLD_VER NEW_VER="$$MAJOR_VER.$$((MINOR_VER+1))"
.PHONY: release-major
release-major:
OLD_VER=$$(git describe --tags --match "[0-9]*" --abbrev=0 HEAD 2>/dev/null); \
MAJOR_VER=$$(echo $$OLD_VER | cut -d. -f 1); \
$(MAKE) release OLD_VER=$$OLD_VER NEW_VER="$$((MAJOR_VER+1)).0"
.PHONY: release
release:
echo "* $$(LC_TIME='en_US.UTF-8' date +'%a %b %d %Y') $$(git config --get user.name) <$$(git config --get user.email)> $$NEW_VER-1" | sort > /tmp/changelog.tmp; \
git log --oneline $$OLD_VER..HEAD | awk '{$$1=""; if (a[$$0]++ == 0) print "-" $$0} END {print ""}' | grep -v -e "- Merge" -e "- testsuite:" -e "- make:" >> /tmp/changelog.tmp; \
sed "$$(grep -n %changelog satyr.spec.in | cut -f1 -d: | head -1)"'r /tmp/changelog.tmp' -i satyr.spec.in; \
sed 's|DEF_VER=.*$$|DEF_VER='$$NEW_VER'|' -i gen-version; \
git add gen-version satyr.spec.in; \
git commit -s -m "Release $$NEW_VER"; \
git tag "$$NEW_VER"; \
echo -n "$$NEW_VER" > satyr-version
autoconf --force
$(MAKE) dist