Simplify obtaining of PKGDIR
So far, in all Makefiles we have a complicated way to construct PKGDIR path which is used to install python modules into. Firstly, python version is obtained, and then system prefix and these are then used to construct the PKGDIR path. Well, we can do better. We can use 'site.getsitepackages()[0]' to obtain exactly the path we are after. This also fixes the problem on distributions which have split /usr/lib and /usr/lib64 directories, because with the way we are constructing the PKGDIR path we assume that the directories are the same (or one is a symlink to another). Well, that is not always the case. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
1a1f7e29c1
commit
0ef3c75185
7 changed files with 13 additions and 32 deletions
|
|
@ -1,10 +1,7 @@
|
|||
SUBDIRS=koji_cli
|
||||
|
||||
PACKAGE = $(shell basename `pwd`)
|
||||
PYVER := $(shell $(PYTHON) -c 'import sys; print("%.3s" %(sys.version))')
|
||||
PYSYSDIR := $(shell $(PYTHON) -c 'import sys; print(sys.prefix)')
|
||||
PYLIBDIR = $(PYSYSDIR)/lib/python$(PYVER)
|
||||
PKGDIR = $(PYLIBDIR)/site-packages
|
||||
PKGDIR = $(shell $(PYTHON) -c "import site; print(site.getsitepackages()[0])")/$(PACKAGE)
|
||||
|
||||
FILES = koji
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
PYFILES = $(wildcard *.py)
|
||||
|
||||
PACKAGE = $(shell basename `pwd`)
|
||||
PYVER := $(shell $(PYTHON) -c 'import sys; print("%.3s" % (sys.version))')
|
||||
PYSYSDIR := $(shell $(PYTHON) -c 'import sys; print(sys.prefix)')
|
||||
PYLIBDIR = $(PYSYSDIR)/lib/python$(PYVER)
|
||||
PKGDIR = $(PYLIBDIR)/site-packages/$(PACKAGE)
|
||||
PKGDIR = $(shell $(PYTHON) -c "import site; print(site.getsitepackages()[0])")/$(PACKAGE)
|
||||
|
||||
_default:
|
||||
@echo "nothing to make. try make install"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue