Skip to content

Commit

Permalink
Update Makefile for py3 pathing
Browse files Browse the repository at this point in the history
  • Loading branch information
gcoxmoz committed Oct 24, 2020
1 parent da510d4 commit a8df414
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ PLAIN_PYTHON = $(shell which python 2>/dev/null)
PYTHON3 = $(shell which python3 2>/dev/null)
ifneq (, $(PYTHON3))
PYTHON_BIN = $(PYTHON3)
PY_PACKAGE_PREFIX = python3
RPM_MAKE_TARGET = rpm3
endif
ifneq (, $(PLAIN_PYTHON))
PYTHON_BIN = $(PLAIN_PYTHON)
PY_PACKAGE_PREFIX = python
RPM_MAKE_TARGET = rpm2
endif

Expand Down Expand Up @@ -46,11 +48,11 @@ pylint:
rpm: $(RPM_MAKE_TARGET)

rpm2:
fpm -s python -t rpm --python-bin $(PYTHON_BIN) --no-python-fix-name --rpm-dist "$$(rpmbuild -E '%{?dist}' | sed -e 's#^\.##')" --iteration 1 setup.py
fpm -s python -t rpm --python-bin $(PYTHON_BIN) --python-install-bin /usr/bin --no-python-fix-name --python-package-name-prefix $(PY_PACKAGE_PREFIX) --rpm-dist "$$(rpmbuild -E '%{?dist}' | sed -e 's#^\.##')" --iteration 1 setup.py
@rm -rf build $(PACKAGE).egg-info

rpm3:
fpm -s python -t rpm --python-bin $(PYTHON_BIN) --no-python-fix-name --python-package-name-prefix python3 --rpm-dist "$$(rpmbuild -E '%{?dist}' | sed -e 's#^\.##')" --iteration 1 setup.py
fpm -s python -t rpm --python-bin $(PYTHON_BIN) --python-install-bin /usr/bin --no-python-fix-name --python-package-name-prefix $(PY_PACKAGE_PREFIX) --rpm-dist "$$(rpmbuild -E '%{?dist}' | sed -e 's#^\.##')" --iteration 1 setup.py
@rm -rf test/__pycache__
@rm -rf build $(PACKAGE).egg-info

Expand Down

0 comments on commit a8df414

Please sign in to comment.