PATH_SEPARATOR = @PATH_SEPARATOR@
PYTHON = @PYTHON@
VIRTUALENV = @VIRTUALENV@
-SPHINXBUILD = @SPHINXBUILD@
-POSTGRES = @POSTGRES@
SHELL = @SHELL@
MKDIR_P = @MKDIR_P@
INSTALL = @INSTALL@
abs_srcdir = @abs_srcdir@
datadir = @datadir@
datarootdir = @datarootdir@
-pythondir = @pythondir@
-pyexecdir = @pyexecdir@
pkgdatadir = $(datadir)/@PACKAGE_NAME@
pkgincludedir = $(includedir)/@PACKAGE_NAME@
-pkgpythondir = @pkgpythondir@
-pkgpyexecdir = @pkgpyexecdir@
PYTHONPATH = $(pythondir)$(PATH_SEPARATOR)$(DESTDIR)$(pythondir)
+USE_PYTHON3 = @USE_PYTHON3@
-all: develop
+# pkgpythondir = @pkgpythondir@
+# pkgpyexecdir = @pkgpyexecdir@
+# pythondir = @pythondir@
+# pyexecdir = @pyexecdir@
+# SPHINXBUILD = @SPHINXBUILD@
+# POSTGRES = @POSTGRES@
-.PHONY: all install develop uninstall distclean info install-html html \
-install-pdf pdf install-dvi dvi install-ps ps clean dist check \
-installdirs postgresql update
-# Since installing to a virtualenv is all the rage these days, support
-# it here. If the VIRTUALENV variable is set to anything other than
-# "no", set up a new virtualenv and install there, otherwise install
-# as usual from setup.py
-install: installdirs
- $(NORMAL_INSTALL)
+# Maybe add a virtualenv prefix to a command
ifneq ($(VIRTUALENV),no)
- $(VIRTUALENV) $(VIRTUALENV_FLAGS) --python=$(PYTHON) \
- --system-site-packages $(DESTDIR)$(prefix) || \
- $(VIRTUALENV) $(DESTDIR)$(prefix)
- $(DESTDIR)$(prefix)/bin/python $(srcdir)/setup.py install \
- --prefix=$(DESTDIR)$(prefix)
+# virtualenv specified to be included by config (default)
+# ... we only use virtualenv for local development, we don't
+# auto-deploy to it.
+
+maybe_venved = ./bin/
+maybe_venved_python = ./bin/python
+# Yes, build the virtualenv as a dependency!
+maybe_venv_dep = ./bin/python
+
else
- $(PYTHON) $(srcdir)/setup.py install --prefix=$(DESTDIR)$(prefix)
+# --without-virtualenv must have been passed in... don't build
+# a local virtualenv or use such commands
+maybe_venved =
+maybe_venved_python = $(PYTHON)
+# No need for commands to build virtualenv as a dependency!
+maybe_venv_dep =
endif
- if [[ $(DESTDIR)$(prefix) != $(abs_srcdir) ]]; then \
- $(INSTALL_DATA) $(srcdir)/Makefile $(DESTDIR)$(prefix)/Makefile; \
- $(INSTALL_DATA) $(srcdir)/lazycelery.sh $(DESTDIR)$(prefix)/lazycelery.sh; \
- $(INSTALL_DATA) $(srcdir)/lazyserver.sh $(DESTDIR)$(prefix)/lazyserver.sh; \
- fi
-
-# The same as "install", except use the "develop" setup.py target
-develop: installdirs
- $(NORMAL_INSTALL)
-ifneq ($(VIRTUALENV),no)
- $(VIRTUALENV) $(VIRTUALENV_FLAGS) --python=$(PYTHON) \
- --system-site-packages $(DESTDIR)$(prefix) || \
- $(VIRTUALENV) $(DESTDIR)$(prefix)
- $(DESTDIR)$(prefix)/bin/python $(srcdir)/setup.py develop \
- --prefix=$(DESTDIR)$(prefix)
+
+.PHONY: all install uninstall distclean info install-html html \
+install-pdf pdf install-dvi dvi install-ps ps clean dist check \
+installdirs i18n virtualenv
+# update postgresql
+
+all: develop
+
+develop: $(maybe_venv_dep) i18n paste.ini mediagoblin.ini
+
+# NEVER clobber a user's mediagoblin.ini once they've defined it
+mediagoblin.ini:
+ cp --no-clobber mediagoblin.example.ini mediagoblin.ini
+
+# We just symlink the mediagoblin from the appropriate python version
+paste.ini:
+ifeq ($(USE_PYTHON3),yes)
+ -ln -s paste.py3.ini paste.ini
else
- $(PYTHON) $(srcdir)/setup.py develop --prefix=$(DESTDIR)$(prefix)
+ -ln -s paste.py2.ini paste.ini
endif
- if [ "$(DESTDIR)$(prefix)" != "$(abs_srcdir)" ]; then \
- $(INSTALL_DATA) $(srcdir)/Makefile $(DESTDIR)$(prefix)/Makefile; \
- $(INSTALL_DATA) $(srcdir)/lazycelery.sh $(DESTDIR)$(prefix)/lazycelery.sh; \
- $(INSTALL_DATA) $(srcdir)/lazyserver.sh $(DESTDIR)$(prefix)/lazyserver.sh; \
- fi
+
+# base-configs: paste.ini mediagoblin.example.ini
+
+install: installdirs
+ $(maybe_venved_python) $(srcdir)/setup.py install --prefix=$(DESTDIR)$(prefix)
+i18n: $(maybe_venv_dep)
+ $(maybe_venved)pybabel compile -D mediagoblin -d mediagoblin/i18n/
+
+
+ifneq ($(VIRTUALENV),no)
+./bin/python:
+ rm -f ./bin/python
+ virtualenv --system-site-packages .
+ ./bin/python setup.py develop --upgrade
+
+virtualenv: bin/python
+
+clean-virtualenv:
+ rm -rf ./bin/
+ rm -rf ./lib/
+endif
+
# setup.py doesn't (yet) support an uninstall command, so until it does, you
# must manually remove everything that was installed here. The following example
# should remove a basic package installed via setup.py, but please double- and
# triple-check it so that you don't remove something you shouldn't!
# Be sure to remove any extra files you install, such as binaries or documentation!
+#
# uninstall:
-# case $(prefix) in
-# /usr|/usr/local )
-# exit 1 ;;
-# /www/*|/srv/* )
-# rm -rvf $(prefix) ;;
-# esac
-
-# Just use the usual setup.py clean command
+# rm -rvf $(pkgpythondir)
+# rm -v $(pythondir)/$(PACKAGE_DISTNAME)-*.egg-info
+#
+
+
clean:
- $(PYTHON) setup.py clean
+ @echo "No rule to clean house, yet."
+
+
+# We don't know what this does yet.
+# Originally:
+## Just use the usual setup.py clean command
+#clean:
+# $(maybe_venved_python) setup.py clean
+
# Clean up the output of configure
rm -rvf $(srcdir)/autom4te.cache
rm -v $(srcdir)/aclocal.m4
rm -v $(srcdir)/Makefile
+ rm -v $(srcdir)/env
+
# You can either use the setup.py sdist command or you can roll your own here
dist:
-# $(PYTHON) setup.py sdist
+# $(maybe_venved_python) setup.py sdist
mkdir $(PACKAGE_DISTNAME)
cp -r $(DISTFILES) $(PACKAGE_DISTNAME)
tar -czf $(PACKAGE_DISTNAME).tar.gz $(PACKAGE_DISTNAME)
# Use the setup.py check command
check:
- $(PYTHON) setup.py check
+ $(maybe_venved_python) setup.py check
# setup.py might complain if a directory doesn't exist so just in case, make the directory
# here
installdirs:
$(MKDIR_P) $(DESTDIR)$(prefix)
-# Set up PostgreSQL
-postgresql:
- sudo -u $(POSTGRES) createuser mediagoblin
- sudo -u $(POSTGRES) createdb -E UNICODE -O mediagoblin mediagoblin
+# # Set up PostgreSQL
+# postgresql:
+# sudo -u $(POSTGRES) createuser mediagoblin
+# sudo -u $(POSTGRES) createdb -E UNICODE -O mediagoblin mediagoblin
-update:
-ifneq ($(VIRTUALENV),no)
- $(prefix)/bin/python $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade
-else
- $(PYTHON) $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade
-endif
- $(prefix)/bin/gmg dbupdate
+# update:
+# ifneq ($(VIRTUALENV),no)
+# $(prefix)/bin/python $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade
+# else
+# $(PYTHON) $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade
+# endif
+# $(prefix)/bin/gmg dbupdate
# The following show how to install documentation. In this example,
# docs are built from a separate Makefile contained in the docs
endif
+# Targets that don't seem supported?
+
install-dvi:
dvi: