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
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.
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)")
53 rpmbuild $(RPM_FLAGS) -ta $(distdir).tar.gz
56 rpmbuild $(RPM_FLAGS) -ts $(distdir).tar.gz
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