diff options
Diffstat (limited to 'meta-webserver/recipes-httpd/nginx/nginx_1.9.11.bb')
-rw-r--r-- | meta-webserver/recipes-httpd/nginx/nginx_1.9.11.bb | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/meta-webserver/recipes-httpd/nginx/nginx_1.9.11.bb b/meta-webserver/recipes-httpd/nginx/nginx_1.9.11.bb new file mode 100644 index 000000000..4ea06c79e --- /dev/null +++ b/meta-webserver/recipes-httpd/nginx/nginx_1.9.11.bb | |||
@@ -0,0 +1,138 @@ | |||
1 | SUMMARY = "HTTP and reverse proxy server" | ||
2 | |||
3 | DESCRIPTION = "Nginx is a web server and a reverse proxy server for \ | ||
4 | HTTP, SMTP, POP3 and IMAP protocols, with a strong focus on high \ | ||
5 | concurrency, performance and low memory usage." | ||
6 | |||
7 | HOMEPAGE = "http://nginx.org/" | ||
8 | LICENSE = "BSD-2-Clause" | ||
9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=0bb58ed0dfd4f5dbece3b52aba79f023" | ||
10 | SECTION = "net" | ||
11 | |||
12 | DEPENDS = "libpcre gzip openssl" | ||
13 | |||
14 | SRC_URI = " \ | ||
15 | http://nginx.org/download/nginx-${PV}.tar.gz \ | ||
16 | file://nginx-cross.patch \ | ||
17 | file://nginx.conf \ | ||
18 | file://nginx.init \ | ||
19 | file://nginx-volatile.conf \ | ||
20 | file://nginx.service \ | ||
21 | " | ||
22 | SRC_URI[md5sum] = "76eb5853a1190e0cfc691aa21c545de3" | ||
23 | SRC_URI[sha256sum] = "6a5c72f4afaf57a6db064bba0965d72335f127481c5d4e64ee8714e7b368a51f" | ||
24 | |||
25 | inherit update-rc.d useradd | ||
26 | |||
27 | CFLAGS_append = " -fPIE -pie" | ||
28 | CXXFLAGS_append = " -fPIE -pie" | ||
29 | |||
30 | NGINX_WWWDIR ?= "${localstatedir}/www/localhost" | ||
31 | NGINX_USER ?= "www" | ||
32 | |||
33 | EXTRA_OECONF = "" | ||
34 | |||
35 | do_configure () { | ||
36 | if [ "${SITEINFO_BITS}" = "64" ]; then | ||
37 | PTRSIZE=8 | ||
38 | else | ||
39 | PTRSIZE=4 | ||
40 | fi | ||
41 | |||
42 | echo $CFLAGS | ||
43 | echo $LDFLAGS | ||
44 | |||
45 | ./configure \ | ||
46 | --crossbuild=Linux:${TUNE_ARCH} \ | ||
47 | --with-endian=${@base_conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \ | ||
48 | --with-int=4 \ | ||
49 | --with-long=${PTRSIZE} \ | ||
50 | --with-long-long=8 \ | ||
51 | --with-ptr-size=${PTRSIZE} \ | ||
52 | --with-sig-atomic-t=${PTRSIZE} \ | ||
53 | --with-size-t=${PTRSIZE} \ | ||
54 | --with-off-t=${PTRSIZE} \ | ||
55 | --with-time-t=${PTRSIZE} \ | ||
56 | --with-sys-nerr=132 \ | ||
57 | --conf-path=${sysconfdir}/nginx/nginx.conf \ | ||
58 | --http-log-path=${localstatedir}/log/nginx/access.log \ | ||
59 | --error-log-path=${localstatedir}/log/nginx/error.log \ | ||
60 | --pid-path=/run/nginx/nginx.pid \ | ||
61 | --prefix=${prefix} \ | ||
62 | --with-http_ssl_module \ | ||
63 | --with-http_gzip_static_module \ | ||
64 | ${EXTRA_OECONF} | ||
65 | } | ||
66 | |||
67 | do_install () { | ||
68 | oe_runmake 'DESTDIR=${D}' install | ||
69 | rm -fr ${D}${localstatedir}/run ${D}/run | ||
70 | if ${@base_contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
71 | install -d ${D}${sysconfdir}/tmpfiles.d | ||
72 | echo "d /run/${BPN} - - - -" \ | ||
73 | > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf | ||
74 | fi | ||
75 | install -d ${D}${sysconfdir}/${BPN} | ||
76 | ln -snf ${localstatedir}/run/${BPN} ${D}${sysconfdir}/${BPN}/run | ||
77 | install -d ${D}${NGINX_WWWDIR} | ||
78 | mv ${D}/usr/html ${D}${NGINX_WWWDIR}/ | ||
79 | chown ${NGINX_USER}:www-data -R ${D}${NGINX_WWWDIR} | ||
80 | |||
81 | install -d ${D}${sysconfdir}/init.d | ||
82 | install -m 0755 ${WORKDIR}/nginx.init ${D}${sysconfdir}/init.d/nginx | ||
83 | sed -i 's,/usr/sbin/,${sbindir}/,g' ${D}${sysconfdir}/init.d/nginx | ||
84 | sed -i 's,/etc/,${sysconfdir}/,g' ${D}${sysconfdir}/init.d/nginx | ||
85 | |||
86 | install -d ${D}${sysconfdir}/nginx | ||
87 | install -m 0644 ${WORKDIR}/nginx.conf ${D}${sysconfdir}/nginx/nginx.conf | ||
88 | sed -i 's,/var/,${localstatedir}/,g' ${D}${sysconfdir}/nginx/nginx.conf | ||
89 | install -d ${D}${sysconfdir}/nginx/sites-enabled | ||
90 | |||
91 | install -d ${D}${sysconfdir}/default/volatiles | ||
92 | install -m 0644 ${WORKDIR}/nginx-volatile.conf ${D}${sysconfdir}/default/volatiles/99_nginx | ||
93 | sed -i 's,/var/,${localstatedir}/,g' ${D}${sysconfdir}/default/volatiles/99_nginx | ||
94 | |||
95 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then | ||
96 | install -d ${D}${systemd_unitdir}/system | ||
97 | install -m 0644 ${WORKDIR}/nginx.service ${D}${systemd_unitdir}/system/ | ||
98 | sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \ | ||
99 | -e 's,@LOCALSTATEDIR@,${localstatedir},g' \ | ||
100 | -e 's,@BASEBINDIR@,${base_bindir},g' \ | ||
101 | ${D}${systemd_unitdir}/system/nginx.service | ||
102 | fi | ||
103 | } | ||
104 | |||
105 | pkg_postinst_${PN} () { | ||
106 | if [ -z "$D" ]; then | ||
107 | if type systemd-tmpfiles >/dev/null; then | ||
108 | systemd-tmpfiles --create | ||
109 | elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then | ||
110 | ${sysconfdir}/init.d/populate-volatile.sh update | ||
111 | fi | ||
112 | fi | ||
113 | } | ||
114 | |||
115 | FILES_${PN} += "${localstatedir}/ \ | ||
116 | ${systemd_unitdir}/system/nginx.service \ | ||
117 | " | ||
118 | |||
119 | CONFFILES_${PN} = "${sysconfdir}/nginx/nginx.conf \ | ||
120 | ${sysconfdir}/nginx/fastcgi.conf\ | ||
121 | ${sysconfdir}/nginx/fastcgi_params \ | ||
122 | ${sysconfdir}/nginx/koi-utf \ | ||
123 | ${sysconfdir}/nginx/koi-win \ | ||
124 | ${sysconfdir}/nginx/mime.types \ | ||
125 | ${sysconfdir}/nginx/scgi_params \ | ||
126 | ${sysconfdir}/nginx/uwsgi_params \ | ||
127 | ${sysconfdir}/nginx/win-utf \ | ||
128 | " | ||
129 | |||
130 | INITSCRIPT_NAME = "nginx" | ||
131 | INITSCRIPT_PARAMS = "defaults 92 20" | ||
132 | |||
133 | USERADD_PACKAGES = "${PN}" | ||
134 | USERADD_PARAM_${PN} = " \ | ||
135 | --system --no-create-home \ | ||
136 | --home ${NGINX_WWWDIR} \ | ||
137 | --groups www-data \ | ||
138 | --user-group ${NGINX_USER}" | ||