summaryrefslogtreecommitdiffstats
path: root/meta-openembedded/meta-webserver/recipes-httpd/nginx
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openembedded/meta-webserver/recipes-httpd/nginx')
-rw-r--r--meta-openembedded/meta-webserver/recipes-httpd/nginx/files/0001-Allow-the-overriding-of-the-endianness-via-the-confi.patch80
-rw-r--r--meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx-cross.patch215
-rw-r--r--meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx-volatile.conf2
-rw-r--r--meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.conf118
-rw-r--r--meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.init52
-rw-r--r--meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.service11
-rw-r--r--meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx.inc156
-rw-r--r--meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.12.2.bb6
-rw-r--r--meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.13.9.bb10
9 files changed, 650 insertions, 0 deletions
diff --git a/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/0001-Allow-the-overriding-of-the-endianness-via-the-confi.patch b/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/0001-Allow-the-overriding-of-the-endianness-via-the-confi.patch
new file mode 100644
index 000000000..ffd5ee3e9
--- /dev/null
+++ b/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/0001-Allow-the-overriding-of-the-endianness-via-the-confi.patch
@@ -0,0 +1,80 @@
+From be9970aa16c5142ef814531d74a07990a8e9eb14 Mon Sep 17 00:00:00 2001
+From: Derek Straka <derek@asterius.io>
+Date: Fri, 1 Dec 2017 10:32:29 -0500
+Subject: [PATCH] Allow the overriding of the endianness via the configure flag
+ --with-endian
+
+The existing configure options contain the --with-endian; however, the command
+line flag does not actually function. It does not set the endianness and it
+appears to do nothing.
+
+Upstream-Status: Pending
+
+Signed-off-by: Derek Straka <derek@asterius.io>
+
+diff --git a/auto/endianness b/auto/endianness
+index 1b552b6..be84487 100644
+--- a/auto/endianness
++++ b/auto/endianness
+@@ -13,7 +13,13 @@ checking for system byte ordering
+ END
+
+
+-cat << END > $NGX_AUTOTEST.c
++if [ ".$NGX_WITH_ENDIAN" = ".little" ]; then
++ echo " little endian"
++ have=NGX_HAVE_LITTLE_ENDIAN . auto/have
++elif [ ".$NGX_WITH_ENDIAN" = ".big" ]; then
++ echo " big endian"
++else
++ cat << END > $NGX_AUTOTEST.c
+
+ int main(void) {
+ int i = 0x11223344;
+@@ -26,25 +32,26 @@ int main(void) {
+
+ END
+
+-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
+- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
++ ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
++ -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
+
+-eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
++ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
+
+-if [ -x $NGX_AUTOTEST ]; then
+- if $NGX_AUTOTEST >/dev/null 2>&1; then
+- echo " little endian"
+- have=NGX_HAVE_LITTLE_ENDIAN . auto/have
+- else
+- echo " big endian"
+- fi
++ if [ -x $NGX_AUTOTEST ]; then
++ if $NGX_AUTOTEST >/dev/null 2>&1; then
++ echo " little endian"
++ have=NGX_HAVE_LITTLE_ENDIAN . auto/have
++ else
++ echo " big endian"
++ fi
+
+- rm -rf $NGX_AUTOTEST*
++ rm -rf $NGX_AUTOTEST*
+
+-else
+- rm -rf $NGX_AUTOTEST*
++ else
++ rm -rf $NGX_AUTOTEST*
+
+- echo
+- echo "$0: error: cannot detect system byte ordering"
+- exit 1
++ echo
++ echo "$0: error: cannot detect system byte ordering"
++ exit 1
++ fi
+ fi
+--
+2.7.4
+
+
diff --git a/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx-cross.patch b/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx-cross.patch
new file mode 100644
index 000000000..0a18bcd33
--- /dev/null
+++ b/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx-cross.patch
@@ -0,0 +1,215 @@
+We do not have capability to run binaries when cross compiling
+
+Upstream-Status: Pending
+
+
+Index: nginx-1.12.2/auto/feature
+===================================================================
+--- nginx-1.12.2.orig/auto/feature
++++ nginx-1.12.2/auto/feature
+@@ -49,12 +49,20 @@ eval "/bin/sh -c \"$ngx_test\" >> $NGX_A
+
+ if [ -x $NGX_AUTOTEST ]; then
+
++ if [ ".$NGX_CROSS_COMPILE" = ".yes" ]; then
++ NGX_AUTOTEST_EXEC="true"
++ NGX_FOUND_MSG=" (not tested, cross compiling)"
++ else
++ NGX_AUTOTEST_EXEC="$NGX_AUTOTEST"
++ NGX_FOUND_MSG=""
++ fi
++
+ case "$ngx_feature_run" in
+
+ yes)
+ # /bin/sh is used to intercept "Killed" or "Abort trap" messages
+- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
+- echo " found"
++ if /bin/sh -c $NGX_AUTOTEST_EXEC >> $NGX_AUTOCONF_ERR 2>&1; then
++ echo " found$NGX_FOUND_MSG"
+ ngx_found=yes
+
+ if test -n "$ngx_feature_name"; then
+@@ -68,17 +76,27 @@ if [ -x $NGX_AUTOTEST ]; then
+
+ value)
+ # /bin/sh is used to intercept "Killed" or "Abort trap" messages
+- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
+- echo " found"
++ if /bin/sh -c $NGX_AUTOTEST_EXEC >> $NGX_AUTOCONF_ERR 2>&1; then
++ echo " found$NGX_FOUND_MSG"
+ ngx_found=yes
+
+- cat << END >> $NGX_AUTO_CONFIG_H
++ if [ ".$NGX_CROSS_COMPILE" = ".yes" ]; then
++ cat << END >> $NGX_AUTO_CONFIG_H
+
+ #ifndef $ngx_feature_name
+-#define $ngx_feature_name `$NGX_AUTOTEST`
++#define $ngx_feature_name $(eval "echo \$NGX_WITH_${ngx_feature_name}")
+ #endif
+
+ END
++ else
++ cat << END >> $NGX_AUTO_CONFIG_H
++
++#ifndef $ngx_feature_name
++#define $ngx_feature_name `$NGX_AUTOTEST_EXEC`
++#endif
++
++END
++ fi
+ else
+ echo " found but is not working"
+ fi
+@@ -86,7 +104,7 @@ END
+
+ bug)
+ # /bin/sh is used to intercept "Killed" or "Abort trap" messages
+- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
++ if /bin/sh -c $NGX_AUTOTEST_EXEC >> $NGX_AUTOCONF_ERR 2>&1; then
+ echo " not found"
+
+ else
+Index: nginx-1.12.2/auto/options
+===================================================================
+--- nginx-1.12.2.orig/auto/options
++++ nginx-1.12.2/auto/options
+@@ -386,6 +386,18 @@ $0: warning: the \"--with-sha1-asm\" opt
+ --test-build-epoll) NGX_TEST_BUILD_EPOLL=YES ;;
+ --test-build-solaris-sendfilev) NGX_TEST_BUILD_SOLARIS_SENDFILEV=YES ;;
+
++ # cross compile support
++ --with-int=*) NGX_WITH_INT="$value" ;;
++ --with-long=*) NGX_WITH_LONG="$value" ;;
++ --with-long-long=*) NGX_WITH_LONG_LONG="$value" ;;
++ --with-ptr-size=*) NGX_WITH_PTR_SIZE="$value" ;;
++ --with-sig-atomic-t=*) NGX_WITH_SIG_ATOMIC_T="$value" ;;
++ --with-size-t=*) NGX_WITH_SIZE_T="$value" ;;
++ --with-off-t=*) NGX_WITH_OFF_T="$value" ;;
++ --with-time-t=*) NGX_WITH_TIME_T="$value" ;;
++ --with-sys-nerr=*) NGX_WITH_NGX_SYS_NERR="$value" ;;
++ --with-endian=*) NGX_WITH_ENDIAN="$value" ;;
++
+ *)
+ echo "$0: error: invalid option \"$option\""
+ exit 1
+@@ -568,6 +580,17 @@ cat << END
+
+ --with-debug enable debug logging
+
++ --with-int=VALUE force int size
++ --with-long=VALUE force long size
++ --with-long-long=VALUE force long long size
++ --with-ptr-size=VALUE force pointer size
++ --with-sig-atomic-t=VALUE force sig_atomic_t size
++ --with-size-t=VALUE force size_t size
++ --with-off-t=VALUE force off_t size
++ --with-time-t=VALUE force time_t size
++ --with-sys-nerr=VALUE force sys_nerr value
++ --with-endian=VALUE force system endianess
++
+ END
+
+ exit 1
+@@ -576,6 +599,8 @@ fi
+
+ if [ ".$NGX_PLATFORM" = ".win32" ]; then
+ NGX_WINE=$WINE
++elif [ ! -z "$NGX_PLATFORM" ]; then
++ NGX_CROSS_COMPILE="yes"
+ fi
+
+
+Index: nginx-1.12.2/auto/types/sizeof
+===================================================================
+--- nginx-1.12.2.orig/auto/types/sizeof
++++ nginx-1.12.2/auto/types/sizeof
+@@ -12,9 +12,12 @@ checking for $ngx_type size
+
+ END
+
+-ngx_size=
++ngx_size=$(eval "echo \$NGX_WITH_${ngx_param}")
+
+-cat << END > $NGX_AUTOTEST.c
++if [ ".$ngx_size" != "." ]; then
++ echo " $ngx_size bytes"
++else
++ cat << END > $NGX_AUTOTEST.c
+
+ #include <sys/types.h>
+ #include <sys/time.h>
+@@ -33,15 +36,16 @@ int main(void) {
+ END
+
+
+-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
+- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
++ ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
++ -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
+
+-eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
++ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
+
+
+-if [ -x $NGX_AUTOTEST ]; then
+- ngx_size=`$NGX_AUTOTEST`
+- echo " $ngx_size bytes"
++ if [ -x $NGX_AUTOTEST ]; then
++ ngx_size=`$NGX_AUTOTEST`
++ echo " $ngx_size bytes"
++ fi
+ fi
+
+
+Index: nginx-1.12.2/auto/unix
+===================================================================
+--- nginx-1.12.2.orig/auto/unix
++++ nginx-1.12.2/auto/unix
+@@ -587,13 +587,13 @@ ngx_feature_libs=
+
+ # C types
+
+-ngx_type="int"; . auto/types/sizeof
++ngx_type="int"; ngx_param="INT"; . auto/types/sizeof
+
+-ngx_type="long"; . auto/types/sizeof
++ngx_type="long"; ngx_param="LONG"; . auto/types/sizeof
+
+-ngx_type="long long"; . auto/types/sizeof
++ngx_type="long long"; ngx_param="LONG_LONG"; . auto/types/sizeof
+
+-ngx_type="void *"; . auto/types/sizeof; ngx_ptr_size=$ngx_size
++ngx_type="void *"; ngx_param="PTR_SIZE"; . auto/types/sizeof; ngx_ptr_size=$ngx_size
+ ngx_param=NGX_PTR_SIZE; ngx_value=$ngx_size; . auto/types/value
+
+
+@@ -604,7 +604,7 @@ NGX_INCLUDE_AUTO_CONFIG_H="#include \"ng
+ ngx_type="uint32_t"; ngx_types="u_int32_t"; . auto/types/typedef
+ ngx_type="uint64_t"; ngx_types="u_int64_t"; . auto/types/typedef
+
+-ngx_type="sig_atomic_t"; ngx_types="int"; . auto/types/typedef
++ngx_type="sig_atomic_t"; ngx_param="SIG_ATOMIC_T"; ngx_types="int"; . auto/types/typedef
+ . auto/types/sizeof
+ ngx_param=NGX_SIG_ATOMIC_T_SIZE; ngx_value=$ngx_size; . auto/types/value
+
+@@ -620,15 +620,15 @@ ngx_type="rlim_t"; ngx_types="int"; . au
+
+ . auto/endianness
+
+-ngx_type="size_t"; . auto/types/sizeof
++ngx_type="size_t"; ngx_param="SIZE_T"; . auto/types/sizeof
+ ngx_param=NGX_MAX_SIZE_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
+ ngx_param=NGX_SIZE_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
+
+-ngx_type="off_t"; . auto/types/sizeof
++ngx_type="off_t"; ngx_param="OFF_T"; . auto/types/sizeof
+ ngx_param=NGX_MAX_OFF_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
+ ngx_param=NGX_OFF_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
+
+-ngx_type="time_t"; . auto/types/sizeof
++ngx_type="time_t"; ngx_param="TIME_T"; . auto/types/sizeof
+ ngx_param=NGX_TIME_T_SIZE; ngx_value=$ngx_size; . auto/types/value
+ ngx_param=NGX_TIME_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
+ ngx_param=NGX_MAX_TIME_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
diff --git a/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx-volatile.conf b/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx-volatile.conf
new file mode 100644
index 000000000..472fde16a
--- /dev/null
+++ b/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx-volatile.conf
@@ -0,0 +1,2 @@
+d @NGINX_USER@ www-data 0755 /run/nginx none
+d root root 0755 /var/log/nginx none
diff --git a/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.conf b/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.conf
new file mode 100644
index 000000000..69d3a2adc
--- /dev/null
+++ b/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.conf
@@ -0,0 +1,118 @@
+
+user www;
+worker_processes 1;
+
+error_log /var/log/nginx/error.log;
+#error_log logs/error.log notice;
+#error_log logs/error.log info;
+
+pid /run/nginx/nginx.pid;
+
+
+events {
+ worker_connections 1024;
+}
+
+
+http {
+ include mime.types;
+ default_type application/octet-stream;
+
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
+ '$status $body_bytes_sent "$http_referer" '
+ '"$http_user_agent" "$http_x_forwarded_for"';
+
+ access_log /var/log/nginx/access.log main;
+
+ sendfile on;
+ #tcp_nopush on;
+
+ #keepalive_timeout 0;
+ keepalive_timeout 65;
+
+ #gzip on;
+
+ server {
+ listen 80;
+ server_name localhost;
+
+ #charset koi8-r;
+
+ #access_log logs/host.access.log main;
+
+ location / {
+ root /var/www/localhost/html;
+ index index.html index.htm;
+ }
+
+ #error_page 404 /404.html;
+
+ # redirect server error pages to the static page /50x.html
+ #
+ error_page 500 502 503 504 /50x.html;
+ location = /50x.html {
+ root /var/www/localhost/html;
+ }
+
+ # proxy the PHP scripts to Apache listening on 127.0.0.1:80
+ #
+ #location ~ \.php$ {
+ # proxy_pass http://127.0.0.1;
+ #}
+
+ # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
+ #
+ #location ~ \.php$ {
+ # root html;
+ # fastcgi_pass 127.0.0.1:9000;
+ # fastcgi_index index.php;
+ # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
+ # include fastcgi_params;
+ #}
+
+ # deny access to .htaccess files, if Apache's document root
+ # concurs with nginx's one
+ #
+ #location ~ /\.ht {
+ # deny all;
+ #}
+ }
+
+
+ # another virtual host using mix of IP-, name-, and port-based configuration
+ #
+ #server {
+ # listen 8000;
+ # listen somename:8080;
+ # server_name somename alias another.alias;
+
+ # location / {
+ # root html;
+ # index index.html index.htm;
+ # }
+ #}
+
+
+ # HTTPS server
+ #
+ #server {
+ # listen 443;
+ # server_name localhost;
+
+ # ssl on;
+ # ssl_certificate cert.pem;
+ # ssl_certificate_key cert.key;
+
+ # ssl_session_timeout 5m;
+
+ # ssl_protocols SSLv2 SSLv3 TLSv1;
+ # ssl_ciphers HIGH:!aNULL:!MD5;
+ # ssl_prefer_server_ciphers on;
+
+ # location / {
+ # root html;
+ # index index.html index.htm;
+ # }
+ #}
+
+}
diff --git a/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.init b/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.init
new file mode 100644
index 000000000..1a2bd7dff
--- /dev/null
+++ b/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.init
@@ -0,0 +1,52 @@
+#! /bin/sh
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/nginx
+NAME=nginx
+DESC=nginx
+PID=/run/nginx/nginx.pid
+
+test -x $DAEMON || exit 0
+
+# Include nginx defaults if available
+if [ -f /etc/default/nginx ] ; then
+ . /etc/default/nginx
+fi
+
+set -e
+
+case "$1" in
+ start)
+ echo -n "Starting $DESC: "
+ start-stop-daemon --start --quiet --pidfile $PID \
+ --name $NAME --exec $DAEMON -- $DAEMON_OPTS
+ echo "$NAME."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: "
+ start-stop-daemon -K --quiet --pidfile $PID \
+ --name $NAME
+ echo "$NAME."
+ ;;
+ restart|force-reload)
+ echo -n "Restarting $DESC: "
+ start-stop-daemon -K --quiet --pidfile $PID \
+ --name $NAME
+ sleep 1
+ start-stop-daemon --start --quiet --pidfile $PID \
+ --name $NAME --exec $DAEMON -- $DAEMON_OPTS
+ echo "$NAME."
+ ;;
+ reload)
+ echo -n "Reloading $DESC configuration: "
+ start-stop-daemon --stop --signal HUP --quiet --pidfile $PID \
+ --exec $DAEMON
+ echo "$NAME."
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.service b/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.service
new file mode 100644
index 000000000..ce9906171
--- /dev/null
+++ b/meta-openembedded/meta-webserver/recipes-httpd/nginx/files/nginx.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Nginx Server
+After=network.target
+[Service]
+Type=forking
+PIDFile=/run/nginx/nginx.pid
+ExecStart=@SBINDIR@/nginx
+ExecStop=@SBINDIR@/nginx -s stop
+ExecReload=@SBINDIR@/nginx -s reload
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx.inc b/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx.inc
new file mode 100644
index 000000000..e6ae52a09
--- /dev/null
+++ b/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx.inc
@@ -0,0 +1,156 @@
+SUMMARY = "HTTP and reverse proxy server"
+
+DESCRIPTION = "Nginx is a web server and a reverse proxy server for \
+HTTP, SMTP, POP3 and IMAP protocols, with a strong focus on high \
+concurrency, performance and low memory usage."
+
+HOMEPAGE = "http://nginx.org/"
+LICENSE = "BSD-2-Clause"
+
+SECTION = "net"
+
+DEPENDS = "libpcre zlib openssl"
+
+SRC_URI = " \
+ http://nginx.org/download/nginx-${PV}.tar.gz \
+ file://nginx-cross.patch \
+ file://0001-Allow-the-overriding-of-the-endianness-via-the-confi.patch \
+ file://nginx.conf \
+ file://nginx.init \
+ file://nginx-volatile.conf \
+ file://nginx.service \
+"
+
+inherit siteinfo update-rc.d useradd systemd
+
+SYSTEMD_SERVICE_${PN} = "nginx.service"
+
+CFLAGS_append = " -fPIE -pie"
+CXXFLAGS_append = " -fPIE -pie"
+
+NGINX_WWWDIR ?= "${localstatedir}/www/localhost"
+NGINX_USER ?= "www"
+
+EXTRA_OECONF = ""
+DISABLE_STATIC = ""
+
+PACKAGECONFIG[http2] = "--with-http_v2_module,,"
+
+do_configure () {
+ if [ "${SITEINFO_BITS}" = "64" ]; then
+ PTRSIZE=8
+ else
+ PTRSIZE=4
+ fi
+
+ echo $CFLAGS
+ echo $LDFLAGS
+
+ # Add the LDFLAGS to the main nginx link to avoid issues with missing GNU_HASH
+ echo "MAIN_LINK=\"\${MAIN_LINK} ${LDFLAGS}\"" >> auto/cc/conf
+
+ ./configure \
+ --crossbuild=Linux:${TUNE_ARCH} \
+ --with-endian=${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \
+ --with-int=4 \
+ --with-long=${PTRSIZE} \
+ --with-long-long=8 \
+ --with-ptr-size=${PTRSIZE} \
+ --with-sig-atomic-t=${PTRSIZE} \
+ --with-size-t=${PTRSIZE} \
+ --with-off-t=${PTRSIZE} \
+ --with-time-t=${PTRSIZE} \
+ --with-sys-nerr=132 \
+ --conf-path=${sysconfdir}/nginx/nginx.conf \
+ --http-log-path=${localstatedir}/log/nginx/access.log \
+ --error-log-path=${localstatedir}/log/nginx/error.log \
+ --http-client-body-temp-path=/run/nginx/client_body_temp \
+ --http-proxy-temp-path=/run/nginx/proxy_temp \
+ --http-fastcgi-temp-path=/run/nginx/fastcgi_temp \
+ --http-uwsgi-temp-path=/run/nginx/uwsgi_temp \
+ --http-scgi-temp-path=/run/nginx/scgi_temp \
+ --pid-path=/run/nginx/nginx.pid \
+ --prefix=${prefix} \
+ --with-http_ssl_module \
+ --with-http_gzip_static_module \
+ ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS}
+}
+
+do_install () {
+ oe_runmake 'DESTDIR=${D}' install
+ rm -fr ${D}${localstatedir}/run ${D}/run
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d /run/${BPN} - - - -" \
+ > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
+ echo "d /${localstatedir}/log/${BPN} 0755 root root -" \
+ >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
+ fi
+ install -d ${D}${sysconfdir}/${BPN}
+ ln -snf ${localstatedir}/run/${BPN} ${D}${sysconfdir}/${BPN}/run
+ install -d ${D}${NGINX_WWWDIR}
+ mv ${D}/usr/html ${D}${NGINX_WWWDIR}/
+ chown ${NGINX_USER}:www-data -R ${D}${NGINX_WWWDIR}
+
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/nginx.init ${D}${sysconfdir}/init.d/nginx
+ sed -i 's,/usr/sbin/,${sbindir}/,g' ${D}${sysconfdir}/init.d/nginx
+ sed -i 's,/etc/,${sysconfdir}/,g' ${D}${sysconfdir}/init.d/nginx
+
+ install -d ${D}${sysconfdir}/nginx
+ install -m 0644 ${WORKDIR}/nginx.conf ${D}${sysconfdir}/nginx/nginx.conf
+ sed -i 's,/var/,${localstatedir}/,g' ${D}${sysconfdir}/nginx/nginx.conf
+ sed -i 's/^user.*/user ${NGINX_USER};/g' ${D}${sysconfdir}/nginx/nginx.conf
+ install -d ${D}${sysconfdir}/nginx/sites-enabled
+
+ install -d ${D}${sysconfdir}/default/volatiles
+ install -m 0644 ${WORKDIR}/nginx-volatile.conf ${D}${sysconfdir}/default/volatiles/99_nginx
+ sed -i 's,/var/,${localstatedir}/,g' ${D}${sysconfdir}/default/volatiles/99_nginx
+ sed -i 's,@NGINX_USER@,${NGINX_USER},g' ${D}${sysconfdir}/default/volatiles/99_nginx
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/nginx.service ${D}${systemd_unitdir}/system/
+ sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ -e 's,@LOCALSTATEDIR@,${localstatedir},g' \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ ${D}${systemd_unitdir}/system/nginx.service
+ fi
+}
+
+pkg_postinst_${PN} () {
+ if [ -z "$D" ]; then
+ if type systemd-tmpfiles >/dev/null; then
+ systemd-tmpfiles --create
+ elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
+ ${sysconfdir}/init.d/populate-volatile.sh update
+ fi
+ fi
+}
+
+FILES_${PN} += " \
+ ${localstatedir}/ \
+ ${systemd_unitdir}/system/nginx.service \
+"
+
+CONFFILES_${PN} = " \
+ ${sysconfdir}/nginx/nginx.conf \
+ ${sysconfdir}/nginx/fastcgi.conf \
+ ${sysconfdir}/nginx/fastcgi_params \
+ ${sysconfdir}/nginx/koi-utf \
+ ${sysconfdir}/nginx/koi-win \
+ ${sysconfdir}/nginx/mime.types \
+ ${sysconfdir}/nginx/scgi_params \
+ ${sysconfdir}/nginx/uwsgi_params \
+ ${sysconfdir}/nginx/win-utf \
+"
+
+INITSCRIPT_NAME = "nginx"
+INITSCRIPT_PARAMS = "defaults 92 20"
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = " \
+ --system --no-create-home \
+ --home ${NGINX_WWWDIR} \
+ --groups www-data \
+ --user-group ${NGINX_USER}"
diff --git a/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.12.2.bb b/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.12.2.bb
new file mode 100644
index 000000000..85ad29b08
--- /dev/null
+++ b/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.12.2.bb
@@ -0,0 +1,6 @@
+require nginx.inc
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=903753de5f86a1ee0341fd2f9491b282"
+
+SRC_URI[md5sum] = "4d2fc76211435f029271f1cf6d7eeae3"
+SRC_URI[sha256sum] = "305f379da1d5fb5aefa79e45c829852ca6983c7cd2a79328f8e084a324cf0416"
diff --git a/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.13.9.bb b/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.13.9.bb
new file mode 100644
index 000000000..923479447
--- /dev/null
+++ b/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.13.9.bb
@@ -0,0 +1,10 @@
+require nginx.inc
+
+# 1.12.x branch is the current stable branch, the recommended default
+# 1.13.x is the current mainline branches containing all new features
+DEFAULT_PREFERENCE = "-1"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3691402cc54ce09f800ca348634a2dfe"
+
+SRC_URI[md5sum] = "dcd482dd98d2022659212f183e8fe81b"
+SRC_URI[sha256sum] = "5faea18857516fe68d30be39c3032bd22ed9cf85e1a6fdf32e3721d96ff7fa42"
OpenPOWER on IntegriCloud