3 # Copyright © 2012, 2013 Brandon Invergo <brandon@invergo.net>
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.
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
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@
26 VIRTUALENV
= @VIRTUALENV@
30 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
31 INSTALL_DATA
= @INSTALL_DATA@
32 INSTALL_SCRIPT
= @INSTALL_SCRIPT@
35 exec_prefix = @
exec_prefix@
37 includedir = @
includedir@
41 abs_srcdir
= @abs_srcdir@
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@
49 EXTLIB_INSTALLS
= extlib
/jquery extlib
/video.js extlib
/leaflet extlib
/tinymce
51 # pkgpythondir = @pkgpythondir@
52 # pkgpyexecdir = @pkgpyexecdir@
53 # pythondir = @pythondir@
54 # pyexecdir = @pyexecdir@
55 # SPHINXBUILD = @SPHINXBUILD@
56 # POSTGRES = @POSTGRES@
59 # Maybe add a virtualenv prefix to a command
60 ifneq ($(VIRTUALENV
),no
)
61 # virtualenv specified to be included by config (default)
62 # ... we only use virtualenv for local development, we don't
66 maybe_venved_python
= .
/bin
/python
67 # Yes, build the virtualenv as a dependency!
68 maybe_venv_dep
= virtualenv
70 maybe_venv_clean
= clean-virtualenv
73 # --without-virtualenv must have been passed in... don't build
74 # a local virtualenv or use such commands
76 maybe_venved_python
= $(PYTHON
)
77 # No need for commands to build virtualenv as a dependency!
83 .PHONY
: all install uninstall distclean info install-html html \
84 install-pdf pdf install-dvi
dvi install-ps ps
clean dist check \
85 installdirs i18n virtualenv docs extlib
92 ifneq ($(VIRTUALENV
),no
)
93 source bin
/activate
&& cd docs
&& make html
98 # In the future we may provide more options than just npm/bower here
99 # eg, we may support guix updating.
101 .
/devtools
/update_extlib.sh
103 develop
: $(maybe_venv_dep
) i18n mediagoblin.ini
105 # NEVER clobber a user's mediagoblin.ini once they've defined it
107 cp
--no-clobber mediagoblin.example.ini mediagoblin.ini
109 # base-configs: paste.ini mediagoblin.example.ini
112 $(maybe_venved_python
) $(srcdir)/setup.py
install --prefix=$(DESTDIR
)$(prefix)
115 # In the future, maybe we can compile the individual .po files here?
116 i18n
: $(maybe_venv_dep
)
117 .
/devtools
/compile_translations.sh
120 ifneq ($(VIRTUALENV
),no
)
123 virtualenv
--system-site-packages
--python
=$(PYTHON
) .
124 .
/bin
/python setup.py develop
--upgrade
126 virtualenv
: bin
/python extlib
134 # setup.py doesn't (yet) support an uninstall command, so until it does, you
135 # must manually remove everything that was installed here. The following example
136 # should remove a basic package installed via setup.py, but please double- and
137 # triple-check it so that you don't remove something you shouldn't!
138 # Be sure to remove any extra files you install, such as binaries or documentation!
141 # rm -rvf $(pkgpythondir)
142 # rm -v $(pythondir)/$(PACKAGE_DISTNAME)-*.egg-info
147 @echo
"No rule to clean house, yet."
148 @echo
"distclean works but might do more than you want. :)"
151 # We don't know what this does yet.
153 ## Just use the usual setup.py clean command
155 # $(maybe_venved_python) setup.py clean
158 # It's not obvious to me whether the virtualenv/bower/npm things should be
159 # auto-cleaned as part of distclean. I'm leaning towards "yes" for now but
160 # I'm not really happy about that.
162 # Clean up the output of configure
163 distclean: $(maybe_venv_clean
)
164 rm -vf
$(srcdir)/config.log
165 rm -vf
$(srcdir)/config.status
166 rm -rvf
$(srcdir)/autom4te.cache
167 rm -vf
$(srcdir)/aclocal.m4
168 rm -rf
$(EXTLIB_INSTALLS
)
170 rm -vf
$(srcdir)/Makefile
173 ###########################################################################
174 # These things aren't really tested / supported yet.
175 ###########################################################################
179 # You can either use the setup.py sdist command or you can roll your own here
181 # $(maybe_venved_python) setup.py sdist
182 mkdir
$(PACKAGE_DISTNAME
)
183 cp
-r
$(DISTFILES
) $(PACKAGE_DISTNAME
)
184 tar -czf
$(PACKAGE_DISTNAME
).
tar.gz
$(PACKAGE_DISTNAME
)
185 rm -rf
$(PACKAGE_DISTNAME
)
187 # Use the setup.py check command
189 $(maybe_venved_python
) setup.py
check
191 # setup.py might complain if a directory doesn't exist so just in case, make the directory
194 $(MKDIR_P
) $(DESTDIR
)$(prefix)
196 # # Set up PostgreSQL
198 # sudo -u $(POSTGRES) createuser mediagoblin
199 # sudo -u $(POSTGRES) createdb -E UNICODE -O mediagoblin mediagoblin
202 # ifneq ($(VIRTUALENV),no)
203 # $(prefix)/bin/python $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade
205 # $(PYTHON) $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade
207 # $(prefix)/bin/gmg dbupdate
209 ######################
210 # Needs to be updated?
211 ######################
213 # The following show how to install documentation. In this example,
214 # docs are built from a separate Makefile contained in the docs
215 # directory which uses the SPHINXBUILD variable to store the location
216 # of the sphinx-build (Python doc tool) binary to use.
218 $(DESTDIR
)$(infodir)/mediagoblin.
info: docs
/build
/texinfo
/mediagoblin.
info
220 $(INSTALL_DATA
) @
< $(DESTDIR
)$@
221 if
$(SHELL
) -c
'install-info --version' >/dev
/null
2>&1; then
222 install-info
--dir-file
=$(DESTDIR
)$(infodir)/dir \
223 $(DESTDIR
)$(infodir)/foo.
info;
226 info: docs
/build
/texinfo
/mediagoblin.
info
228 docs
/build
/texinfo
/mediagoblin.
info: $(wildcard docs
/source
/*)
229 ifneq ($(SPHINXBUILD
),no
)
230 $(MAKE
) -C docs
info SPHINXBUILD
=$(SPHINXBUILD
)
234 install-html
: html
installdirs
235 $(INSTALL_DATA
) docs
/build
/html
/* $(DESTDIR
)$(htmldir
)
237 html
: docs
/build
/html
/index.html
239 docs
/build
/html
/index.html
: $(wildcard $(srcdir)/docs
/source
/*)
240 ifneq ($(SPHINXBUILD
),no
)
241 $(MAKE
) -C docs html SPHINXBUILD
=$(SPHINXBUILD
)
245 install-pdf
: pdf
installdirs
246 $(INSTALL_DATA
) docs
/build
/latex
/mediagoblin.pdf
$(DESTDIR
)$(pdfdir
)
248 pdf
: docs
/build
/latex
/mediagoblin.pdf
250 docs
/build
/latex
/mediagoblin.pdf
: $(wildcard $(srcdir)/docs
/source
/*)
251 ifneq ($(SPHINXBUILD
),no
)
252 $(MAKE
) -C docs latexpdf SPHINXBUILD
=$(SPHINXBUILD
)
256 # Targets that don't seem supported?