Merge pull request #128 from ghost/master

Fix build deps for NGINX NG build from source
This commit is contained in:
Niels Abspoel 2019-01-25 20:04:07 +01:00 committed by GitHub
commit 14572a1c3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,16 +4,12 @@
{% from 'nginx/ng/map.jinja' import nginx, sls_block with context %} {% from 'nginx/ng/map.jinja' import nginx, sls_block with context %}
nginx_build_dep: nginx_deps:
{% if salt['grains.get']('os_family') == 'Debian' %} pkg.installed:
cmd.run: - pkgs:
- name: apt-get -y build-dep nginx - libpcre3-dev
{% elif salt['grains.get']('os_family') == 'RedHat' %} - libssl-dev
cmd.run: - zlib1g-dev
- name: yum-builddep -y nginx
{% else %}
## install build deps for other distros
{% endif %}
nginx_download: nginx_download:
archive.extracted: archive.extracted:
@ -23,16 +19,12 @@ nginx_download:
- archive_format: tar - archive_format: tar
- if_missing: /usr/sbin/nginx-{{ nginx.source_version }} - if_missing: /usr/sbin/nginx-{{ nginx.source_version }}
- require: - require:
- cmd: nginx_build_dep - pkg: nginx_deps
- onchanges:
- cmd: nginx_build_dep
nginx_configure: nginx_configure:
cmd.run: cmd.run:
- name: ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path={{ nginx.lookup.conf_file or '/etc/nginx/nginx.conf' }} {{ nginx.source.opts | join(' ') }} - name: ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path={{ nginx.lookup.conf_file or '/etc/nginx/nginx.conf' }} {{ nginx.source.opts | join(' ') }}
- cwd: /tmp/nginx-{{ nginx.source_version }} - cwd: /tmp/nginx-{{ nginx.source_version }}
- require:
- archive: nginx_download
- onchanges: - onchanges:
- archive: nginx_download - archive: nginx_download
@ -40,8 +32,6 @@ nginx_compile:
cmd.run: cmd.run:
- name: make - name: make
- cwd: /tmp/nginx-{{ nginx.source_version }} - cwd: /tmp/nginx-{{ nginx.source_version }}
- require:
- cmd: nginx_configure
- onchanges: - onchanges:
- cmd: nginx_configure - cmd: nginx_configure
@ -49,8 +39,6 @@ nginx_install:
cmd.run: cmd.run:
- name: make install - name: make install
- cwd: /tmp/nginx-{{ nginx.source_version }} - cwd: /tmp/nginx-{{ nginx.source_version }}
- require:
- cmd: nginx_compile
- onchanges: - onchanges:
- cmd: nginx_compile - cmd: nginx_compile
@ -58,7 +46,5 @@ nginx_link:
file.copy: file.copy:
- name: /usr/sbin/nginx-{{ nginx.source_version }} - name: /usr/sbin/nginx-{{ nginx.source_version }}
- source: /usr/sbin/nginx - source: /usr/sbin/nginx
- require:
- cmd: nginx_install
- onchanges: - onchanges:
- cmd: nginx_install - cmd: nginx_install