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