3 # This Makefile presumes that the spec file is located in ./SPECS/$SPECFILE
5 # should we get a Working Directory from cmake instead?
8 RPMBUILD_ARGS
= --define "_topdir $(WD)/rpmbuild"
9 RPMBUILD_ARGS
+= --define 'debug_package %{nil}'
11 # automatically specify settings appropriate to a tagged build
12 ifneq ($(origin TAGVER
), undefined
)
13 RPMBUILD_ARGS
+= --define "version $(TAGVER)"
14 RPMBUILD_ARGS
+= --define "refspec v$(TAGVER)"
15 RPMBUILD_ARGS
+= --define "release 0"
18 # allow direct specification of the version, refspec, and release number
19 ifneq ($(origin VERSION
), undefined
)
20 RPMBUILD_ARGS
+= --define "version $(VERSION)"
22 ifneq ($(origin REFSPEC
), undefined
)
23 RPMBUILD_ARGS
+= --define "refspec $(REFSPEC)"
25 ifneq ($(origin RELEASE
), undefined
)
26 RPMBUILD_ARGS
+= --define "release $(RELEASE)"
28 ifneq ($(origin QUIET
),undefined
)
29 RPMBUILD_ARGS
+= --quiet
33 #prepare build environment
34 mkdir
-p rpmbuild
/{SPECS
,SOURCES
,RPMS
,SRPMS
,BUILD
}
35 cp SPECS
/$(SPECFILE
) rpmbuild
/SPECS
/
37 PATH
=$$PATH:/usr
/local
/cuda
/bin rpmbuild
-ba
$(RPMBUILD_ARGS
) $(WD
)/rpmbuild
/SPECS
/$(SPECFILE
)