Skip to content

Commit

Permalink
fix(source): fixes for building from source
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin committed Jul 1, 2019
1 parent 20b6c31 commit 5f7ba72
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 27 deletions.
48 changes: 23 additions & 25 deletions deepsea/files/default/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,36 @@ PYTHON_DEPS=python3-setuptools python3-click python3-tox python3-configobj
PYTHON=python3
SET_PYTHON=true

## SUSE ##
OS=$(shell source /etc/os-release 2>/dev/null ; echo $$ID)
suse=
ifneq (,$(findstring opensuse,$(OS)))
suse=yes
suse=yes
endif
ifeq ($(OS), sles)
suse=yes
suse=yes
endif
ifeq ($(suse), yes)
USER=salt
GROUP=salt
PKG_INSTALL=zypper -n install
USER=salt
GROUP=salt
PKG_INSTALL=zypper -n install
else
## NON-SUSE ##
USER=root
GROUP=root
ifeq ($(OS), centos)
PKG_INSTALL=yum install -y
PYTHON_DEPS=rh-python36-setuptools python36-click tox python36-configobj
else
ifeq ($(OS), fedora)
PKG_INSTALL=yum install -y
else
debian := $(wildcard /etc/debian_version)
ifneq ($(strip $(debian)),)
SET_PYTHON=rm /usr/bin/python && ln -s /usr/bin/python3 /usr/bin/python
PKG_INSTALL=apt-get install -y
PYTHON_DEPS=python3-setuptools python3-click tox python3-configobj
endif
endif
endif
USER=root
GROUP=root
ifeq ($(OS), centos)
PKG_INSTALL=yum install -y
PYTHON_DEPS=rh-python36-setuptools python36-click tox python36-configobj
else
ifeq ($(OS), fedora)
PKG_INSTALL=yum install -y
else
debian := $(wildcard /etc/debian_version)
ifneq ($(strip $(debian)),)
PKG_INSTALL=apt-get install -y
SET_PYTHON=rm /usr/bin/python && ln -s /usr/bin/python3 /usr/bin/python
PYTHON_DEPS=python3-setuptools python3-click tox python3-configobj
endif
endif
endif
endif


Expand Down Expand Up @@ -968,7 +966,7 @@ copy-files:

install-deps:
# Using '|| true' to suppress failure (packages already installed, etc)
$(SET_PYTHON) 2>/dev/null || true
$(SET_PYTHON) 2>/dev/null || true
$(PKG_INSTALL) $(DEEPSEA_DEPS) || true
$(PKG_INSTALL) $(PYTHON_DEPS) || true

Expand Down
2 changes: 1 addition & 1 deletion deepsea/package/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ include:
deepsea-package-install-deps-pkg-removed:
pkg.removed:
- name: {{ deepsea.pkg.deps }}
- names: {{ deepsea.pkg.deps }}
{%- endif %}
Expand Down
2 changes: 1 addition & 1 deletion deepsea/package/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include:
deepsea-package-install-deps-pkg-installed:
pkg.installed:
- name: {{ deepsea.pkg.deps }}
- names: {{ deepsea.pkg.deps }}
{%- endif %}
Expand Down

0 comments on commit 5f7ba72

Please sign in to comment.