-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.am
61 lines (51 loc) · 1.92 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
# Copyright (C) 2008 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA. A copy of the GNU General Public License is
# also available at http://www.gnu.org/copyleft/gpl.html.
OVIRT_CACHE_DIR ?= $(HOME)/ovirt-cache
SUBDIRS = \
gptsync \
images \
kinit \
nodeadmin \
recipe \
scripts \
tools
EXTRA_DIST = \
ovirt-node.spec \
ovirt-node.spec.in \
logrotate/ovirt-logrotate \
logrotate/ovirt-logrotate.conf
DISTCLEANFILES = $(PACKAGE)-$(VERSION).tar.gz
# For Release: 0..., set _ovirt_dev=1 so that we get extra_release.GIT-
# annotated rpm version strings.
_ovirt_dev = \
$(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \
$(srcdir)/*.spec.in && echo 1 || :)
git_head = $$(git log -1 --pretty=format:%h)
GIT_RELEASE = $$(date --utc +%Y%m%d%H%M%S)git$(git_head)
RPMDIR = $$(rpm --eval '%{_rpmdir}')
RPM_FLAGS = --define "ovirt_cache_dir $(OVIRT_CACHE_DIR)"
RPM_FLAGS += $(if $(_ovirt_dev),--define "extra_release .$(GIT_RELEASE)")
rpms: dist
rpmbuild $(RPM_FLAGS) -ta $(distdir).tar.gz
srpms: dist
rpmbuild $(RPM_FLAGS) -ts $(distdir).tar.gz
publish: rpms
mkdir -p $(OVIRT_CACHE_DIR)
rsync -aq $(shell rpm --eval '%{_rpmdir}')/ $(OVIRT_CACHE_DIR)/ovirt/
rsync -aq $(shell rpm --eval '%{_srcrpmdir}')/ $(OVIRT_CACHE_DIR)/ovirt/src
createrepo $(OVIRT_CACHE_DIR)/ovirt
.PHONY: rpms publish srpms