[mousetrap/gnome3-wip: 175/240] Got distcheck working!



commit acec831a79a6a9a1b4bef89584ea4b143ac62a50
Author: Kevin Brown <kevin kevinbrown in>
Date:   Thu Jun 26 16:56:43 2014 -0400

    Got distcheck working!
    
    This changes how the Makefile and the build process works such that
    it will still use setuptools to build and install the application
    while still being able to pass the distribution checks set in place
    by automake.
    
    Previously we were including all of the Python files in the
    `_PYTHON` section of the Makefile, which didn't allow for directory
    nesting at all.  This had the benefit of including the files in the
    distribution automatically, and also compiled and moved the files
    to the install directory when required.  The problem was that this
    did half of the work that setuptools was doing during the install
    process while not finishing the job correctly, causing the
    distribution checks to fail.  Instead, we are now including the
    setup.py and source files using `EXTRA_DIST`, which supports
    recursion automatically, and we use setuptools to do all of the
    work while installing.
    
    This adds a `dist-hook` section which will remove the compiled
    Python files.  Including compiled Python files in the distribution
    package can cause unexpected issues and will be automatically
    compiled during installation anyway.
    
    This also overrides `distclean` such that it completely removes
    the build directories for mousetrap.

 Makefile.am |   42 +++++++++++-------------------------------
 VERSION     |    1 -
 setup.py    |    2 +-
 3 files changed, 12 insertions(+), 33 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 62eca3d..bbcfec7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,45 +13,25 @@
 
 mousetrapdir=$(pkgpythondir)
 
-mousetrap_pythondir=$(pyexecdir)/mousetrap/
-
-mousetrap_python_PYTHON= \
-       setup.py \
-       src/mousetrap/__init__.py \
-       src/mousetrap/plugins/__init__.py \
-       src/mousetrap/plugins/eyes.py \
-       src/mousetrap/plugins/interface.py \
-       src/mousetrap/plugins/display.py \
-       src/mousetrap/plugins/camera.py \
-       src/mousetrap/plugins/nose.py \
-       src/mousetrap/i18n.py \
-       src/mousetrap/image.py \
-       src/mousetrap/vision.py \
-       src/mousetrap/main.py \
-       src/mousetrap/tests/__init__.py \
-       src/mousetrap/tests/test_mouse_pointer.py \
-       src/mousetrap/tests/test_vision.py \
-       src/mousetrap/tests/run_python_tests.py \
-       src/mousetrap/gui.py \
-       src/mousetrap/config.py
-
 EXTRA_DIST= \
-       src/mousetrap/haars/haarcascade_mcs_righteye.xml \
-       src/mousetrap/haars/haarcascade_mcs_lefteye.xml \
-       src/mousetrap/haars/haarcascade_frontalface_default.xml \
-       src/mousetrap/haars/haarcascade_mcs_nose.xml \
-       src/mousetrap/haars/haarcascade_eye.xml \
-       src/mousetrap/mousetrap.yaml \
-       src/mousetrap/locale/en/LC_MESSAGES/mousetrap.po
+       setup.py \
+       src/mousetrap
 
 all-local:
        $(PYTHON) $(srcdir)/setup.py build --build-base $(builddir)/build --verbose
 
+dist-hook:
+       find . -name '*.pyc' -delete
+
 install-exec-local:
-       $(PYTHON) $(srcdir)/setup.py install --prefix=$(DESTDIR)$(prefix)
+       $(PYTHON) $(srcdir)/setup.py install --prefix $(DESTDIR)$(prefix) --single-version-externally-managed 
--record $(DESTDIR)$(pkgpythondir)/install_files.txt --verbose
 
 uninstall-local:
-       rm -rf $(DESTDIR)$(libdir)/python*/site-packages/mousetrap*
+       cat $(DESTDIR)$(pkgpythondir)/install_files.txt | xargs rm -rf
+       rm -r $(DESTDIR)$(pkgpythondir)
 
 clean-local:
        $(PYTHON) $(srcdir)/setup.py clean --all
+
+distclean-local:
+       rm -rf $(builddir)/mousetrap*
diff --git a/setup.py b/setup.py
index 74521a3..f7214e6 100644
--- a/setup.py
+++ b/setup.py
@@ -121,7 +121,7 @@ class BuildCommand(build):
         program = "msgfmt"
 
         LOCALE_PATH = "%s/mousetrap/locale" % SRC_PATH
-        DEST_PATH = "%s/mousetrap/locale" % self.build_base
+        DEST_PATH = "%s/mousetrap/locale" % self.build_lib
 
         root, directories, files = os.walk(LOCALE_PATH).next()
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]