ovirt-node 2.2.0 release
[ovirt-node.git] / Makefile.am
blob2869a232686b8e4255f0f78cf78eb6b6ae4f4d2b
1 # Copyright (C) 2008 Red Hat, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; version 2 of the License.
7 # This program is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 # GNU General Public License for more details.
12 # You should have received a copy of the GNU General Public License
13 # along with this program; if not, write to the Free Software
14 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
15 # MA  02110-1301, USA.  A copy of the GNU General Public License is
16 # also available at http://www.gnu.org/copyleft/gpl.html.
18 OVIRT_CACHE_DIR ?= $(HOME)/ovirt-cache
20 SUBDIRS =   \
21   augeas \
22   dracut \
23   images \
24   kinit \
25   recipe \
26   scripts
28 EXTRA_DIST = \
29   ovirt-qla4xxx.conf \
30   vlan.modules \
31   libvirtd.service \
32   libvirtd.upstart \
33   ovirt-node.spec \
34   ovirt-node.spec.in \
35   logrotate/ovirt-logrotate \
36   logrotate/ovirt-logrotate.conf
38 DISTCLEANFILES = $(PACKAGE)-$(VERSION).tar.gz
40 # For Release: 0..., set _ovirt_dev=1 so that we get extra_release.GIT-
41 # annotated rpm version strings.
42 _ovirt_dev = \
43  $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \
44    $(srcdir)/*.spec.in && echo 1 || :)
46 git_head        = $$(git log -1 --pretty=format:%h)
47 GIT_RELEASE     = $$(date --utc +%Y%m%d%H%M%S)git$(git_head)
48 RPMDIR          = $$(rpm --eval '%{_rpmdir}')
49 RPM_FLAGS       = --define "ovirt_cache_dir $(OVIRT_CACHE_DIR)"
50 RPM_FLAGS       += $(if $(_ovirt_dev),--define "extra_release .$(GIT_RELEASE)")
52 rpms: dist
53         rpmbuild $(RPM_FLAGS) -ta $(distdir).tar.gz
55 srpms: dist
56         rpmbuild $(RPM_FLAGS) -ts $(distdir).tar.gz
58 publish: rpms
59         mkdir -p $(OVIRT_CACHE_DIR)
60         rsync -aq $(shell rpm --eval '%{_rpmdir}')/ $(OVIRT_CACHE_DIR)/ovirt/
61         rsync -aq $(shell rpm --eval '%{_srcrpmdir}')/ $(OVIRT_CACHE_DIR)/ovirt/src
62         createrepo $(OVIRT_CACHE_DIR)/ovirt
64 .PHONY: rpms publish srpms