freeipa/Makefile.python.am
Christian Heimes 8346e1b067 Add install requirements to Python packages
https://fedorahosted.org/freeipa/ticket/6468

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-11-16 22:58:39 +01:00

53 lines
1.5 KiB
Makefile

pkgname = $(shell basename "$(abs_srcdir)")
pkgpythondir = $(pythondir)/$(pkgname)
if VERBOSE_MAKE
VERBOSITY="--verbose"
else
VERBOSITY="--quiet"
endif !VERBOSE_MAKE
all-local:
cd $(srcdir); $(PYTHON) setup.py \
$(VERBOSITY) \
build \
--build-base "$(abs_builddir)/build"
install-exec-local:
$(PYTHON) $(srcdir)/setup.py \
$(VERBOSITY) \
install \
--prefix "$(DESTDIR)$(prefix)" \
--single-version-externally-managed \
--record "$(DESTDIR)$(pkgpythondir)/install_files.txt" \
--optimize 1
uninstall-local:
cat "$(DESTDIR)$(pkgpythondir)/install_files.txt" | xargs rm -rf
rm -rf "$(DESTDIR)$(pkgpythondir)"
clean-local:
$(PYTHON) "$(srcdir)/setup.py" clean --all
rm -rf "$(srcdir)/build" "$(srcdir)/dist" "$(srcdir)/MANIFEST"
find "$(srcdir)" \
-name "*.py[co]" -delete -o \
-name "__pycache__" -delete -o \
-name "*.egg-info" -exec rm -rf {} +
# take list of all Python source files and copy them into distdir
# SOURCES.txt does not contain directories so we need to create those
dist-hook:
$(PYTHON) "$(srcdir)/setup.py" egg_info
PYTHON_SOURCES=$$(cat "$(srcdir)/$(pkgname).egg-info/SOURCES.txt") || exit $$?; \
for FILEN in $${PYTHON_SOURCES}; \
do \
if test -x "$(srcdir)/$${FILEN}"; then MODE=755; else MODE=644; fi; \
$(INSTALL) -D -m $${MODE} "$(srcdir)/$${FILEN}" "$(distdir)/$${FILEN}" || exit $$?; \
done
WHEELDISTDIR = $(top_builddir)/dist/wheels
.PHONY: bdist_wheel
bdist_wheel:
rm -rf $(WHEELDISTDIR)/$(pkgname)*.whl
$(PYTHON) "$(srcdir)/setup.py" bdist_wheel --dist-dir=$(WHEELDISTDIR)