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"
100 @echo " Summary of important / all user targets"
103 @echo " Install debian packages via 'aptitude' needed to satisy build"
104 @echo " dependencies. MUST BE CALLED AS ROOT (e.g. with sudo)."
108 @echo " Initialize buildout. Call this to either bootstrap a new project"
109 @echo " or to initialize a new working copy. Missing packages will be"
110 @echo " downloaded from the internet (init target) or from an up-to-date"
111 @echo " download cache (init-nonet). The download cache normaly resides in"
115 @echo " update-nonet"
116 @echo " Update the buildout. Calls './bin/buildout' (update target) or "
117 @echo " './bin/buildout -No (update-nonet target)."
120 @echo " Spawn an interactive subshell with the environment set up correctly"
121 @echo " for the local buildout."
124 @echo " Remove all unimportant (!) generated files. This target will leave"
125 @echo " only those files which are to be checked into version control."
126 @echo " calling 'make init' or 'make init-nonet' will rebuild the buildout."
132 @echo "SECONDARY TARGETS"
135 @echo " Generate lines to be added to 'buildout.cfg' to pin all package"
139 @echo " purge the download cache"
142 @echo " Reinitializes the buildout. This is like calling"
143 @echo " 'make clean cleancache init'. Use this target to upgrade to a new"
144 @echo " python or extension (e.g. PIL) version (after changing the version"
145 @echo " in the project Makefile) or to upgrade the component eggs. This"
146 @echo " target purges the download cache to ensure, no obsolete files are"
154 mkdir -p $(DLCACHE) $(DLCACHE)/pip
173 bin/buildout $(BUILDOUT_OPTS)
178 [ -r .gitignore ] || touch .gitignore; \
179 grep -qxF "$$1" .gitignore || echo "$$1" >>.gitignore; \
184 @echo "Updating .gitignore."
185 @$(gitignore) "*.pyc"
186 @$(gitignore) "*.egg-info/"
187 @$(gitignore) "/.env"
191 [ -r .env ] || touch .env; \
193 PATH|PYTHONPATH) line="export $$1=\"$$2:\$$$$1\"" ;; \
194 *) line="export $$1=\"$$2\"" ;; \
196 grep -qxF "$$line" .env || echo "$$line" >>.env; \
201 @echo "Updating .env."
207 ###########################################################################
210 init: setup eggs buildout init-hook update-hook bootstrap update .gitignore .env
213 init-nonet: HTTPGET_NONET=1
218 @echo "# Add the following lines to [versions] in buildout.cfg to pin all packages"
219 @bin/buildout -vvvvv | sed -ne 's/^Picked: //p' | sort | uniq
223 @eval "`cat .env`"; $$SHELL
233 upgrade: clean cleancache init