Skip to content

Commit

Permalink
Update makefile with better Debian commands (#72)
Browse files Browse the repository at this point in the history
With the new changes, if the build system is Debian, make will:
- evaluate if the pip version is the one that requires --system
- change the Debian pip command to pip3, so we are building with Python 3

This fixes #71.
  • Loading branch information
anthonylavado authored Nov 12, 2018
1 parent 5517115 commit f6d73d8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,22 @@ FUNCTION_NAME=haaska

BUILD_DIR=build

PIPVERSIONEQ9 := $(shell expr `pip3 -V | cut -d ' ' -f 2` \= 9.0.1)

ifneq (,$(wildcard /etc/debian_version))
PIP_EXTRA = --system
ifeq "$(PIPVERSIONEQ9)" "1"
PIP_VER=3
PIP_EXTRA = --system
endif
else
PIP_EXTRA =
PIP_VER =
PIP_EXTRA =
endif

haaska.zip: haaska.py config/*
mkdir -p $(BUILD_DIR)
cp $^ $(BUILD_DIR)
pip install $(PIP_EXTRA) -t $(BUILD_DIR) requests
pip$(PIP_VER)e install $(PIP_EXTRA) -t $(BUILD_DIR) requests
chmod 755 $(BUILD_DIR)/haaska.py
cd $(BUILD_DIR); zip ../$@ -r *

Expand Down

0 comments on commit f6d73d8

Please sign in to comment.