-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile.am
120 lines (101 loc) · 3.44 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
EXTRA_DIST = autogen.sh \
.version make/release.mk \
make/git-version-gen make/gitlog-to-changelog \
m4/ax_prog_date.m4 m4/ax_prog_perl_modules.m4 \
anvil.conf $(SPEC).in \
README.md scancore.README watch_logs
AUTOMAKE_OPTIONS = foreign
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure depcomp \
config.guess config.sub missing install-sh \
autoheader automake autoconf libtool libtoolize \
ltmain.sh compile autoscan.log configure.scan
SPEC = $(PACKAGE_NAME).spec
TARFILES = $(PACKAGE_NAME)-$(VERSION).tar.bz2 \
$(PACKAGE_NAME)-$(VERSION).tar.gz \
$(PACKAGE_NAME)-$(VERSION).tar.xz
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = Anvil html journald.conf.d libvirt man ocf \
pxe scancore-agents scripts selinux share striker-ui \
striker-ui-api tools units
anvilconfdir = ${sysconfdir}/anvil
dist_anvilconf_DATA = anvil.conf
anvilconf_DATA = anvil.version
clean-local:
rm -rf $(SPEC) *.rpm $(TARFILES)
# this will get rid of "libtoolized" m4 files
distclean-local:
rm -rf $(filter-out \
$(top_builddir)/m4/ax_prog_date.m4 \
$(top_builddir)/m4/ax_prog_perl_modules.m4, \
$(wildcard $(top_builddir)/m4/*.m4))
# release/versioning
BUILT_SOURCES = .version
.version:
echo $(VERSION) > $@-t && mv $@-t $@
dist-hook: gen-ChangeLog
echo $(VERSION) > $(distdir)/.tarball-version
echo $(SOURCE_EPOCH) > $(distdir)/source_epoch
gen_start_date = 2000-01-01
.PHONY: gen-ChangeLog
gen-ChangeLog:
if test -d $(abs_srcdir)/.git; then \
LC_ALL=C $(top_srcdir)/make/gitlog-to-changelog \
--since=$(gen_start_date) > $(distdir)/cl-t; \
rm -f $(distdir)/ChangeLog; \
mv $(distdir)/cl-t $(distdir)/ChangeLog; \
fi
## make rpm/srpm section.
$(SPEC): $(SPEC).in .version config.status
rm -f $@-t $@
date="`LC_ALL=C $(UTC_DATE_AT)$(SOURCE_EPOCH) "+%a %b %d %Y"`" && \
gvgver="`cd $(abs_srcdir); make/git-version-gen --fallback $(VERSION) .tarball-version .gitarchivever`" && \
if [ "$$gvgver" = "`echo $$gvgver | sed 's/-/./'`" ];then \
rpmver="$$gvgver" && \
alphatag="" && \
dirty="" && \
numcomm="0"; \
else \
gitver="`echo $$gvgver | sed 's/\(.*\)\./\1-/'`" && \
rpmver=`echo $$gitver | sed 's/-.*//g'` && \
alphatag=`echo $$gvgver | sed 's/[^-]*-\([^-]*\).*/\1/'` && \
numcomm=`echo $$gitver | sed 's/[^-]*-\([^-]*\).*/\1/'` && \
dirty="" && \
if [ "`echo $$gitver | sed 's/^.*-dirty$$//g'`" = "" ];then \
dirty="dirty"; \
fi \
fi && \
if [ -n "$$dirty" ]; then dirty="dirty"; else dirty=""; fi && \
if [ "$$numcomm" = "0" ]; then \
sed \
-e "s#@version@#$$rpmver#g" \
-e "s#%glo.*alpha.*##g" \
-e "s#%glo.*numcomm.*##g" \
-e "s#@dirty@#$$dirty#g" \
-e "s#@date@#$$date#g" \
$(abs_srcdir)/[email protected] > $@-t; \
else \
sed \
-e "s#@version@#$$rpmver#g" \
-e "s#@alphatag@#$$alphatag#g" \
-e "s#@numcomm@#$$numcomm#g" \
-e "s#@dirty@#$$dirty#g" \
-e "s#@date@#$$date#g" \
$(abs_srcdir)/[email protected] > $@-t; \
fi; \
if [ -z "$$dirty" ]; then sed -i -e "s#%glo.*dirty.*##g" $@-t; fi && \
chmod a-w $@-t
mv $@-t $@
rm -f $@-t*
$(TARFILES):
$(MAKE) dist
RPMBUILDOPTS = --define "_sourcedir $(abs_top_builddir)" \
--define "_specdir $(abs_top_builddir)" \
--define "_builddir $(abs_top_builddir)" \
--define "_srcrpmdir $(abs_top_builddir)" \
--define "_rpmdir $(abs_top_builddir)"
srpm: clean
$(MAKE) $(SPEC) $(TARFILES)
rpmbuild $(RPMBUILDOPTS) --nodeps -bs $(SPEC)
rpm: clean
$(MAKE) $(SPEC) $(TARFILES)
rpmbuild $(RPMBUILDOPTS) -ba $(SPEC)