blob: 2b5552692c9a404320da01bf3f104028f53b1346 [file] [log] [blame]
Scott Baker709bb592015-02-03 15:54:34 -08001NAME = xos
Siobhan Tully44fd4cc2014-02-23 00:07:12 -05002SPECFILE = $(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
Scott Bakerab66c772014-04-18 15:24:49 -07007
Siobhan Tully44fd4cc2014-02-23 00:07:12 -05008PWD = $(shell pwd)
9
10dist rpm: $(NAME)-$(VERSION)-$(RELEASE).rpm
11
12$(NAME)-$(VERSION).tar.gz:
13 mkdir -p $(NAME)-$(VERSION)
Scott Bakerc00bbfc2014-05-13 17:43:02 -070014 rsync -av --exclude=.svn --exclude=.git --exclude=*.tar.gz --exclude=*.rpm --exclude=__history --exclude=$(NAME)-$(VERSION)/ ./ $(NAME)-$(VERSION)
Siobhan Tully44fd4cc2014-02-23 00:07:12 -050015 tar -czf $@ $(NAME)-$(VERSION)
16 rm -fr $(NAME)-$(VERSION)
17
18$(NAME)-$(VERSION)-$(RELEASE).rpm: $(NAME)-$(VERSION).tar.gz
19 mkdir -p build
20 rpmbuild -bb --define '_sourcedir $(PWD)' \
21 --define '_builddir $(PWD)/build' \
22 --define '_srcrpmdir $(PWD)' \
23 --define '_rpmdir $(PWD)' \
24 --define '_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' \
25 $(SPECFILE)
26
27srpm: $(NAME)-$(VERSION)-$(RELEASE).src.rpm
28$(NAME)-$(VERSION)-$(RELEASE).src.rpm: $(NAME)-$(VERSION).tar.gz
29 rpmbuild -bs --define "_sourcedir $$(pwd)" \
30 --define "_srcrpmdir $$(pwd)" \
31 $(SPECFILE)
32
33clean:
34 rm -f $(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION)-$(RELEASE).src.rpm $(NAME)-$(VERSION)-$(RELEASE).noarch.rpm
35 rm -rf build
36
Scott Baker19c22db2014-12-19 12:35:37 -080037upload: $(NAME)-$(VERSION)-$(RELEASE).rpm
Scott Baker566c0022014-04-18 16:14:04 -070038ifndef UPLOAD_HOST
39 $(error please specify UPLOAD_HOST=<hostname> on make command line)
40endif
Scott Bakerab66c772014-04-18 15:24:49 -070041 scp $(NAME)-$(VERSION)-$(RELEASE).x86_64.rpm $(UPLOAD_SLICE)@$(UPLOAD_HOST):/root/
Scott Baker19c22db2014-12-19 12:35:37 -080042
43install: upload
Scott Bakerab66c772014-04-18 15:24:49 -070044 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
Scott Bakerc00bbfc2014-05-13 17:43:02 -070045 ssh $(UPLOAD_SLICE)@$(UPLOAD_HOST) rpm --install --upgrade --replacefiles --replacepkgs /root/$(NAME)-$(VERSION)-$(RELEASE).x86_64.rpm
Scott Bakerab66c772014-04-18 15:24:49 -070046 scp /opt/planetstack/hpc_wizard/bigquery_credentials.dat /opt/planetstack/hpc_wizard/client_secrets.json $(UPLOAD_SLICE)@$(UPLOAD_HOST):/opt/planetstack/hpc_wizard/
47
Scott Baker94380352014-05-15 15:06:08 -070048install-keys:
49ifndef UPLOAD_HOST
50 $(error please specify UPLOAD_HOST=<hostname> on make command line)
51endif
52 scp /opt/planetstack/hpc_wizard/bigquery_credentials.dat /opt/planetstack/hpc_wizard/client_secrets.json $(UPLOAD_SLICE)@$(UPLOAD_HOST):/opt/planetstack/hpc_wizard/
53
Siobhan Tully44fd4cc2014-02-23 00:07:12 -050054.PHONY: dist
55