]> git.proxmox.com Git - mirror_corosync-qdevice.git/blame - Makefile.am
qdevice-votequorum: Fix typo in log message
[mirror_corosync-qdevice.git] / Makefile.am
CommitLineData
9a1955a7
JF
1# Copyright (c) 2009 Red Hat, Inc.
2#
3# Authors: Andrew Beekhof
4# Steven Dake (sdake@redhat.com)
5#
6# This software licensed under BSD license, the text of which follows:
7#
8# Redistribution and use in source and binary forms, with or without
9# modification, are permitted provided that the following conditions are met:
10#
11# - Redistributions of source code must retain the above copyright notice,
12# this list of conditions and the following disclaimer.
13# - Redistributions in binary form must reproduce the above copyright notice,
14# this list of conditions and the following disclaimer in the documentation
15# and/or other materials provided with the distribution.
16# - Neither the name of the Red Hat, Inc. nor the names of its
17# contributors may be used to endorse or promote products derived from this
18# software without specific prior written permission.
19#
20# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30# THE POSSIBILITY OF SUCH DAMAGE.
31
32SPEC = $(PACKAGE_NAME).spec
33
34TARFILE = $(PACKAGE_NAME)-$(VERSION).tar.gz
35
36EXTRA_DIST = autogen.sh $(SPEC).in \
37 build-aux/git-version-gen \
38 build-aux/gitlog-to-changelog \
39 build-aux/release.mk \
40 .version
41
42ACLOCAL_AMFLAGS = -I m4
43
44MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure depcomp \
45 config.guess config.sub missing install-sh \
46 autoheader automake autoconf \
47 autoscan.log configure.scan ltmain.sh test-driver
48
49dist_doc_DATA = LICENSE
50
51SUBDIRS = qdevices man init
52
53install-exec-local:
54if BUILD_QNETD
55 $(INSTALL) -m 770 -d $(DESTDIR)/${localstatedir}/run/corosync-qnetd
56 $(INSTALL) -m 770 -d $(DESTDIR)/${COROSYSCONFDIR}/qnetd
57endif
58if BUILD_QDEVICES
59 $(INSTALL) -m 770 -d $(DESTDIR)/${localstatedir}/run/corosync-qdevice
60 $(INSTALL) -d $(DESTDIR)/${COROSYSCONFDIR}/qdevice/
61 $(INSTALL) -m 770 -d $(DESTDIR)/${COROSYSCONFDIR}/qdevice/net
62endif
63
64uninstall-local:
65if BUILD_QNETD
66 rmdir $(DESTDIR)/${localstatedir}/run/corosync-qnetd || :;
67 rmdir $(DESTDIR)/${COROSYSCONFDIR}/qnetd || :;
68endif
69if BUILD_QDEVICES
70 rmdir $(DESTDIR)/${localstatedir}/run/corosync-qdevice || :;
71 rmdir $(DESTDIR)/${COROSYSCONFDIR}/qdevice/net || :;
72 rmdir $(DESTDIR)/${COROSYSCONFDIR}/qdevice/ || :;
73endif
74
75dist-clean-local:
76 rm -f autoconf automake autoheader
77
78clean-generic:
79 rm -rf doc/api $(SPEC) $(TARFILE)
80
81## make rpm/srpm section.
82
83$(SPEC): $(SPEC).in
84 rm -f $@-t $@
85 date="$(shell LC_ALL=C date "+%a %b %d %Y")" && \
c4512f39
JF
86 gvgver="`cd $(abs_srcdir); build-aux/git-version-gen --fallback $(VERSION) .tarball-version .gitarchivever`" && \
87 if [ "$$gvgver" = "`echo $$gvgver | sed 's/-/./'`" ];then \
88 rpmver="$$gvgver" && \
9a1955a7
JF
89 alphatag="" && \
90 dirty="" && \
c4512f39 91 numcomm="0"; \
9a1955a7 92 else \
c4512f39
JF
93 gitver="`echo $$gvgver | sed 's/\(.*\)\./\1-/'`" && \
94 rpmver=`echo $$gitver | sed 's/-.*//g'` && \
95 alphatag=`echo $$gvgver | sed 's/[^-]*-\([^-]*\).*/\1/'` && \
96 numcomm=`echo $$gitver | sed 's/[^-]*-\([^-]*\).*/\1/'` && \
97 dirty="" && \
98 if [ "`echo $$gitver | sed 's/^.*-dirty$$//g'`" = "" ];then \
99 dirty="dirty"; \
100 fi \
9a1955a7 101 fi && \
c4512f39 102 if [ -n "$$dirty" ]; then dirty="dirty"; else dirty=""; fi && \
9a1955a7
JF
103 if [ "$$numcomm" = "0" ]; then numcomm=""; fi && \
104 if [ -n "$$numcomm" ]; then numcomm="%global numcomm $$numcomm"; fi && \
105 if [ "$$alphatag" = "$$gitver" ]; then alphatag=""; fi && \
106 if [ -n "$$alphatag" ]; then alphatag="%global alphatag $$alphatag"; fi && \
107 if [ -n "$$dirty" ]; then dirty="%global dirty dirty"; fi && \
108 sed \
109 -e "s#@version@#$$rpmver#g" \
110 -e "s#@ALPHATAG@#$$alphatag#g" \
111 -e "s#@NUMCOMM@#$$numcomm#g" \
112 -e "s#@DIRTY@#$$dirty#g" \
113 -e "s#@date@#$$date#g" \
eae6806f 114 $< > $@-t
c6548f40
JF
115if BUILD_USERFLAGS
116 sed -i -e "s#@bcond_userflags@#bcond_without#g" $@-t
117else
118 sed -i -e "s#@bcond_userflags@#bcond_with#g" $@-t
119endif
eae6806f
JF
120if BUILD_RUNAUTOGEN
121 sed -i -e "s#@bcond_runautogen@#bcond_without#g" $@-t
122else
123 sed -i -e "s#@bcond_runautogen@#bcond_with#g" $@-t
124endif
125if INSTALL_SYSTEMD
126 sed -i -e "s#@bcond_systemd@#bcond_without#g" $@-t
127else
128 sed -i -e "s#@bcond_systemd@#bcond_with#g" $@-t
129endif
9a1955a7
JF
130 chmod a-w $@-t
131 mv $@-t $@
132
133$(TARFILE):
134 $(MAKE) dist
135
136RPMBUILDOPTS = --define "_sourcedir $(abs_builddir)" \
137 --define "_specdir $(abs_builddir)" \
138 --define "_builddir $(abs_builddir)" \
139 --define "_srcrpmdir $(abs_builddir)" \
140 --define "_rpmdir $(abs_builddir)"
141
142srpm: clean
143 $(MAKE) $(SPEC) $(TARFILE)
f26ec675 144 rpmbuild $(RPMBUILDOPTS) --nodeps -bs $(SPEC)
9a1955a7
JF
145
146rpm: clean _version
147 $(MAKE) $(SPEC) $(TARFILE)
f26ec675 148 rpmbuild $(RPMBUILDOPTS) -ba $(SPEC)
9a1955a7
JF
149
150# release/versioning
151BUILT_SOURCES = .version
152.version:
153 echo $(VERSION) > $@-t && mv $@-t $@
154
155dist-hook: gen-ChangeLog
156 echo $(VERSION) > $(distdir)/.tarball-version
157
158gen_start_date = 2000-01-01
159.PHONY: gen-ChangeLog _version
160gen-ChangeLog:
161 if test -d .git; then \
162 LC_ALL=C $(top_srcdir)/build-aux/gitlog-to-changelog \
163 --since=$(gen_start_date) > $(distdir)/cl-t; \
164 rm -f $(distdir)/ChangeLog; \
165 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
166 fi
167
168_version:
169 cd $(srcdir) && rm -rf autom4te.cache .version && autoreconf -i
170 $(MAKE) $(AM_MAKEFLAGS) Makefile
171
172maintainer-clean-local:
173 rm -rf m4