Commit | Line | Data |
---|---|---|
0a2eecf8 BI |
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 | SPHINXBUILD = @SPHINXBUILD@ | |
ceb768ae | 28 | POSTGRES = @POSTGRES@ |
0a2eecf8 BI |
29 | SHELL = @SHELL@ |
30 | MKDIR_P = @MKDIR_P@ | |
31 | INSTALL = @INSTALL@ | |
32 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
33 | INSTALL_DATA = @INSTALL_DATA@ | |
34 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | |
35 | docdir = @docdir@ | |
36 | dvidir = @dvidir@ | |
37 | exec_prefix = @exec_prefix@ | |
38 | htmldir = @htmldir@ | |
39 | includedir = @includedir@ | |
40 | infodir = @infodir@ | |
41 | prefix = @prefix@ | |
42 | srcdir = @srcdir@ | |
43 | datadir = @datadir@ | |
44 | datarootdir = @datarootdir@ | |
45 | pythondir = @pythondir@ | |
46 | pyexecdir = @pyexecdir@ | |
47 | pkgdatadir = $(datadir)/@PACKAGE_NAME@ | |
48 | pkgincludedir = $(includedir)/@PACKAGE_NAME@ | |
49 | pkgpythondir = @pkgpythondir@ | |
50 | pkgpyexecdir = @pkgpyexecdir@ | |
51 | PYTHONPATH = $(pythondir)$(PATH_SEPARATOR)$(DESTDIR)$(pythondir) | |
52 | ||
53 | all: install | |
54 | ||
55 | .PHONY: all install develop uninstall distclean info install-html html \ | |
56 | install-pdf pdf install-dvi dvi install-ps ps clean dist check \ | |
57 | installdirs postgresql update | |
58 | ||
297a262c BI |
59 | # Since installing to a virtualenv is all the rage these days, support |
60 | # it here. If the VIRTUALENV variable is set to anything other than | |
61 | # "no", set up a new virtualenv and install there, otherwise install | |
62 | # as usual from setup.py | |
0a2eecf8 BI |
63 | install: installdirs |
64 | $(NORMAL_INSTALL) | |
65 | ifneq ($(VIRTUALENV),no) | |
297a262c BI |
66 | $(VIRTUALENV) $(VIRTUALENV_FLAGS) --python=$(PYTHON) \ |
67 | --system-site-packages $(DESTDIR)$(prefix) || \ | |
68 | $(VIRTUALENV) $(DESTDIR)$(prefix) | |
69 | $(DESTDIR)$(prefix)/bin/python $(srcdir)/setup.py install \ | |
70 | --prefix=$(DESTDIR)$(prefix) | |
0a2eecf8 BI |
71 | else |
72 | $(PYTHON) $(srcdir)/setup.py install --prefix=$(DESTDIR)$(prefix) | |
73 | endif | |
a09f66ad BI |
74 | if [[ $(DESTDIR)$(prefix) != $(srcdir) ]]; then |
75 | $(INSTALL_DATA) $(srcdir)/Makefile $(DESTDIR)$(prefix)/Makefile | |
76 | $(INSTALL_DATA) $(srcdir)/lazycelery.sh $(DESTDIR)$(prefix)/lazycelery.sh | |
77 | $(INSTALL_DATA) $(srcdir)/lazyserver.sh $(DESTDIR)$(prefix)/lazyserver.sh | |
78 | fi | |
0a2eecf8 BI |
79 | |
80 | # The same as "install", except use the "develop" setup.py target | |
81 | develop: installdirs | |
82 | $(NORMAL_INSTALL) | |
83 | ifneq ($(VIRTUALENV),no) | |
297a262c BI |
84 | $(VIRTUALENV) $(VIRTUALENV_FLAGS) --python=$(PYTHON) \ |
85 | --system-site-packages $(DESTDIR)$(prefix) || \ | |
86 | $(VIRTUALENV) $(DESTDIR)$(prefix) | |
87 | $(DESTDIR)$(prefix)/bin/python $(srcdir)/setup.py develop \ | |
88 | --prefix=$(DESTDIR)$(prefix) | |
0a2eecf8 BI |
89 | else |
90 | $(PYTHON) $(srcdir)/setup.py develop --prefix=$(DESTDIR)$(prefix) | |
91 | endif | |
a09f66ad BI |
92 | if [[ $(DESTDIR)$(prefix) != $(srcdir) ]]; then |
93 | $(INSTALL_DATA) $(srcdir)/Makefile $(DESTDIR)$(prefix)/Makefile | |
94 | $(INSTALL_DATA) $(srcdir)/lazycelery.sh $(DESTDIR)$(prefix)/lazycelery.sh | |
95 | $(INSTALL_DATA) $(srcdir)/lazyserver.sh $(DESTDIR)$(prefix)/lazyserver.sh | |
96 | fi | |
0a2eecf8 BI |
97 | |
98 | ||
99 | # setup.py doesn't (yet) support an uninstall command, so until it does, you | |
100 | # must manually remove everything that was installed here. The following example | |
101 | # should remove a basic package installed via setup.py, but please double- and | |
102 | # triple-check it so that you don't remove something you shouldn't! | |
103 | # Be sure to remove any extra files you install, such as binaries or documentation! | |
297a262c | 104 | # uninstall: |
d45673c0 BI |
105 | # case $(prefix) in |
106 | # /usr|/usr/local ) | |
107 | # exit 1 ;; | |
108 | # /www/*|/srv/* ) | |
109 | # rm -rvf $(prefix) ;; | |
110 | # esac | |
0a2eecf8 BI |
111 | |
112 | # Just use the usual setup.py clean command | |
113 | clean: | |
114 | $(PYTHON) setup.py clean | |
115 | ||
116 | ||
117 | # Clean up the output of configure | |
118 | distclean: | |
119 | rm -v $(srcdir)/config.log | |
120 | rm -v $(srcdir)/config.status | |
121 | rm -rvf $(srcdir)/autom4te.cache | |
122 | rm -v $(srcdir)/Makefile | |
123 | ||
124 | # You can either use the setup.py sdist command or you can roll your own here | |
125 | dist: | |
126 | # $(PYTHON) setup.py sdist | |
127 | mkdir $(PACKAGE_DISTNAME) | |
128 | cp -r $(DISTFILES) $(PACKAGE_DISTNAME) | |
129 | tar -czf $(PACKAGE_DISTNAME).tar.gz $(PACKAGE_DISTNAME) | |
130 | rm -rf $(PACKAGE_DISTNAME) | |
131 | ||
132 | # Use the setup.py check command | |
133 | check: | |
134 | $(PYTHON) setup.py check | |
135 | ||
136 | # setup.py might complain if a directory doesn't exist so just in case, make the directory | |
137 | # here | |
138 | installdirs: | |
d45673c0 | 139 | $(MKDIR_P) $(DESTDIR)$(prefix) |
0a2eecf8 BI |
140 | |
141 | # Set up PostgreSQL | |
142 | postgresql: | |
ceb768ae BI |
143 | sudo -u $(POSTGRES) createuser mediagoblin |
144 | sudo -u $(POSTGRES) createdb -E UNICODE -O mediagoblin mediagoblin | |
0a2eecf8 BI |
145 | |
146 | update: | |
147 | ifneq ($(VIRTUALENV),no) | |
297a262c | 148 | $(prefix)/bin/python $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade |
0a2eecf8 | 149 | else |
297a262c | 150 | $(PYTHON) $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade |
0a2eecf8 BI |
151 | endif |
152 | $(prefix)/bin/gmg dbupdate | |
153 | ||
154 | # The following show how to install documentation. In this example, | |
155 | # docs are built from a separate Makefile contained in the docs | |
156 | # directory which uses the SPHINXBUILD variable to store the location | |
157 | # of the sphinx-build (Python doc tool) binary to use. | |
158 | ||
159 | $(DESTDIR)$(infodir)/mediagoblin.info: docs/build/texinfo/mediagoblin.info | |
160 | $(POST_INSTALL) | |
161 | $(INSTALL_DATA) @< $(DESTDIR)$@ | |
162 | if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then | |
163 | install-info --dir-file=$(DESTDIR)$(infodir)/dir \ | |
164 | $(DESTDIR)$(infodir)/foo.info; | |
165 | else true; fi | |
166 | ||
167 | info: docs/build/texinfo/mediagoblin.info | |
168 | ||
169 | docs/build/texinfo/mediagoblin.info: $(wildcard docs/source/*) | |
170 | ifneq ($(SPHINXBUILD),no) | |
171 | $(MAKE) -C docs info SPHINXBUILD=$(SPHINXBUILD) | |
172 | endif | |
173 | ||
174 | ||
175 | install-html: html installdirs | |
176 | $(INSTALL_DATA) docs/build/html/* $(DESTDIR)$(htmldir) | |
177 | ||
178 | html: docs/build/html/index.html | |
179 | ||
180 | docs/build/html/index.html: $(wildcard $(srcdir)/docs/source/*) | |
181 | ifneq ($(SPHINXBUILD),no) | |
182 | $(MAKE) -C docs html SPHINXBUILD=$(SPHINXBUILD) | |
183 | endif | |
184 | ||
185 | ||
186 | install-pdf: pdf installdirs | |
187 | $(INSTALL_DATA) docs/build/latex/mediagoblin.pdf $(DESTDIR)$(pdfdir) | |
188 | ||
189 | pdf: docs/build/latex/mediagoblin.pdf | |
190 | ||
191 | docs/build/latex/mediagoblin.pdf: $(wildcard $(srcdir)/docs/source/*) | |
192 | ifneq ($(SPHINXBUILD),no) | |
193 | $(MAKE) -C docs latexpdf SPHINXBUILD=$(SPHINXBUILD) | |
194 | endif | |
195 | ||
196 | ||
197 | install-dvi: | |
198 | ||
199 | dvi: | |
200 | ||
201 | install-ps: | |
202 | ||
203 | ps: | |
204 | ||
205 |