forked from xapi-project/xen-api-libs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.xcp
31 lines (27 loc) · 877 Bytes
/
Makefile.xcp
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
ifdef B_BASE
include $(B_BASE)/common.mk
include $(B_BASE)/rpmbuild.mk
REPO=$(call git_loc,xen-api-libs)
else
MY_OUTPUT_DIR ?= $(CURDIR)/output
MY_OBJ_DIR ?= $(CURDIR)/obj
REPO ?= $(CURDIR)
RPM_SPECSDIR?=$(shell rpm --eval='%_specdir')
RPM_SRPMSDIR?=$(shell rpm --eval='%_srcrpmdir')
RPM_SOURCESDIR?=$(shell rpm --eval='%_sourcedir')
RPMBUILD=rpmbuild
endif
.PHONY: xapi-libs.spec
xapi-libs.spec: xapi-libs.spec.in
sed -e 's/@RPM_RELEASE@/$(shell git rev-list HEAD | wc -l)/g' < $< > $@
.PHONY: srpm
srpm: xapi-libs.spec
mkdir -p $(RPM_SOURCESDIR)
git archive --prefix=xapi-libs-0.1/ --format=tar HEAD | bzip2 -z > $(RPM_SOURCESDIR)/xapi-libs-0.1.tar.bz2 # xen-api-libs/Makefile.xcp
mkdir -p $(RPM_SPECSDIR)
cp -f xapi-libs.spec $(RPM_SPECSDIR)/
mkdir -p $(RPM_SRPMSDIR)
$(RPMBUILD) -bs --nodeps xapi-libs.spec
.PHONY: rpm
rpm: srpm
$(RPMBUILD) -bb xapi-libs.spec