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
22 ovirt-node-image.spec \
23 ovirt-node-image.spec.in \
33 # For Release: 0..., set _ovirt_dev=1 so that we get extra_release.GIT-
34 # annotated rpm version strings.
36 $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \
37 $(srcdir)/*.spec.in && echo 1 || :)
39 git_head = $$(git log -1 --pretty=format:%h)
40 GIT_RELEASE = $$(date --utc +%Y%m%d%H%M%S)git$(git_head)
41 RPMDIR = $$(rpm --eval '%{_rpmdir}')
42 RPM_FLAGS = --define "ovirt_cache_dir $(OVIRT_CACHE_DIR)"
43 RPM_FLAGS += $(if $(_ovirt_dev),--define "extra_release .$(GIT_RELEASE)")
44 # FEDORA_URL env var can be set to the root of a fedora mirror
45 RPM_FLAGS += $(if $(FEDORA_URL),--define "fedora_url $(FEDORA_URL)")
46 # OVIRT_URL env var can be set to the root of an ovirt.org mirror
47 RPM_FLAGS += $(if $(OVIRT_URL),--define "ovirt_url $(OVIRT_URL)")
50 rpmbuild $(RPM_FLAGS) -ta $(distdir).tar.gz
53 mkdir -p $(OVIRT_CACHE_DIR)
54 rsync -aq $(shell rpm --eval '%{_rpmdir}')/ $(OVIRT_CACHE_DIR)/ovirt/
55 rsync -aq $(shell rpm --eval '%{_srcrpmdir}')/ $(OVIRT_CACHE_DIR)/ovirt/src
56 createrepo $(OVIRT_CACHE_DIR)/ovirt