forked from ClusterLabs/fence-virt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.am
127 lines (108 loc) · 4.03 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
121
122
123
124
125
126
127
###############################################################################
###############################################################################
##
## Copyright (C) 2009-2019 Red Hat, Inc.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
## of the GNU General Public License v.2.
##
###############################################################################
###############################################################################
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure depcomp \
config.guess config.sub missing install-sh \
ltmain.sh compile config.h.in config.h.in~ \
autoscan.log configure.scan test-driver \
m4/libtool.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 \
m4/ltsugar.m4 m4/ltversion.m4 include/config.in*
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
SPEC = $(PACKAGE_NAME).spec
TARFILES = $(PACKAGE_NAME)-$(VERSION).tar.bz2 \
$(PACKAGE_NAME)-$(VERSION).tar.gz \
$(PACKAGE_NAME)-$(VERSION).tar.xz
EXTRA_DIST = autogen.sh .version architecture.txt \
fence_virtd.init.in fence_virtd.service.in \
fence_virt.txt README README.md TODO \
include $(SPEC).in build-aux
SUBDIRS = config common client server man
all-local: fence_virtd.service
clean-local:
rm -f $(SPEC) fence_virtd.service
distclean-local:
rm -f $(PACKAGE_NAME)-*.tar.* $(PACKAGE_NAME)-*.sha256* tag-*
fence_virtd.service: fence_virtd.service.in
SBINDIR="@sbindir@"; \
INITCONFDIR="@initconfdir@"; \
cat $^ > $@ ; \
echo "EnvironmentFile=-$$INITCONFDIR/fence_virtd" >> $@ ;\
echo "ExecStart=$$SBINDIR/fence_virtd \$$FENCE_VIRTD_ARGS" >> $@
## 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"`" && \
if [ -f $(abs_srcdir)/.tarball-version ]; then \
gitver="`cat $(abs_srcdir)/.tarball-version`" && \
rpmver=$$gitver && \
alphatag="" && \
dirty="" && \
numcomm="0"; \
elif [ "`git log -1 --pretty=format:x . 2>&1`" = "x" ]; then \
gitver="`GIT_DIR=$(abs_srcdir)/.git git describe --abbrev=4 --match='v*' HEAD 2>/dev/null`" && \
rpmver=`echo $$gitver | sed -e "s/^v//" -e "s/-.*//g"` && \
alphatag=`echo $$gitver | sed -e "s/.*-//" -e "s/^g//"` && \
vtag=`echo $$gitver | sed -e "s/-.*//g"` && \
numcomm=`GIT_DIR=$(abs_srcdir)/.git git rev-list $$vtag..HEAD | wc -l` && \
cd $(abs_srcdir) && \
git update-index --refresh > /dev/null 2>&1 || true && \
dirty=`git diff-index --name-only HEAD 2>/dev/null` && cd - 2>/dev/null; \
else \
gitver="`cd $(abs_srcdir); build-aux/git-version-gen .tarball-version .gitarchivever`" && \
rpmver=$$gitver && \
alphatag="" && \
dirty="" && \
numcomm="0"; \
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
sed -i -e "s#@defaultadmgroup@#$(DEFAULTADMGROUP)#g" $@-t
chmod a-w $@-t
mv $@-t $@
rm -f $@-t*
$(TARFILES):
$(MAKE) dist
RPMBUILDOPTS = --define "_sourcedir $(abs_builddir)" \
--define "_specdir $(abs_builddir)" \
--define "_builddir $(abs_builddir)" \
--define "_srcrpmdir $(abs_builddir)" \
--define "_rpmdir $(abs_builddir)"
srpm: clean
$(MAKE) $(SPEC) $(TARFILES)
rpmbuild $(RPMBUILDOPTS) --nodeps -bs $(SPEC)
rpm: clean
$(MAKE) $(SPEC) $(TARFILES)
rpmbuild $(RPMBUILDOPTS) -ba $(SPEC)
# release/versioning
BUILT_SOURCES = .version
.version:
echo $(VERSION) > $@-t && mv $@-t $@
dist-hook:
echo $(VERSION) > $(distdir)/.tarball-version
echo $(SOURCE_EPOCH) > $(distdir)/source_epoch