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