Updated MediaGoblin config stuff to latest pyconfigure release
[mediagoblin.git] / Makefile.in
CommitLineData
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
13DISTFILES = PKG-INFO Makefile.in configure setup.py install-sh
14
15DESTDIR =
16VPATH = @srcdir@
17PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
18PACKAGE_NAME = @PACKAGE_NAME@
19PACKAGE_STRING = @PACKAGE_STRING@
20PACKAGE_TARNAME = @PACKAGE_TARNAME@
21PACKAGE_DISTNAME = ${PACKAGE_NAME}-${PACKAGE_VERSION}
22PACKAGE_URL = @PACKAGE_URL@
23PACKAGE_VERSION = @PACKAGE_VERSION@
24PATH_SEPARATOR = @PATH_SEPARATOR@
25PYTHON = @PYTHON@
26VIRTUALENV = @VIRTUALENV@
27SPHINXBUILD = @SPHINXBUILD@
ceb768ae 28POSTGRES = @POSTGRES@
0a2eecf8
BI
29SHELL = @SHELL@
30MKDIR_P = @MKDIR_P@
31INSTALL = @INSTALL@
32INSTALL_PROGRAM = @INSTALL_PROGRAM@
33INSTALL_DATA = @INSTALL_DATA@
34INSTALL_SCRIPT = @INSTALL_SCRIPT@
35docdir = @docdir@
36dvidir = @dvidir@
37exec_prefix = @exec_prefix@
38htmldir = @htmldir@
39includedir = @includedir@
40infodir = @infodir@
41prefix = @prefix@
42srcdir = @srcdir@
e56b493a 43abs_srcdir = @abs_srcdir@
0a2eecf8
BI
44datadir = @datadir@
45datarootdir = @datarootdir@
46pythondir = @pythondir@
47pyexecdir = @pyexecdir@
48pkgdatadir = $(datadir)/@PACKAGE_NAME@
49pkgincludedir = $(includedir)/@PACKAGE_NAME@
50pkgpythondir = @pkgpythondir@
51pkgpyexecdir = @pkgpyexecdir@
52PYTHONPATH = $(pythondir)$(PATH_SEPARATOR)$(DESTDIR)$(pythondir)
53
345b9588 54all: develop
0a2eecf8
BI
55
56.PHONY: all install develop uninstall distclean info install-html html \
57install-pdf pdf install-dvi dvi install-ps ps clean dist check \
58installdirs postgresql update
59
297a262c
BI
60# Since installing to a virtualenv is all the rage these days, support
61# it here. If the VIRTUALENV variable is set to anything other than
62# "no", set up a new virtualenv and install there, otherwise install
63# as usual from setup.py
0a2eecf8
BI
64install: installdirs
65 $(NORMAL_INSTALL)
66ifneq ($(VIRTUALENV),no)
297a262c
BI
67 $(VIRTUALENV) $(VIRTUALENV_FLAGS) --python=$(PYTHON) \
68 --system-site-packages $(DESTDIR)$(prefix) || \
69 $(VIRTUALENV) $(DESTDIR)$(prefix)
70 $(DESTDIR)$(prefix)/bin/python $(srcdir)/setup.py install \
71 --prefix=$(DESTDIR)$(prefix)
0a2eecf8
BI
72else
73 $(PYTHON) $(srcdir)/setup.py install --prefix=$(DESTDIR)$(prefix)
74endif
a9dc855a
CAW
75# if [[ $(DESTDIR)$(prefix) != $(abs_srcdir) ]]; then \
76# $(INSTALL_DATA) $(srcdir)/Makefile $(DESTDIR)$(prefix)/Makefile; \
77# $(INSTALL_DATA) $(srcdir)/lazycelery.sh $(DESTDIR)$(prefix)/lazycelery.sh; \
78# $(INSTALL_DATA) $(srcdir)/lazyserver.sh $(DESTDIR)$(prefix)/lazyserver.sh; \
79# fi
0a2eecf8
BI
80
81# The same as "install", except use the "develop" setup.py target
82develop: installdirs
83 $(NORMAL_INSTALL)
84ifneq ($(VIRTUALENV),no)
297a262c
BI
85 $(VIRTUALENV) $(VIRTUALENV_FLAGS) --python=$(PYTHON) \
86 --system-site-packages $(DESTDIR)$(prefix) || \
87 $(VIRTUALENV) $(DESTDIR)$(prefix)
88 $(DESTDIR)$(prefix)/bin/python $(srcdir)/setup.py develop \
89 --prefix=$(DESTDIR)$(prefix)
0a2eecf8
BI
90else
91 $(PYTHON) $(srcdir)/setup.py develop --prefix=$(DESTDIR)$(prefix)
92endif
e56b493a
BI
93 if [ "$(DESTDIR)$(prefix)" != "$(abs_srcdir)" ]; then \
94 $(INSTALL_DATA) $(srcdir)/Makefile $(DESTDIR)$(prefix)/Makefile; \
95 $(INSTALL_DATA) $(srcdir)/lazycelery.sh $(DESTDIR)$(prefix)/lazycelery.sh; \
96 $(INSTALL_DATA) $(srcdir)/lazyserver.sh $(DESTDIR)$(prefix)/lazyserver.sh; \
a09f66ad 97 fi
0a2eecf8
BI
98
99
100# setup.py doesn't (yet) support an uninstall command, so until it does, you
101# must manually remove everything that was installed here. The following example
102# should remove a basic package installed via setup.py, but please double- and
103# triple-check it so that you don't remove something you shouldn't!
104# Be sure to remove any extra files you install, such as binaries or documentation!
a9dc855a 105#
297a262c 106# uninstall:
a9dc855a
CAW
107# rm -rvf $(pkgpythondir)
108# rm -v $(pythondir)/$(PACKAGE_DISTNAME)-*.egg-info
109#
0a2eecf8
BI
110
111# Just use the usual setup.py clean command
112clean:
113 $(PYTHON) setup.py clean
114
115
116# Clean up the output of configure
117distclean:
118 rm -v $(srcdir)/config.log
119 rm -v $(srcdir)/config.status
120 rm -rvf $(srcdir)/autom4te.cache
e4801f4d 121 rm -v $(srcdir)/aclocal.m4
0a2eecf8
BI
122 rm -v $(srcdir)/Makefile
123
124# You can either use the setup.py sdist command or you can roll your own here
125dist:
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
133check:
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
138installdirs:
d45673c0 139 $(MKDIR_P) $(DESTDIR)$(prefix)
0a2eecf8
BI
140
141# Set up PostgreSQL
142postgresql:
ceb768ae
BI
143 sudo -u $(POSTGRES) createuser mediagoblin
144 sudo -u $(POSTGRES) createdb -E UNICODE -O mediagoblin mediagoblin
0a2eecf8
BI
145
146update:
147ifneq ($(VIRTUALENV),no)
297a262c 148 $(prefix)/bin/python $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade
0a2eecf8 149else
297a262c 150 $(PYTHON) $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade
0a2eecf8
BI
151endif
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
167info: docs/build/texinfo/mediagoblin.info
168
169docs/build/texinfo/mediagoblin.info: $(wildcard docs/source/*)
170ifneq ($(SPHINXBUILD),no)
171 $(MAKE) -C docs info SPHINXBUILD=$(SPHINXBUILD)
172endif
173
174
175install-html: html installdirs
176 $(INSTALL_DATA) docs/build/html/* $(DESTDIR)$(htmldir)
177
178html: docs/build/html/index.html
179
180docs/build/html/index.html: $(wildcard $(srcdir)/docs/source/*)
181ifneq ($(SPHINXBUILD),no)
182 $(MAKE) -C docs html SPHINXBUILD=$(SPHINXBUILD)
183endif
184
185
186install-pdf: pdf installdirs
187 $(INSTALL_DATA) docs/build/latex/mediagoblin.pdf $(DESTDIR)$(pdfdir)
188
189pdf: docs/build/latex/mediagoblin.pdf
190
191docs/build/latex/mediagoblin.pdf: $(wildcard $(srcdir)/docs/source/*)
192ifneq ($(SPHINXBUILD),no)
193 $(MAKE) -C docs latexpdf SPHINXBUILD=$(SPHINXBUILD)
194endif
195
196
197install-dvi:
198
199dvi:
200
201install-ps:
202
203ps:
204
205