3 MAKE-SILENT = $(MAKE) --no-print-directory
7 # clean up and recompute
8 redo: clean-oldies redo-static redo-templates
11 rm -rf all-static all-templates django-static
22 build: static templates force
26 python setup.py install \
27 --install-purelib=$(DESTDIR)/$(datadir)/unfold \
28 --install-scripts=$(DESTDIR)/$(datadir)/unfold \
29 --install-data=$(DESTDIR)/$(datadir)/unfold
31 #################### third-party layout is managed as part of collectstatic
33 ./manage.py collectstatic --noinput
38 redo-static: clean-static static
42 DATE=$(shell date -u +"%a, %d %b %Y %T")
44 # This is called from the build with the following variables set
45 # (see build/Makefile and target_debian)
50 DEBVERSION=$(RPMVERSION).$(RPMRELEASE)
51 DEBTARBALL=../$(RPMNAME)_$(DEBVERSION).orig.tar.bz2
53 debian: static templates debian/changelog debian.source debian.package
55 debian/changelog: debian/changelog.in
56 sed -e "s|@VERSION@|$(DEBVERSION)|" -e "s|@DATE@|$(DATE)|" debian/changelog.in > debian/changelog
59 rsync -a $(RPMTARBALL) $(DEBTARBALL)
62 debuild --set-envvar PREFIX=/usr -uc -us -b
65 $(MAKE) -f debian/rules clean
66 rm -rf build/ MANIFEST ../*.tar.gz ../*.dsc ../*.build
67 find . -name '*.pyc' -delete
70 # having templates in a templates/ subdir is fine most of the time except for plugins
71 plugins-templates: force
72 @find plugins -type f -name '*.html'
73 local-templates: force
74 @$(foreach tmpl,$(shell find . -name templates | grep -v '^\./templates$$'),find $(tmpl) -maxdepth 2 -type f -name *.html;)
75 local-templates2: force
76 @$(foreach tmpl,$(shell find . -name templates | grep -v '^\./templates$$'),ls -1 $(tmpl)/*;)
79 list-templates: plugins-templates local-templates
81 #################### manage templates for the plugin area
84 ln -sf $(foreach x,$(shell $(MAKE-SILENT) list-templates),"../$(x)") ./templates
86 clean-templates templates-clean: force
89 redo-templates: clean-templates templates
92 ### list-all list-resources: list-templates list-js list-css list-img
94 #################### compute emacs tags
95 # list files under git but exclude third-party stuff like bootstrap and jquery
97 @git ls-files | egrep -v 'insert(_|-)above|third-party/|to-be-integrated/'
100 @git ls-files | grep '\.py$$'
102 # in general it's right to rely on the contents as reported by git
104 $(MAKE-SILENT) myfiles | xargs etags
106 # however sometimes we have stuff not yet added, so in this case
108 find . -type f | fgrep -v '/.git/' | xargs etags
110 ########################################
112 ########################################
114 #################### sync : push current code on a box running myslice
115 # this for now targets deployments based on the debian packaging
117 SSHURL := $(SSHUSER)@$(MYSLICEBOX):
118 SSHCOMMAND := ssh $(SSHUSER)@$(MYSLICEBOX)
121 # the config file should probably not be overridden ??
122 # --exclude settings.py
123 LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc'
124 LOCAL_RSYNC_EXCLUDES += --exclude '*.sqlite3' --exclude myslice.ini
125 LOCAL_RSYNC_EXCLUDES += --exclude static --exclude templates --exclude build
126 LOCAL_RSYNC_EXCLUDES += --exclude to-be-integrated --exclude third-party
128 RSYNC_EXCLUDES := --exclude .git --exclude '*~' --exclude TAGS --exclude .DS_Store $(LOCAL_RSYNC_EXCLUDES)
129 # make -n will propagate as rsync -n
130 RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
131 # putting it together
132 RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
134 #################### minimal convenience for pushing work-in-progress in an apache-based depl.
135 # xxx until we come up with a packaging this is going to be a wild guess
136 # on debian04 I have stuff in /usr/share/myslice and a symlink in /root/myslice
137 INSTALLED_MAIN =/usr/share/pyshared
138 # this is for a debian box
139 INSTALLED_APACHE =/etc/apache2/sites-available/
141 sync: sync-main sync-apache
144 ifeq (,$(MYSLICEBOX))
145 @echo "you need to set MYSLICEBOX, like in e.g."
146 @echo " $(MAKE) MYSLICEBOX=debian04.pl.sophia.inria.fr "$@""
149 +$(RSYNC) ./ $(SSHURL)/$(INSTALLED_MAIN)/
153 ifeq (,$(MYSLICEBOX))
154 @echo "you need to set MYSLICEBOX, like in e.g."
155 @echo " $(MAKE) MYSLICEBOX=debian04.pl.sophia.inria.fr "$@""
158 +$(RSYNC) ./apache/unfold.conf $(SSHURL)/$(INSTALLED_APACHE)/
159 +$(RSYNC) ./apache/unfold-init-ssl.sh $(SSHURL)/$(bindir)/
163 ifeq (,$(MYSLICEBOX))
164 @echo "you need to set MYSLICEBOX, like in e.g."
165 @echo " $(MAKE) MYSLICEBOX=debian04.pl.sophia.inria.fr "$@""
168 +$(SSHCOMMAND) apachectl restart
172 #MYSLICEBOX=srv-diana.inria.fr
174 ifeq (,$(MYSLICEBOX))
175 @echo "you need to set MYSLICEBOX, like in e.g."
176 @echo " $(MAKE) MYSLICEBOX=srv-diana.inria.fr "$@""
179 +$(RSYNC) --relative $$(git ls-files) $(SSHURL)myslice/