blob: 802fa0b855c737bbecee330762fda68d6071753e [file] [log] [blame]
Siobhan Tully44fd4cc2014-02-23 00:07:12 -05001NAME = opencloud
2SPECFILE = $(NAME).spec
3VERSION = $(shell rpm -q --specfile $(SPECFILE) --qf '%{VERSION}\n' | head -n 1)
4RELEASE = $(shell rpm -q --specfile $(SPECFILE) --qf '%{RELEASE}\n' | head -n 1)
5
Scott Bakerab66c772014-04-18 15:24:49 -07006UPLOAD_SLICE=princeton_planetstack
7UPLOAD_HOST=node36.princeton.vicci.org
8
Siobhan Tully44fd4cc2014-02-23 00:07:12 -05009PWD = $(shell pwd)
10
11dist rpm: $(NAME)-$(VERSION)-$(RELEASE).rpm
12
13$(NAME)-$(VERSION).tar.gz:
14 mkdir -p $(NAME)-$(VERSION)
Scott Baker524acdb2014-03-19 23:45:49 -070015 rsync -av --exclude=.svn --exclude=.git --exclude=*.tar.gz --exclude=__history --exclude=$(NAME)-$(VERSION)/ ./ $(NAME)-$(VERSION)
Siobhan Tully44fd4cc2014-02-23 00:07:12 -050016 tar -czf $@ $(NAME)-$(VERSION)
17 rm -fr $(NAME)-$(VERSION)
18
19$(NAME)-$(VERSION)-$(RELEASE).rpm: $(NAME)-$(VERSION).tar.gz
20 mkdir -p build
21 rpmbuild -bb --define '_sourcedir $(PWD)' \
22 --define '_builddir $(PWD)/build' \
23 --define '_srcrpmdir $(PWD)' \
24 --define '_rpmdir $(PWD)' \
25 --define '_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' \
26 $(SPECFILE)
27
28srpm: $(NAME)-$(VERSION)-$(RELEASE).src.rpm
29$(NAME)-$(VERSION)-$(RELEASE).src.rpm: $(NAME)-$(VERSION).tar.gz
30 rpmbuild -bs --define "_sourcedir $$(pwd)" \
31 --define "_srcrpmdir $$(pwd)" \
32 $(SPECFILE)
33
34clean:
35 rm -f $(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION)-$(RELEASE).src.rpm $(NAME)-$(VERSION)-$(RELEASE).noarch.rpm
36 rm -rf build
37
Scott Bakerab66c772014-04-18 15:24:49 -070038install: $(NAME)-$(VERSION)-$(RELEASE).rpm
39 scp $(NAME)-$(VERSION)-$(RELEASE).x86_64.rpm $(UPLOAD_SLICE)@$(UPLOAD_HOST):/root/
40 ssh $(UPLOAD_SLICE)@$(UPLOAD_HOST) yum -y install gcc graphviz-devel graphviz-python postgresql postgresql-server python-pip python-psycopg2 libxslt-devel python-httplib2 GeoIP
41 ssh $(UPLOAD_SLICE)@$(UPLOAD_HOST) rpm --install --upgrade --replacepkgs /root/$(NAME)-$(VERSION)-$(RELEASE).x86_64.rpm
42 scp /opt/planetstack/hpc_wizard/bigquery_credentials.dat /opt/planetstack/hpc_wizard/client_secrets.json $(UPLOAD_SLICE)@$(UPLOAD_HOST):/opt/planetstack/hpc_wizard/
43
Siobhan Tully44fd4cc2014-02-23 00:07:12 -050044.PHONY: dist
45