Users now get an editable copy of mediagoblin.example.ini->mediagoblin.ini
[mediagoblin.git] / Makefile.in
1 # Makefile.in
2 #
3 # Copyright © 2012, 2013 Brandon Invergo <brandon@invergo.net>
4 #
5 # Copying and distribution of this file, with or without modification,
6 # are permitted in any medium without royalty provided the copyright
7 # notice and this notice are preserved. This file is offered as-is,
8 # without any warranty.
9
10 # List whatever files you want to include in your source distribution here.
11 # You can include whole directories but note that *everything* under that
12 # directory will be included
13 DISTFILES = PKG-INFO Makefile.in configure setup.py install-sh
14
15 DESTDIR =
16 VPATH = @srcdir@
17 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
18 PACKAGE_NAME = @PACKAGE_NAME@
19 PACKAGE_STRING = @PACKAGE_STRING@
20 PACKAGE_TARNAME = @PACKAGE_TARNAME@
21 PACKAGE_DISTNAME = ${PACKAGE_NAME}-${PACKAGE_VERSION}
22 PACKAGE_URL = @PACKAGE_URL@
23 PACKAGE_VERSION = @PACKAGE_VERSION@
24 PATH_SEPARATOR = @PATH_SEPARATOR@
25 PYTHON = @PYTHON@
26 VIRTUALENV = @VIRTUALENV@
27 SHELL = @SHELL@
28 MKDIR_P = @MKDIR_P@
29 INSTALL = @INSTALL@
30 INSTALL_PROGRAM = @INSTALL_PROGRAM@
31 INSTALL_DATA = @INSTALL_DATA@
32 INSTALL_SCRIPT = @INSTALL_SCRIPT@
33 docdir = @docdir@
34 dvidir = @dvidir@
35 exec_prefix = @exec_prefix@
36 htmldir = @htmldir@
37 includedir = @includedir@
38 infodir = @infodir@
39 prefix = @prefix@
40 srcdir = @srcdir@
41 abs_srcdir = @abs_srcdir@
42 datadir = @datadir@
43 datarootdir = @datarootdir@
44 pkgdatadir = $(datadir)/@PACKAGE_NAME@
45 pkgincludedir = $(includedir)/@PACKAGE_NAME@
46 PYTHONPATH = $(pythondir)$(PATH_SEPARATOR)$(DESTDIR)$(pythondir)
47 USE_PYTHON3 = @USE_PYTHON3@
48
49 # pkgpythondir = @pkgpythondir@
50 # pkgpyexecdir = @pkgpyexecdir@
51 # pythondir = @pythondir@
52 # pyexecdir = @pyexecdir@
53 # SPHINXBUILD = @SPHINXBUILD@
54 # POSTGRES = @POSTGRES@
55
56
57 # Maybe add a virtualenv prefix to a command
58 ifneq ($(VIRTUALENV),no)
59 # virtualenv specified to be included by config (default)
60 # ... we only use virtualenv for local development, we don't
61 # auto-deploy to it.
62
63 maybe_venved = ./bin/
64 maybe_venved_python = ./bin/python
65 # Yes, build the virtualenv as a dependency!
66 maybe_venv_dep = ./bin/python
67
68 else
69 # --without-virtualenv must have been passed in... don't build
70 # a local virtualenv or use such commands
71 maybe_venved =
72 maybe_venved_python = $(PYTHON)
73 # No need for commands to build virtualenv as a dependency!
74 maybe_venv_dep =
75 endif
76
77 .PHONY: all install uninstall distclean info install-html html \
78 install-pdf pdf install-dvi dvi install-ps ps clean dist check \
79 installdirs i18n virtualenv
80 # update postgresql
81
82 all: develop
83
84 develop: $(maybe_venv_dep) i18n paste.ini mediagoblin.ini
85
86 mediagoblin.ini:
87 cp --no-clobber mediagoblin.example.ini mediagoblin.ini
88
89 # We just symlink the mediagoblin from the appropriate python version
90 paste.ini:
91 ifeq ($(USE_PYTHON3),yes)
92 -ln -s paste.py3.ini paste.ini
93 else
94 -ln -s paste.py2.ini paste.ini
95 endif
96
97 # base-configs: paste.ini mediagoblin.example.ini
98
99 install: installdirs
100 $(maybe_venved_python) $(srcdir)/setup.py install --prefix=$(DESTDIR)$(prefix)
101
102
103 i18n: $(maybe_venv_dep)
104 $(maybe_venved)pybabel compile -D mediagoblin -d mediagoblin/i18n/
105
106
107 ifneq ($(VIRTUALENV),no)
108 ./bin/python:
109 rm -f ./bin/python
110 virtualenv --system-site-packages .
111 ./bin/python setup.py develop --upgrade
112
113 virtualenv: bin/python
114
115 clean-virtualenv:
116 rm -rf ./bin/
117 rm -rf ./lib/
118 endif
119
120 # setup.py doesn't (yet) support an uninstall command, so until it does, you
121 # must manually remove everything that was installed here. The following example
122 # should remove a basic package installed via setup.py, but please double- and
123 # triple-check it so that you don't remove something you shouldn't!
124 # Be sure to remove any extra files you install, such as binaries or documentation!
125 #
126 # uninstall:
127 # rm -rvf $(pkgpythondir)
128 # rm -v $(pythondir)/$(PACKAGE_DISTNAME)-*.egg-info
129 #
130
131 # Just use the usual setup.py clean command
132 clean:
133 $(maybe_venved_python) setup.py clean
134
135
136 # Clean up the output of configure
137 distclean:
138 rm -v $(srcdir)/config.log
139 rm -v $(srcdir)/config.status
140 rm -rvf $(srcdir)/autom4te.cache
141 rm -v $(srcdir)/aclocal.m4
142 rm -v $(srcdir)/Makefile
143 rm -v $(srcdir)/env
144
145
146 # You can either use the setup.py sdist command or you can roll your own here
147 dist:
148 # $(maybe_venved_python) setup.py sdist
149 mkdir $(PACKAGE_DISTNAME)
150 cp -r $(DISTFILES) $(PACKAGE_DISTNAME)
151 tar -czf $(PACKAGE_DISTNAME).tar.gz $(PACKAGE_DISTNAME)
152 rm -rf $(PACKAGE_DISTNAME)
153
154 # Use the setup.py check command
155 check:
156 $(maybe_venved_python) setup.py check
157
158 # setup.py might complain if a directory doesn't exist so just in case, make the directory
159 # here
160 installdirs:
161 $(MKDIR_P) $(DESTDIR)$(prefix)
162
163 # # Set up PostgreSQL
164 # postgresql:
165 # sudo -u $(POSTGRES) createuser mediagoblin
166 # sudo -u $(POSTGRES) createdb -E UNICODE -O mediagoblin mediagoblin
167
168 # update:
169 # ifneq ($(VIRTUALENV),no)
170 # $(prefix)/bin/python $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade
171 # else
172 # $(PYTHON) $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade
173 # endif
174 # $(prefix)/bin/gmg dbupdate
175
176 # The following show how to install documentation. In this example,
177 # docs are built from a separate Makefile contained in the docs
178 # directory which uses the SPHINXBUILD variable to store the location
179 # of the sphinx-build (Python doc tool) binary to use.
180
181 $(DESTDIR)$(infodir)/mediagoblin.info: docs/build/texinfo/mediagoblin.info
182 $(POST_INSTALL)
183 $(INSTALL_DATA) @< $(DESTDIR)$@
184 if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then
185 install-info --dir-file=$(DESTDIR)$(infodir)/dir \
186 $(DESTDIR)$(infodir)/foo.info;
187 else true; fi
188
189 info: docs/build/texinfo/mediagoblin.info
190
191 docs/build/texinfo/mediagoblin.info: $(wildcard docs/source/*)
192 ifneq ($(SPHINXBUILD),no)
193 $(MAKE) -C docs info SPHINXBUILD=$(SPHINXBUILD)
194 endif
195
196
197 install-html: html installdirs
198 $(INSTALL_DATA) docs/build/html/* $(DESTDIR)$(htmldir)
199
200 html: docs/build/html/index.html
201
202 docs/build/html/index.html: $(wildcard $(srcdir)/docs/source/*)
203 ifneq ($(SPHINXBUILD),no)
204 $(MAKE) -C docs html SPHINXBUILD=$(SPHINXBUILD)
205 endif
206
207
208 install-pdf: pdf installdirs
209 $(INSTALL_DATA) docs/build/latex/mediagoblin.pdf $(DESTDIR)$(pdfdir)
210
211 pdf: docs/build/latex/mediagoblin.pdf
212
213 docs/build/latex/mediagoblin.pdf: $(wildcard $(srcdir)/docs/source/*)
214 ifneq ($(SPHINXBUILD),no)
215 $(MAKE) -C docs latexpdf SPHINXBUILD=$(SPHINXBUILD)
216 endif
217
218
219 # Targets that don't seem supported?
220
221 install-dvi:
222
223 dvi:
224
225 install-ps:
226
227 ps:
228
229