summaryrefslogtreecommitdiffstats
path: root/meta-webserver/recipes-httpd
diff options
context:
space:
mode:
authorPascal Bach <pascal.bach@siemens.com>2016-03-14 11:23:12 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2016-03-25 11:26:57 +0100
commitd5eec8b7f3cb3f9ab5ba689c9d8e4401a4e66b24 (patch)
treee9b7a7a13d67fd2713bf594b6345effe47bed781 /meta-webserver/recipes-httpd
parent767dd8375c353de1db282ab84e541565056506dc (diff)
downloadmeta-openembedded-d5eec8b7f3cb3f9ab5ba689c9d8e4401a4e66b24.tar.gz
nginx: split parts out of the recipe into nginx.inc
nginx has two maintained branches. - stable: is the long term maintained branch where only bugfixes occur - mainline: is the branch where new features get added This change is in preparation to support these two branches. Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Diffstat (limited to 'meta-webserver/recipes-httpd')
-rw-r--r--meta-webserver/recipes-httpd/nginx/nginx.inc137
-rw-r--r--meta-webserver/recipes-httpd/nginx/nginx_1.9.12.bb135
2 files changed, 138 insertions, 134 deletions
diff --git a/meta-webserver/recipes-httpd/nginx/nginx.inc b/meta-webserver/recipes-httpd/nginx/nginx.inc
new file mode 100644
index 000000000..53e32352d
--- /dev/null
+++ b/meta-webserver/recipes-httpd/nginx/nginx.inc
@@ -0,0 +1,137 @@
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=0bb58ed0dfd4f5dbece3b52aba79f023"
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 file://nginx.service \
21"
22
23inherit update-rc.d useradd
24
25CFLAGS_append = " -fPIE -pie"
26CXXFLAGS_append = " -fPIE -pie"
27
28NGINX_WWWDIR ?= "${localstatedir}/www/localhost"
29NGINX_USER ?= "www"
30
31EXTRA_OECONF = ""
32DISABLE_STATIC = ""
33
34do_configure () {
35 if [ "${SITEINFO_BITS}" = "64" ]; then
36 PTRSIZE=8
37 else
38 PTRSIZE=4
39 fi
40
41 echo $CFLAGS
42 echo $LDFLAGS
43
44 ./configure \
45 --crossbuild=Linux:${TUNE_ARCH} \
46 --with-endian=${@base_conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \
47 --with-int=4 \
48 --with-long=${PTRSIZE} \
49 --with-long-long=8 \
50 --with-ptr-size=${PTRSIZE} \
51 --with-sig-atomic-t=${PTRSIZE} \
52 --with-size-t=${PTRSIZE} \
53 --with-off-t=${PTRSIZE} \
54 --with-time-t=${PTRSIZE} \
55 --with-sys-nerr=132 \
56 --conf-path=${sysconfdir}/nginx/nginx.conf \
57 --http-log-path=${localstatedir}/log/nginx/access.log \
58 --error-log-path=${localstatedir}/log/nginx/error.log \
59 --pid-path=/run/nginx/nginx.pid \
60 --prefix=${prefix} \
61 --with-http_ssl_module \
62 --with-http_gzip_static_module \
63 ${EXTRA_OECONF}
64}
65
66do_install () {
67 oe_runmake 'DESTDIR=${D}' install
68 rm -fr ${D}${localstatedir}/run ${D}/run
69 if ${@base_contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
70 install -d ${D}${sysconfdir}/tmpfiles.d
71 echo "d /run/${BPN} - - - -" \
72 > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
73 fi
74 install -d ${D}${sysconfdir}/${BPN}
75 ln -snf ${localstatedir}/run/${BPN} ${D}${sysconfdir}/${BPN}/run
76 install -d ${D}${NGINX_WWWDIR}
77 mv ${D}/usr/html ${D}${NGINX_WWWDIR}/
78 chown ${NGINX_USER}:www-data -R ${D}${NGINX_WWWDIR}
79
80 install -d ${D}${sysconfdir}/init.d
81 install -m 0755 ${WORKDIR}/nginx.init ${D}${sysconfdir}/init.d/nginx
82 sed -i 's,/usr/sbin/,${sbindir}/,g' ${D}${sysconfdir}/init.d/nginx
83 sed -i 's,/etc/,${sysconfdir}/,g' ${D}${sysconfdir}/init.d/nginx
84
85 install -d ${D}${sysconfdir}/nginx
86 install -m 0644 ${WORKDIR}/nginx.conf ${D}${sysconfdir}/nginx/nginx.conf
87 sed -i 's,/var/,${localstatedir}/,g' ${D}${sysconfdir}/nginx/nginx.conf
88 install -d ${D}${sysconfdir}/nginx/sites-enabled
89
90 install -d ${D}${sysconfdir}/default/volatiles
91 install -m 0644 ${WORKDIR}/nginx-volatile.conf ${D}${sysconfdir}/default/volatiles/99_nginx
92 sed -i 's,/var/,${localstatedir}/,g' ${D}${sysconfdir}/default/volatiles/99_nginx
93
94 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then
95 install -d ${D}${systemd_unitdir}/system
96 install -m 0644 ${WORKDIR}/nginx.service ${D}${systemd_unitdir}/system/
97 sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
98 -e 's,@LOCALSTATEDIR@,${localstatedir},g' \
99 -e 's,@BASEBINDIR@,${base_bindir},g' \
100 ${D}${systemd_unitdir}/system/nginx.service
101 fi
102}
103
104pkg_postinst_${PN} () {
105 if [ -z "$D" ]; then
106 if type systemd-tmpfiles >/dev/null; then
107 systemd-tmpfiles --create
108 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
109 ${sysconfdir}/init.d/populate-volatile.sh update
110 fi
111 fi
112}
113
114FILES_${PN} += "${localstatedir}/ \
115 ${systemd_unitdir}/system/nginx.service \
116 "
117
118CONFFILES_${PN} = "${sysconfdir}/nginx/nginx.conf \
119 ${sysconfdir}/nginx/fastcgi.conf\
120 ${sysconfdir}/nginx/fastcgi_params \
121 ${sysconfdir}/nginx/koi-utf \
122 ${sysconfdir}/nginx/koi-win \
123 ${sysconfdir}/nginx/mime.types \
124 ${sysconfdir}/nginx/scgi_params \
125 ${sysconfdir}/nginx/uwsgi_params \
126 ${sysconfdir}/nginx/win-utf \
127"
128
129INITSCRIPT_NAME = "nginx"
130INITSCRIPT_PARAMS = "defaults 92 20"
131
132USERADD_PACKAGES = "${PN}"
133USERADD_PARAM_${PN} = " \
134 --system --no-create-home \
135 --home ${NGINX_WWWDIR} \
136 --groups www-data \
137 --user-group ${NGINX_USER}"
diff --git a/meta-webserver/recipes-httpd/nginx/nginx_1.9.12.bb b/meta-webserver/recipes-httpd/nginx/nginx_1.9.12.bb
index d18f82b61..821a28c9f 100644
--- a/meta-webserver/recipes-httpd/nginx/nginx_1.9.12.bb
+++ b/meta-webserver/recipes-httpd/nginx/nginx_1.9.12.bb
@@ -1,139 +1,6 @@
1SUMMARY = "HTTP and reverse proxy server" 1require nginx.inc
2 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=0bb58ed0dfd4f5dbece3b52aba79f023"
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 file://nginx.service \
21"
22SRC_URI[md5sum] = "0afe4a7e589a0de43b7b54aa055a4351" 3SRC_URI[md5sum] = "0afe4a7e589a0de43b7b54aa055a4351"
23SRC_URI[sha256sum] = "1af2eb956910ed4b11aaf525a81bc37e135907e7127948f9179f5410337da042" 4SRC_URI[sha256sum] = "1af2eb956910ed4b11aaf525a81bc37e135907e7127948f9179f5410337da042"
24 5
25inherit update-rc.d useradd
26
27CFLAGS_append = " -fPIE -pie"
28CXXFLAGS_append = " -fPIE -pie"
29
30NGINX_WWWDIR ?= "${localstatedir}/www/localhost"
31NGINX_USER ?= "www"
32
33EXTRA_OECONF = ""
34DISABLE_STATIC = "" 6DISABLE_STATIC = ""
35
36do_configure () {
37 if [ "${SITEINFO_BITS}" = "64" ]; then
38 PTRSIZE=8
39 else
40 PTRSIZE=4
41 fi
42
43 echo $CFLAGS
44 echo $LDFLAGS
45
46 ./configure \
47 --crossbuild=Linux:${TUNE_ARCH} \
48 --with-endian=${@base_conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \
49 --with-int=4 \
50 --with-long=${PTRSIZE} \
51 --with-long-long=8 \
52 --with-ptr-size=${PTRSIZE} \
53 --with-sig-atomic-t=${PTRSIZE} \
54 --with-size-t=${PTRSIZE} \
55 --with-off-t=${PTRSIZE} \
56 --with-time-t=${PTRSIZE} \
57 --with-sys-nerr=132 \
58 --conf-path=${sysconfdir}/nginx/nginx.conf \
59 --http-log-path=${localstatedir}/log/nginx/access.log \
60 --error-log-path=${localstatedir}/log/nginx/error.log \
61 --pid-path=/run/nginx/nginx.pid \
62 --prefix=${prefix} \
63 --with-http_ssl_module \
64 --with-http_gzip_static_module \
65 ${EXTRA_OECONF}
66}
67
68do_install () {
69 oe_runmake 'DESTDIR=${D}' install
70 rm -fr ${D}${localstatedir}/run ${D}/run
71 if ${@base_contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
72 install -d ${D}${sysconfdir}/tmpfiles.d
73 echo "d /run/${BPN} - - - -" \
74 > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
75 fi
76 install -d ${D}${sysconfdir}/${BPN}
77 ln -snf ${localstatedir}/run/${BPN} ${D}${sysconfdir}/${BPN}/run
78 install -d ${D}${NGINX_WWWDIR}
79 mv ${D}/usr/html ${D}${NGINX_WWWDIR}/
80 chown ${NGINX_USER}:www-data -R ${D}${NGINX_WWWDIR}
81
82 install -d ${D}${sysconfdir}/init.d
83 install -m 0755 ${WORKDIR}/nginx.init ${D}${sysconfdir}/init.d/nginx
84 sed -i 's,/usr/sbin/,${sbindir}/,g' ${D}${sysconfdir}/init.d/nginx
85 sed -i 's,/etc/,${sysconfdir}/,g' ${D}${sysconfdir}/init.d/nginx
86
87 install -d ${D}${sysconfdir}/nginx
88 install -m 0644 ${WORKDIR}/nginx.conf ${D}${sysconfdir}/nginx/nginx.conf
89 sed -i 's,/var/,${localstatedir}/,g' ${D}${sysconfdir}/nginx/nginx.conf
90 install -d ${D}${sysconfdir}/nginx/sites-enabled
91
92 install -d ${D}${sysconfdir}/default/volatiles
93 install -m 0644 ${WORKDIR}/nginx-volatile.conf ${D}${sysconfdir}/default/volatiles/99_nginx
94 sed -i 's,/var/,${localstatedir}/,g' ${D}${sysconfdir}/default/volatiles/99_nginx
95
96 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then
97 install -d ${D}${systemd_unitdir}/system
98 install -m 0644 ${WORKDIR}/nginx.service ${D}${systemd_unitdir}/system/
99 sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
100 -e 's,@LOCALSTATEDIR@,${localstatedir},g' \
101 -e 's,@BASEBINDIR@,${base_bindir},g' \
102 ${D}${systemd_unitdir}/system/nginx.service
103 fi
104}
105
106pkg_postinst_${PN} () {
107 if [ -z "$D" ]; then
108 if type systemd-tmpfiles >/dev/null; then
109 systemd-tmpfiles --create
110 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
111 ${sysconfdir}/init.d/populate-volatile.sh update
112 fi
113 fi
114}
115
116FILES_${PN} += "${localstatedir}/ \
117 ${systemd_unitdir}/system/nginx.service \
118 "
119
120CONFFILES_${PN} = "${sysconfdir}/nginx/nginx.conf \
121 ${sysconfdir}/nginx/fastcgi.conf\
122 ${sysconfdir}/nginx/fastcgi_params \
123 ${sysconfdir}/nginx/koi-utf \
124 ${sysconfdir}/nginx/koi-win \
125 ${sysconfdir}/nginx/mime.types \
126 ${sysconfdir}/nginx/scgi_params \
127 ${sysconfdir}/nginx/uwsgi_params \
128 ${sysconfdir}/nginx/win-utf \
129"
130
131INITSCRIPT_NAME = "nginx"
132INITSCRIPT_PARAMS = "defaults 92 20"
133
134USERADD_PACKAGES = "${PN}"
135USERADD_PARAM_${PN} = " \
136 --system --no-create-home \
137 --home ${NGINX_WWWDIR} \
138 --groups www-data \
139 --user-group ${NGINX_USER}"