-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
67 lines (49 loc) · 1.69 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Default git branch to build in RPM
ifndef GITBRANCH
GITBRANCH=HEAD
endif
all: docs
doc docs:
$(MAKE) -C doc html
deb:
dpkg-buildpackage -us -uc $(BUILD_ARGS)
lintian | tee -a lintian.log
upload_packages: deb
aptly/upload_packages.sh
include_packages:
aptly/include_packages.sh
publish_packages:
aptly/publish_packages.sh
vagrant: deb
cd vagrant && vagrant up --provision
ansible: deb
cd vagrant && ./elephant-shed.yml $(ANSIBLE_ARGS)
deploy_openpower: vagrant/inventory.openpower
cd vagrant && ./elephant-shed.yml $(ANSIBLE_ARGS) \
-i inventory.openpower \
-e "repo=http"
clean:
$(MAKE) -C doc clean
$(MAKE) -C grafana clean
rm -rf rpm/SOURCES/ rpm/SPECS rpm/BUILD rpm/BUILDROOT rpm/RPMS rpm/SRPMS
# rpm
DPKG_VERSION=$(shell sed -ne '1s/.*(//; 1s/).*//p' debian/changelog)
PACKAGE_RELEASE=1
RPMDIR=$(CURDIR)/rpm
TARBALL=$(RPMDIR)/SOURCES/elephant-shed_$(DPKG_VERSION).tar
rpmbuild: $(TMATESOURCE) $(TARBALL).xz
rpmbuild -D"%_topdir $(RPMDIR)" --define='package_version $(DPKG_VERSION)' --define='package_release $(PACKAGE_RELEASE)' -ba rpm/elephant-shed.spec
tarball $(TARBALL).xz:
mkdir -p $(dir $(TARBALL))
rm -f $(TARBALL).xz
git archive --prefix=elephant-shed-$(DPKG_VERSION)/ $(GITBRANCH) > $(TARBALL)
# include pre-built documentation in tarball
tar --append --transform "s!^!elephant-shed-$(DPKG_VERSION)/!" -f $(TARBALL) doc/_build/html
xz $(TARBALL)
# tmate rpm
TMATESOURCE=$(CURDIR)/rpm/SOURCES/$(shell rpmspec --srpm --query --queryformat '%{Source}' rpm/tmate.spec)
rpmbuild-tmate: $(TMATESOURCE)
rpmbuild -D"%_topdir $(RPMDIR)" --define='package_version $(DPKG_VERSION)' -ba rpm/tmate.spec
$(TMATESOURCE):
mkdir -p rpm/SOURCES
spectool -S -g -C rpm/SOURCES rpm/tmate.spec