diff options
Diffstat (limited to 'ipapython')
| -rw-r--r-- | ipapython/Makefile | 18 | ||||
| -rw-r--r-- | ipapython/ipap11helper/Makefile | 11 | ||||
| -rw-r--r-- | ipapython/py_default_encoding/Makefile | 21 |
3 files changed, 23 insertions, 27 deletions
diff --git a/ipapython/Makefile b/ipapython/Makefile index a865ca758..833f3cdc5 100644 --- a/ipapython/Makefile +++ b/ipapython/Makefile @@ -1,7 +1,5 @@ -PYTHONLIBDIR ?= $(shell python2 -c "from distutils.sysconfig import *; print get_python_lib()") -PACKAGEDIR ?= $(DESTDIR)/$(PYTHONLIBDIR)/ipa -CONFIGDIR ?= $(DESTDIR)/etc/ipa -TESTS = $(wildcard test/*.py) +PYTHON ?= /usr/bin/python2 +PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib())") SUBDIRS = py_default_encoding ipap11helper @@ -15,16 +13,16 @@ check: .PHONY: install install: if [ "$(DESTDIR)" = "" ]; then \ - python2 setup.py install; \ + $(PYTHON) setup.py install; \ else \ - python2 setup.py install --root $(DESTDIR); \ + $(PYTHON) setup.py install --root $(DESTDIR); \ fi @for subdir in $(SUBDIRS); do \ (cd $$subdir && $(MAKE) $@) || exit 1; \ done clean: - rm -f *~ *.pyc + rm -f *~ *.pyc __pycache__/ @for subdir in $(SUBDIRS); do \ (cd $$subdir && $(MAKE) $@) || exit 1; \ done @@ -40,9 +38,3 @@ maintainer-clean: distclean @for subdir in $(SUBDIRS); do \ (cd $$subdir && $(MAKE) $@) || exit 1; \ done - -.PHONY: test -test: $(subst .py,.tst,$(TESTS)) - -%.tst: %.py - python2 $< diff --git a/ipapython/ipap11helper/Makefile b/ipapython/ipap11helper/Makefile index 88f17f705..f66edb82e 100644 --- a/ipapython/ipap11helper/Makefile +++ b/ipapython/ipap11helper/Makefile @@ -1,15 +1,14 @@ -PYTHONLIBDIR ?= $(shell python2 -c "from distutils.sysconfig import *; print get_python_lib()") -PACKAGEDIR ?= $(DESTDIR)/$(PYTHONLIBDIR)/ipa -CONFIGDIR ?= $(DESTDIR)/etc/ipa +PYTHON ?= /usr/bin/python2 +PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib())") all: - python2 setup.py build + $(PYTHON) setup.py build install: if [ "$(DESTDIR)" = "" ]; then \ - python2 setup.py install; \ + $(PYTHON) setup.py install; \ else \ - python2 setup.py install --root $(DESTDIR); \ + $(PYTHON) setup.py install --root $(DESTDIR); \ fi clean: diff --git a/ipapython/py_default_encoding/Makefile b/ipapython/py_default_encoding/Makefile index 88f17f705..a73f429db 100644 --- a/ipapython/py_default_encoding/Makefile +++ b/ipapython/py_default_encoding/Makefile @@ -1,15 +1,20 @@ -PYTHONLIBDIR ?= $(shell python2 -c "from distutils.sysconfig import *; print get_python_lib()") -PACKAGEDIR ?= $(DESTDIR)/$(PYTHONLIBDIR)/ipa -CONFIGDIR ?= $(DESTDIR)/etc/ipa +PYTHON ?= /usr/bin/python2 +PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib())") +PYTHONVERSION ?= $(shell $(PYTHON) -c "import sys; print(sys.version_info[0])") all: - python2 setup.py build + if [ "$(PYTHONVERSION)" = "2" ]; then \ + python2 setup.py build; \ + fi install: - if [ "$(DESTDIR)" = "" ]; then \ - python2 setup.py install; \ - else \ - python2 setup.py install --root $(DESTDIR); \ + # Skip this module under Python 3 + if [ "$(PYTHONVERSION)" = "2" ]; then \ + if [ "$(DESTDIR)" = "" ]; then \ + python2 setup.py install; \ + else \ + python2 setup.py install --root $(DESTDIR); \ + fi; \ fi clean: |
