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@
27 SPHINXBUILD
= @SPHINXBUILD@
31 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
32 INSTALL_DATA
= @INSTALL_DATA@
33 INSTALL_SCRIPT
= @INSTALL_SCRIPT@
36 exec_prefix = @
exec_prefix@
38 includedir = @
includedir@
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
)
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
58 # Since installing to a virtualenv is all the rage these days, support
59 # it here. If the VIRTUALENV variable is set to anything other than
60 # "no", set up a new virtualenv and install there, otherwise install
61 # as usual from setup.py
64 ifneq ($(VIRTUALENV
),no
)
65 $(VIRTUALENV
) $(VIRTUALENV_FLAGS
) --python
=$(PYTHON
) \
66 --system-site-packages
$(DESTDIR
)$(prefix) || \
67 $(VIRTUALENV
) $(DESTDIR
)$(prefix)
68 $(DESTDIR
)$(prefix)/bin
/python
$(srcdir)/setup.py
install \
69 --prefix=$(DESTDIR
)$(prefix)
71 $(PYTHON
) $(srcdir)/setup.py
install --prefix=$(DESTDIR
)$(prefix)
73 if
[[ $(DESTDIR
)$(prefix) != $(srcdir) ]]; then
74 $(INSTALL_DATA
) $(srcdir)/Makefile
$(DESTDIR
)$(prefix)/Makefile
75 $(INSTALL_DATA
) $(srcdir)/lazycelery.sh
$(DESTDIR
)$(prefix)/lazycelery.sh
76 $(INSTALL_DATA
) $(srcdir)/lazyserver.sh
$(DESTDIR
)$(prefix)/lazyserver.sh
79 # The same as "install", except use the "develop" setup.py target
82 ifneq ($(VIRTUALENV
),no
)
83 $(VIRTUALENV
) $(VIRTUALENV_FLAGS
) --python
=$(PYTHON
) \
84 --system-site-packages
$(DESTDIR
)$(prefix) || \
85 $(VIRTUALENV
) $(DESTDIR
)$(prefix)
86 $(DESTDIR
)$(prefix)/bin
/python
$(srcdir)/setup.py develop \
87 --prefix=$(DESTDIR
)$(prefix)
89 $(PYTHON
) $(srcdir)/setup.py develop
--prefix=$(DESTDIR
)$(prefix)
91 if
[[ $(DESTDIR
)$(prefix) != $(srcdir) ]]; then
92 $(INSTALL_DATA
) $(srcdir)/Makefile
$(DESTDIR
)$(prefix)/Makefile
93 $(INSTALL_DATA
) $(srcdir)/lazycelery.sh
$(DESTDIR
)$(prefix)/lazycelery.sh
94 $(INSTALL_DATA
) $(srcdir)/lazyserver.sh
$(DESTDIR
)$(prefix)/lazyserver.sh
98 # setup.py doesn't (yet) support an uninstall command, so until it does, you
99 # must manually remove everything that was installed here. The following example
100 # should remove a basic package installed via setup.py, but please double- and
101 # triple-check it so that you don't remove something you shouldn't!
102 # Be sure to remove any extra files you install, such as binaries or documentation!
108 # rm -rvf $(prefix) ;;
111 # Just use the usual setup.py clean command
113 $(PYTHON
) setup.py
clean
116 # Clean up the output of configure
118 rm -v
$(srcdir)/config.log
119 rm -v
$(srcdir)/config.status
120 rm -rvf
$(srcdir)/autom4te.cache
121 rm -v
$(srcdir)/Makefile
123 # You can either use the setup.py sdist command or you can roll your own here
125 # $(PYTHON) setup.py sdist
126 mkdir
$(PACKAGE_DISTNAME
)
127 cp
-r
$(DISTFILES
) $(PACKAGE_DISTNAME
)
128 tar -czf
$(PACKAGE_DISTNAME
).
tar.gz
$(PACKAGE_DISTNAME
)
129 rm -rf
$(PACKAGE_DISTNAME
)
131 # Use the setup.py check command
133 $(PYTHON
) setup.py
check
135 # setup.py might complain if a directory doesn't exist so just in case, make the directory
138 $(MKDIR_P
) $(DESTDIR
)$(prefix)
142 sudo
-u postgres createuser mediagoblin
143 sudo
-u postgres createdb
-E UNICODE
-O mediagoblin mediagoblin
146 ifneq ($(VIRTUALENV
),no
)
147 $(prefix)/bin
/python
$(srcdir)/setup.py develop
--prefix=$(prefix) --upgrade
149 $(PYTHON
) $(srcdir)/setup.py develop
--prefix=$(prefix) --upgrade
151 $(prefix)/bin
/gmg dbupdate
153 # The following show how to install documentation. In this example,
154 # docs are built from a separate Makefile contained in the docs
155 # directory which uses the SPHINXBUILD variable to store the location
156 # of the sphinx-build (Python doc tool) binary to use.
158 $(DESTDIR
)$(infodir)/mediagoblin.
info: docs
/build
/texinfo
/mediagoblin.
info
160 $(INSTALL_DATA
) @
< $(DESTDIR
)$@
161 if
$(SHELL
) -c
'install-info --version' >/dev
/null
2>&1; then
162 install-info
--dir-file
=$(DESTDIR
)$(infodir)/dir \
163 $(DESTDIR
)$(infodir)/foo.
info;
166 info: docs
/build
/texinfo
/mediagoblin.
info
168 docs
/build
/texinfo
/mediagoblin.
info: $(wildcard docs
/source
/*)
169 ifneq ($(SPHINXBUILD
),no
)
170 $(MAKE
) -C docs
info SPHINXBUILD
=$(SPHINXBUILD
)
174 install-html
: html
installdirs
175 $(INSTALL_DATA
) docs
/build
/html
/* $(DESTDIR
)$(htmldir
)
177 html
: docs
/build
/html
/index.html
179 docs
/build
/html
/index.html
: $(wildcard $(srcdir)/docs
/source
/*)
180 ifneq ($(SPHINXBUILD
),no
)
181 $(MAKE
) -C docs html SPHINXBUILD
=$(SPHINXBUILD
)
185 install-pdf
: pdf
installdirs
186 $(INSTALL_DATA
) docs
/build
/latex
/mediagoblin.pdf
$(DESTDIR
)$(pdfdir
)
188 pdf
: docs
/build
/latex
/mediagoblin.pdf
190 docs
/build
/latex
/mediagoblin.pdf
: $(wildcard $(srcdir)/docs
/source
/*)
191 ifneq ($(SPHINXBUILD
),no
)
192 $(MAKE
) -C docs latexpdf SPHINXBUILD
=$(SPHINXBUILD
)