-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
44 lines (25 loc) · 960 Bytes
/
Makefile
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
32
33
34
35
36
37
38
39
40
41
42
43
44
# upstream version
VERSION = 0.6.6
COMMIT = ded745779a8216b838302e1e1ae4e5f5adacd3b0
# extracting download URL from .spec works only for rpm-4.11.0 and higher
# versions; previous versions of rpmspec require source to be already present
#DOWNLOAD_URL := $(shell rpmspec -P piqi.spec | grep '^Source0:' | cut -f 2)
SHORTCOMMIT := $(shell echo $(COMMIT) | cut -c 1-7)
DOWNLOAD_URL := https://github.com/alavrik/piqi/archive/$(COMMIT)/piqi-$(VERSION)-$(SHORTCOMMIT).tar.gz
TARBALL := $(notdir $(DOWNLOAD_URL))
RPMBUILDFLAGS = \
--define "_topdir $(PWD)" \
#--nodeps
all: download rpm
download: $(TARBALL)
$(TARBALL):
curl -L -O $(DOWNLOAD_URL)
rpm: download clean-rpm
mkdir SOURCES && cp $(TARBALL) SOURCES
rpmbuild -ba $(RPMBUILDFLAGS) piqi.spec
clean: clean-rpm
rm -rf piqi-*.tar.gz
clean-rpm:
#rpmbuild --clean $(RPMBUILDFLAGS) piqi.spec
rm -rf BUILD RPMS SOURCES SPECS SRPMS BUILDROOT
.PHONY: all download rpm clean clean-rpm