4 # The master makefile sets up the follosing customizable (double-colon) targtets.
7 # This optional target may be used by the user to install the necessary
8 # system requirements via 'aptitude'. Must be called as root
11 # Called for basic setup. Executed before installing the basic eggs
14 # Called to install eggs
17 # Called to install the buildout (e.g. call paster create)
20 # Called after the buildout is installed but BEFORE bootstraping
23 # Called BEFORE updating the buildout (e.g. before calling bin/buildout)
26 # Called to bootstrap the buildout. Here you can add actions to be
27 # performed AFTER bootstraping the project whenever a bootstrap is performed
30 # Called to update the buildout (calls bin/buildout). Here you can add
31 # commands to call AFTER bin/buildout returns.
34 # Called to populate the .gitignore file. Use '@$(gitignore) <pattern>' to
38 # Called to add environment variables to be set when executing a shell
39 # Use @$(env) <var> <value> to add a variable settings. <var> may be
40 # PATH Add <value> to PATH
41 # PYTHONPATH Add <value> to PYTHONPATH
42 # <other> Set variable to <value>
45 # Called to clean up all generated files
48 ###########################################################################
58 # @$(httpget) <url> [<target>]
60 # Download <url> to <target>. If <target> is missing, <target> defaults to
61 # the last component of the <url>.
63 # If the file exists in $(DLCACHE), it is retrieved from there instead.
68 [ -n "$$target" ] || target="$$name"; \
69 cache="$(DLCACHE)/$$name"; \
70 if [ -r "$$cache" ]; then \
71 echo "Fetching '$$name' from cache."; \
73 [ -z "$(HTTPGET_NONET)" ] || ( echo "Missing '$$1'."; exit 2 ); \
74 echo "Downloading '$$1'."; \
75 wget -O "$$cache" "$$1"; \
77 cp "$$cache" "$$target"; \
82 ###########################################################################
83 # Customization targets
89 @echo " Makefile for bootstraping and maintaining a buildout. Most important"
99 @echo " Summary of important targets"
102 @echo " Complete list of user-targets"
105 @echo " Install debian packages via 'aptitude' needed to satisy build"
106 @echo " dependencies. MUST BE CALLED AS ROOT (e.g. with sudo)."
109 @echo " Initialize buildout. Call this to either bootstrap a new project"
110 @echo " or to initialize a new working copy. Missing packages will be"
111 @echo " downloaded from the internet."
114 @echo " Initialize buildout from cache. Like 'init' but does not download"
115 @echo " any packages from the internet. Needs an up-to-date download cache."
118 @echo " Update the buildout (calls './bin/buildout'). This target may need"
119 @echo " network access."
121 @echo " update-nonet"
122 @echo " Update the buildout (calls './bin/buildout -No') with no network"
126 @echo " Spawn an interactive subshell with the environment set up correctly"
127 @echo " for the local buildout."
130 @echo " Generate lines to be added to 'buildout.cfg' to pin all package"
134 @echo " Remove all generated files."
140 @echo "SECONDARY TARGETS"
147 mkdir -p $(DLCACHE) $(DLCACHE)/pip
166 bin/buildout $(BUILDOUT_OPTS)
171 [ -r .gitignore ] || touch .gitignore; \
172 grep -qxF "$$1" .gitignore || echo "$$1" >>.gitignore; \
177 @echo "Updating .gitignore."
178 @$(gitignore) "*.pyc"
179 @$(gitignore) "*.egg-info/"
180 @$(gitignore) "/.env"
184 [ -r .env ] || touch .env; \
186 PATH|PYTHONPATH) line="export $$1=\"$$2:\$$$$1\"" ;; \
187 *) line="export $$1=\"$$2\"" ;; \
189 grep -qxF "$$line" .env || echo "$$line" >>.env; \
194 @echo "Updating .env."
197 rm -f .gitignore .env
200 ###########################################################################
203 init: setup eggs buildout init-hook update-hook bootstrap update .gitignore .env
206 init-nonet: HTTPGET_NONET=1
211 @echo "# Add the following lines to [versions] in buildout.cfg to pin all packages"
212 @bin/buildout -vvvvv | sed -ne 's/^Picked: //p' | sort | uniq
216 @eval "`cat .env`"; $$SHELL