This repository has been archived by the owner on Sep 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (57 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
68
69
70
APPNAME = bipostaldash
DEPS =
HERE = $(shell pwd)
BIN = $(HERE)/bin
VIRTUALENV = virtualenv
#NOSE = bin/nosetests -s --with-xunit
NOSE = bin/nosetests --with-xunit --cover-package=$(APPNAME)
TESTS = $(APPNAME)/tests
PYTHON = $(BIN)/python
BUILDAPP = $(BIN)/buildapp
BUILDRPMS = $(BIN)/buildrpms
PYPI = http://pypi.python.org/simple
PYPIOPTIONS = -i $(PYPI)
DOTCHANNEL := $(wildcard .channel)
ifeq ($(strip $(DOTCHANNEL)),)
CHANNEL = dev
RPM_CHANNEL = prod
else
CHANNEL = `cat .channel`
RPM_CHANNEL = `cat .channel`
endif
INSTALL = $(BIN)/pip install
PIP_CACHE = /tmp/pip_cache
INSTALLOPTIONS = --download-cache $(PIP_CACHE) -U -i $(PYPI)
ifdef PYPIEXTRAS
PYPIOPTIONS += -e $(PYPIEXTRAS)
INSTALLOPTIONS += -f $(PYPIEXTRAS)
endif
ifdef PYPISTRICT
PYPIOPTIONS += -s
ifdef PYPIEXTRAS
HOST = `python -c "import urlparse; print urlparse.urlparse('$(PYPI)')[1] + ',' + urlparse.urlparse('$(PYPIEXTRAS)')[1]"`
else
HOST = `python -c "import urlparse; print urlparse.urlparse('$(PYPI)')[1]"`
endif
endif
INSTALL += $(INSTALLOPTIONS)
.PHONY: all build test build_rpms mach
all: build
build:
$(VIRTUALENV) --no-site-packages .
$(INSTALL) -r dev-reqs.txt
$(BUILDAPP) -c $(CHANNEL) $(PYPIOPTIONS) $(DEPS)
update:
$(BUILDAPP) -c $(CHANNEL) $(PYPIOPTIONS) $(DEPS)
test:
$(NOSE) $(APPNAME)
build_rpms:
rm -rf rpms/
$(BUILDRPMS) -c $(RPM_CHANNEL) $(DEPS)
mach: build build_rpms
mach clean
mach yum install python26 python26-setuptools
cd rpms; wget http://mrepo.mozilla.org/mrepo/5-x86_64/RPMS.mozilla-services/gunicorn-0.11.2-1moz.x86_64.rpm
cd rpms; wget http://mrepo.mozilla.org/mrepo/5-x86_64/RPMS.mozilla/nginx-0.7.65-4.x86_64.rpm
mach yum install rpms/*
mach chroot python2.6 -m bipostaldash.run