Browse Source

Merge pull request #128 from ghost/master

Fix build deps for NGINX NG build from source
tags/v0.55.0
Niels Abspoel 6 years ago
parent
commit
14572a1c3a
No account linked to committer's email address
1 changed files with 7 additions and 21 deletions
  1. +7
    -21
      nginx/ng/src.sls

+ 7
- 21
nginx/ng/src.sls View File



{% 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:
{% if salt['grains.get']('os_family') == 'Debian' %}
cmd.run:
- name: apt-get -y build-dep nginx
{% elif salt['grains.get']('os_family') == 'RedHat' %}
cmd.run:
- name: yum-builddep -y nginx
{% else %}
## install build deps for other distros
{% endif %}
nginx_deps:
pkg.installed:
- pkgs:
- libpcre3-dev
- libssl-dev
- zlib1g-dev


nginx_download: nginx_download:
archive.extracted: archive.extracted:
- 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
- onchanges:
- cmd: nginx_build_dep
- pkg: nginx_deps


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


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


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


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

Loading…
Cancel
Save