nginx: new recipe, updated from aging original in rpi layer (has not been scrubbed for any potential policy issues).
PATCH 1/1 nginx: new recipe, updated from aging original in rpi layer (has not been scrubbed for any potential policy issues).
From: "stephen.arnold42" <[email protected]>
--- .../nginx/files/nginx-cross_1.4.0.diff | 212 +++++++++++++++++++++ .../recipes-httpd/nginx/files/nginx.conf | 118 ++++++++++++ .../recipes-httpd/nginx/files/nginx.init | 52 +++++ meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb | 91 +++++++++ 4 files changed, 473 insertions(+) create mode 100644 meta-webserver/recipes-httpd/nginx/files/nginx-cross_1.4.0.diff create mode 100644 meta-webserver/recipes-httpd/nginx/files/nginx.conf create mode 100755 meta-webserver/recipes-httpd/nginx/files/nginx.init create mode 100644 meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb
meta-webserver/recipes-httpd/nginx/files/nginx-cross_1.4.0.diff new file +212 -0
@@ -0,0 +1,212 @@ +diff -uraN nginx-1.0.11.orig/auto/feature nginx-1.0.11/auto/feature +--- nginx-1.0.11.orig/auto/feature 2011-05-11 06:50:19.000000000 -0500 ++++ nginx-1.0.11/auto/feature 2011-12-27 13:56:42.323370040 -0600 +@@ -48,12 +48,20 @@ + + 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 +@@ -67,17 +75,27 @@ + + 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 +@@ -85,7 +103,7 @@ + + 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 +diff -uraN nginx-1.0.11.orig/auto/options nginx-1.0.11/auto/options +--- nginx-1.0.11.orig/auto/options 2011-12-14 07:34:16.000000000 -0600 ++++ nginx-1.0.11/auto/options 2011-12-27 13:56:42.323370040 -0600 +@@ -289,6 +289,18 @@ + --test-build-rtsig) NGX_TEST_BUILD_RTSIG=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 +@@ -434,6 +446,17 @@ + + --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 +@@ -455,6 +478,8 @@ + + if [ ".$NGX_PLATFORM" = ".win32" ]; then + NGX_WINE=$WINE ++elif [ ! -z "$NGX_PLATFORM" ]; then ++ NGX_CROSS_COMPILE="yes" + fi + + +diff -uraN nginx-1.0.11.orig/auto/types/sizeof nginx-1.0.11/auto/types/sizeof +--- nginx-1.0.11.orig/auto/types/sizeof 2006-06-28 11:00:26.000000000 -0500 ++++ nginx-1.0.11/auto/types/sizeof 2011-12-27 13:56:42.323370040 -0600 +@@ -11,9 +11,12 @@ + + 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> +@@ -31,19 +34,20 @@ + 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" +-fi ++ if [ -x $NGX_AUTOTEST ]; then ++ ngx_size=`$NGX_AUTOTEST` ++ echo " $ngx_size bytes" ++ fi + + +-rm -f $NGX_AUTOTEST ++ rm -f $NGX_AUTOTEST ++fi + + + case $ngx_size in +diff -uraN nginx-1.0.11.orig/auto/unix nginx-1.0.11/auto/unix +--- nginx-1.0.11.orig/auto/unix 2011-12-14 07:34:16.000000000 -0600 ++++ nginx-1.0.11/auto/unix 2011-12-27 13:56:42.327370060 -0600 +@@ -393,13 +393,13 @@ + + # 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 + + +@@ -416,7 +416,7 @@ + + 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 + +@@ -432,15 +432,15 @@ + + . auto/endianess + +-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 +
meta-webserver/recipes-httpd/nginx/files/nginx.conf new file +118 -0
118 lines not on this page · raw message
meta-webserver/recipes-httpd/nginx/files/nginx.init new file +52 -0
52 lines not on this page · raw message
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +91 -0
91 lines not on this page · raw message
Signature · 1 line
1.8.3.2
Hi Stephen,
Thanks for sending this. A few comments below.
Quoted 1 line · On Tuesday 08 October 2013 22:33:44 stephen.arnold42 wrote:
From: "stephen.arnold42" <[email protected]>
Ideally the part of the subject from "updated..." onwards should go into the commit message. You should really specify that the "rpi" layer you refer to is your own.
meta-webserver/recipes-httpd/nginx/files/nginx-cross_1.4.0.diff line 1
Quoted 3 lines
+++
b/meta-webserver/recipes-httpd/nginx/files/nginx-cross_1.4.0.diffmeta-webserver/recipes-httpd/nginx/files/nginx-cross_1.4.0.diff new file +1
-0@@ -0,0 +1,212 @@ +diff -uraN nginx-1.0.11.orig/auto/feature nginx-1.0.11/auto/feature
Could you please add a header to this patch mentioning what it does, the origin if it wasn't something you wrote, the Upstream-Status and your Signed- off-by?
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 1
Quoted 1 line
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +1
-0+DESCRIPTION = "HTTP and reverse proxy server"
Please set this as SUMMARY rather than DESCRIPTION since it's one line.
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 3
Quoted 2 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +2
-0+HOMEPAGE = "http://nginx.org/" +LICENSE = "BSD"
Can we be specific about which BSD license this is? Looking at it I think "BSD-2-Clause" is the correct one.
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 5
Quoted 2 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +2
-0+SECTION = "net" +PRIORITY = "optional"
Please drop PRIORITY, we don't use this anymore.
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 9
Quoted 3 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +3
-0+DEPENDS = "libpcre gzip openssl" + +PR = "r4"
PR should ideally be dropped since this is a new recipe for public layers.
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 18
Quoted 8 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +8
-0+SRC_URI = " \ + http://nginx.org/download/nginx-${PV}.tar.gz \ + file://nginx-cross_${PV}.diff;name=crosspatch \ + file://nginx.conf \ + file://nginx.init \ +" + +S = "${WORKDIR}/nginx-${PV}"
This is the default value for S ("${WORKDIR}/${BP}" where BP is "${BPN}-${PV}" and BPN is "nginx") so no need to set this.
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 20
Quoted 1 line
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +1
-0+inherit autotools update-rc.d useradd
I could be mistaken, but looking at the source it doesn't appear to be using autotools, in which case inheriting autotools wouldn't be right. That does mean you'll have to define your own do_install (doing "oe_runmake 'DESTDIR=${D}' install" before what you currently have in do_install_append).
Quoted 6 lines
(quoted diff) +2
-0+SRC_URI[md5sum] = "d496e58864ab10ed56278b7655b0d0b2" +SRC_URI[sha256sum] ="
84aeb7a131fccff036dc80283dd98c989d2844eb84359cfe7c4863475de923a9"(quoted diff) +2
-0+SRC_URI[crosspatch.md5sum] = "707c4cdd6bb82719ea2ed50971101c21" +SRC_URI[crosspatch.sha256sum] ="
96cc3b087126caaa0951ab3e3f9f26169e9caf283dd2aeb689ed6c435070f052"
We don't normally checksum local files such as "crosspatch".
Quoted 48 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +24
-0+LIC_FILES_CHKSUM = "file://LICENSE;md5=917bfdf005ffb6fd025550414ff05a9f" + +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" + +do_configure () { + PTRSIZE=$(expr ${SITEINFO_BITS} / 8) + + echo $CFLAGS + echo $LDFLAGS + + ./configure \ + --crossbuild=Linux:${TUNE_ARCH} \ + --with-endian=${@base_conditional('SITEINFO_ENDIANNESS', 'le', 'little','big', d)} \ + --with-int=4 \
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +23
-0+ --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=/etc/nginx/nginx.conf \ + --http-log-path=/var/log/nginx/access.log \ + --error-log-path=/var/log/nginx/error.log \ + --pid-path=/var/run/nginx/nginx.pid \ + --prefix=/usr \ + --with-http_ssl_module \ + --with-http_gzip_static_module +} + +do_install_append () { + install -d ${D}${localstatedir}/www/localhost + mv ${D}/usr/html ${D}${localstatedir}/www/localhost/ + chown www:www-data -R ${D}${localstatedir} + + install -d ${D}${sysconfdir}/init.d
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 84
Quoted 10 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +10
-0+ install -d ${D}${sysconfdir}/nginx + install -m 0755 ${WORKDIR}/nginx.init ${D}${sysconfdir}/init.d/nginx + install -m 0644 ${WORKDIR}/nginx.conf ${D}${sysconfdir}/nginx/ + + install -d ${D}${sysconfdir}/default/volatiles + echo "d www www-data 0755 ${localstatedir}/run/nginx none" \ + > ${D}${sysconfdir}/default/volatiles/99_nginx +} + +FILES_${PN} += "${localstatedir}/ /run/"
I don't think we should be adding /run/ here. There is a guide on how to deal with unshipped file/dir warnings for /run in case you haven't seen it:
http://permalink.gmane.org/gmane.comp.handhelds.openembedded/58530
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre
Hmm, fun with gmail...
Anyway, I was (somewhat blindly) following the submission/patch instructions here:
http://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded
I can certainly provide more info (as well as clean up the recipe) but your first few points don't seem to be mentioned there, although the page seems fairly current date-wise. Should I be looking in a different place? Otherwise I'll do me best to address everything, it just might take a few days (too many work hours lately).
Thanks for the feedback.
Steve
On Wed, Oct 9, 2013 at 2:55 AM, Paul Eggleton <[email protected]
Quoted 151 lines
wrote:
Hi Stephen,
Thanks for sending this. A few comments below.
Quoted 1 line · On Tuesday 08 October 2013 22:33:44 stephen.arnold42 wrote:
From: "stephen.arnold42" <[email protected]>
Ideally the part of the subject from "updated..." onwards should go into the
commit message. You should really specify that the "rpi" layer you refer to is
your own.meta-webserver/recipes-httpd/nginx/files/nginx-cross_1.4.0.diff line 1
Quoted 3 lines
+++
b/meta-webserver/recipes-httpd/nginx/files/nginx-cross_1.4.0.diffmeta-webserver/recipes-httpd/nginx/files/nginx-cross_1.4.0.diff new file +1
-0@@ -0,0 +1,212 @@ +diff -uraN nginx-1.0.11.orig/auto/feature nginx-1.0.11/auto/featureCould you please add a header to this patch mentioning what it does, the origin if it wasn't something you wrote, the Upstream-Status and your Signed-
off-by?meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 1
Quoted 1 line
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +1
-0+DESCRIPTION = "HTTP and reverse proxy server"Please set this as SUMMARY rather than DESCRIPTION since it's one line.
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 3
Quoted 2 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +2
-0+HOMEPAGE = "http://nginx.org/" +LICENSE = "BSD"Can we be specific about which BSD license this is? Looking at it I think "BSD-2-Clause" is the correct one.
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 5
Quoted 2 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +2
-0+SECTION = "net" +PRIORITY = "optional"Please drop PRIORITY, we don't use this anymore.
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 9
Quoted 3 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +3
-0+DEPENDS = "libpcre gzip openssl" + +PR = "r4"PR should ideally be dropped since this is a new recipe for public layers.
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 18
Quoted 8 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +8
-0+SRC_URI = " \ + http://nginx.org/download/nginx-${PV}.tar.gz \ + file://nginx-cross_${PV}.diff;name=crosspatch \ + file://nginx.conf \ + file://nginx.init \ +" + +S = "${WORKDIR}/nginx-${PV}"This is the default value for S ("${WORKDIR}/${BP}" where BP is "${BPN}-${PV}"
and BPN is "nginx") so no need to set this.meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 20
Quoted 1 line
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +1
-0+inherit autotools update-rc.d useraddI could be mistaken, but looking at the source it doesn't appear to be using
autotools, in which case inheriting autotools wouldn't be right. That does mean you'll have to define your owndo_install(doing "oe_runmake'DESTDIR=${D}' install" before what you currently have indo_install_append).Quoted 6 lines
(quoted diff) +2
-0+SRC_URI[md5sum] = "d496e58864ab10ed56278b7655b0d0b2" +SRC_URI[sha256sum] ="
84aeb7a131fccff036dc80283dd98c989d2844eb84359cfe7c4863475de923a9"(quoted diff) +2
-0+SRC_URI[crosspatch.md5sum] = "707c4cdd6bb82719ea2ed50971101c21" +SRC_URI[crosspatch.sha256sum] ="
96cc3b087126caaa0951ab3e3f9f26169e9caf283dd2aeb689ed6c435070f052"We don't normally checksum local files such as "crosspatch".
Quoted 1 line
+LIC_FILES_CHKSUM =
"file://LICENSE;md5=917bfdf005ffb6fd025550414ff05a9f" +
Quoted 13 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +13
-0+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"meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb
Quoted 10 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +10
-0+ +do_configure () { + PTRSIZE=$(expr ${SITEINFO_BITS} / 8) + + echo $CFLAGS + echo $LDFLAGS + + ./configure \ + --crossbuild=Linux:${TUNE_ARCH} \ + --with-endian=${@base_conditional('SITEINFO_ENDIANNESS', 'le','little',
Quoted 24 lines
'big', d)} \ + --with-int=4 \
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +23
-0+ --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=/etc/nginx/nginx.conf \ + --http-log-path=/var/log/nginx/access.log \ + --error-log-path=/var/log/nginx/error.log \ + --pid-path=/var/run/nginx/nginx.pid \ + --prefix=/usr \ + --with-http_ssl_module \ + --with-http_gzip_static_module +} + +do_install_append () { + install -d ${D}${localstatedir}/www/localhost + mv ${D}/usr/html ${D}${localstatedir}/www/localhost/ + chown www:www-data -R ${D}${localstatedir} + + install -d ${D}${sysconfdir}/init.dmeta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 84
Quoted 10 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +10
-0+ install -d ${D}${sysconfdir}/nginx + install -m 0755 ${WORKDIR}/nginx.init ${D}${sysconfdir}/init.d/nginx + install -m 0644 ${WORKDIR}/nginx.conf ${D}${sysconfdir}/nginx/ + + install -d ${D}${sysconfdir}/default/volatiles + echo "d www www-data 0755 ${localstatedir}/run/nginx none" \ + > ${D}${sysconfdir}/default/volatiles/99_nginx +} + +FILES_${PN} += "${localstatedir}/ /run/"I don't think we should be adding
/run/here. There is a guide on how to deal
with unshipped file/dir warnings for /run in case you haven't seen it:http://permalink.gmane.org/gmane.comp.handhelds.openembedded/58530
Cheers,
Paul--
Paul Eggleton
Intel Open Source Technology Centre
Hi Steve,
Quoted 8 lines · On Thursday 10 October 2013 20:02:49 Stephen Arnold wrote:
Anyway, I was (somewhat blindly) following the submission/patch instructions here:
http://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded
I can certainly provide more info (as well as clean up the recipe) but your first few points don't seem to be mentioned there, although the page seems fairly current date-wise. Should I be looking in a different place?
To be honest we probably don't have one place where all of this is currently documented, sorry about that. We do have:
http://www.openembedded.org/wiki/Styleguide
However that doesn't actually cover all of the items I mentioned. Some of the material from the following page probably should be added to the style guide:
http://www.openembedded.org/wiki/Migrating_metadata_to_OE-Core
We do also have this page; it's linked from the "How to submit a patch" page although perhaps not prominently:
http://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Quoted 2 lines
Otherwise I'll do me best to address everything, it just might take a few days (too many work hours lately).
No worries.
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre
Paul:
Okay, I have a cleaner and more compliant recipe and a few questions for your comments. See below...
On Wed, Oct 9, 2013 at 2:55 AM, Paul Eggleton <[email protected]
Quoted 6 lines
wrote:
Hi Stephen,
Thanks for sending this. A few comments below.
Quoted 9 lines
Quoted 1 line · On Tuesday 08 October 2013 22:33:44 stephen.arnold42 wrote:
From: "stephen.arnold42" <[email protected]>
Ideally the part of the subject from "updated..." onwards should go into the
commit message. You should really specify that the "rpi" layer you refer to is
your own.
So, [meta-openembedded/meta-webserver][PATCH] nginx: new recipe] and be more accurate about lineage.
I only know the IRC nick of the original author of the old recipe (bencoh). I wrote the init script and minimal config file, made sure everything built and ran correctly in the rpi-image, and made an rpi-data package. That lead to me making a newer (generic) recipe for 1.4.0 (but without the rpi-graphics). How should I describe that? With bencoh as the original author and me as "upstream"?
Quoted 9 lines
meta-webserver/recipes-httpd/nginx/files/nginx-cross_1.4.0.diff line 1
Quoted 3 lines
+++
b/meta-webserver/recipes-httpd/nginx/files/nginx-cross_1.4.0.diffmeta-webserver/recipes-httpd/nginx/files/nginx-cross_1.4.0.diff new file +1
-0@@ -0,0 +1,212 @@ +diff -uraN nginx-1.0.11.orig/auto/feature nginx-1.0.11/auto/featureCould you please add a header to this patch mentioning what it does, the origin if it wasn't something you wrote, the Upstream-Status and your Signed-
off-by?
So you want a bigger commit message mentioning the above in front of the signed-off-by that's already there? Origin is described above (bencoh and then me) but what do you mean by "Upstream-Status"? Who/what is upstream in this case?
Quoted 10 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 1
Quoted 1 line
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +1
-0+DESCRIPTION = "HTTP and reverse proxy server"Please set this as SUMMARY rather than DESCRIPTION since it's one line.
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 3
Quoted 2 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +2
-0+HOMEPAGE = "http://nginx.org/" +LICENSE = "BSD"Can we be specific about which BSD license this is? Looking at it I think "BSD-2-Clause" is the correct one.
Quoted 5 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 5
Quoted 2 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +2
-0+SECTION = "net" +PRIORITY = "optional"Please drop PRIORITY, we don't use this anymore.
Done, done, and done.
Quoted 6 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 9
Quoted 3 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +3
-0+DEPENDS = "libpcre gzip openssl" + +PR = "r4"PR should ideally be dropped since this is a new recipe for public layers.
Dropped completely, or set PR = "r0" ?
Quoted 96 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 18
Quoted 8 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +8
-0+SRC_URI = " \ + http://nginx.org/download/nginx-${PV}.tar.gz \ + file://nginx-cross_${PV}.diff;name=crosspatch \ + file://nginx.conf \ + file://nginx.init \ +" + +S = "${WORKDIR}/nginx-${PV}"This is the default value for S ("${WORKDIR}/${BP}" where BP is "${BPN}-${PV}"
and BPN is "nginx") so no need to set this.meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 20
Quoted 1 line
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +1
-0+inherit autotools update-rc.d useraddI could be mistaken, but looking at the source it doesn't appear to be using
autotools, in which case inheriting autotools wouldn't be right. That does mean you'll have to define your owndo_install(doing "oe_runmake'DESTDIR=${D}' install" before what you currently have indo_install_append).Quoted 6 lines
(quoted diff) +2
-0+SRC_URI[md5sum] = "d496e58864ab10ed56278b7655b0d0b2" +SRC_URI[sha256sum] ="
84aeb7a131fccff036dc80283dd98c989d2844eb84359cfe7c4863475de923a9"(quoted diff) +2
-0+SRC_URI[crosspatch.md5sum] = "707c4cdd6bb82719ea2ed50971101c21" +SRC_URI[crosspatch.sha256sum] ="
96cc3b087126caaa0951ab3e3f9f26169e9caf283dd2aeb689ed6c435070f052"We don't normally checksum local files such as "crosspatch".
Quoted 1 line
+LIC_FILES_CHKSUM =
"file://LICENSE;md5=917bfdf005ffb6fd025550414ff05a9f" +
Quoted 13 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +13
-0+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"meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb
Quoted 10 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +10
-0+ +do_configure () { + PTRSIZE=$(expr ${SITEINFO_BITS} / 8) + + echo $CFLAGS + echo $LDFLAGS + + ./configure \ + --crossbuild=Linux:${TUNE_ARCH} \ + --with-endian=${@base_conditional('SITEINFO_ENDIANNESS', 'le','little',
Quoted 24 lines
'big', d)} \ + --with-int=4 \
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +23
-0+ --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=/etc/nginx/nginx.conf \ + --http-log-path=/var/log/nginx/access.log \ + --error-log-path=/var/log/nginx/error.log \ + --pid-path=/var/run/nginx/nginx.pid \ + --prefix=/usr \ + --with-http_ssl_module \ + --with-http_gzip_static_module +} + +do_install_append () { + install -d ${D}${localstatedir}/www/localhost + mv ${D}/usr/html ${D}${localstatedir}/www/localhost/ + chown www:www-data -R ${D}${localstatedir} + + install -d ${D}${sysconfdir}/init.dmeta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb line 84
Quoted 10 lines
meta-webserver/recipes-httpd/nginx/nginx_1.4.0.bb new file +10
-0+ install -d ${D}${sysconfdir}/nginx + install -m 0755 ${WORKDIR}/nginx.init ${D}${sysconfdir}/init.d/nginx + install -m 0644 ${WORKDIR}/nginx.conf ${D}${sysconfdir}/nginx/ + + install -d ${D}${sysconfdir}/default/volatiles + echo "d www www-data 0755 ${localstatedir}/run/nginx none" \ + > ${D}${sysconfdir}/default/volatiles/99_nginx +} + +FILES_${PN} += "${localstatedir}/ /run/"I don't think we should be adding
/run/here. There is a guide on how to deal
with unshipped file/dir warnings for /run in case you haven't seen it:
Thanks, and done.
Quoted 8 lines
Cheers,
Paul--
Paul Eggleton
Intel Open Source Technology Centre
Hi Steve,
Quoted 5 lines · On Thursday 17 October 2013 16:21:58 Stephen Arnold wrote:
On Wed, Oct 9, 2013 at 2:55 AM, Paul Eggleton <[email protected]
Quoted 4 lines
wrote:
Thanks for sending this. A few comments below.On Tuesday 08 October 2013 22:33:44 stephen.arnold42 wrote:
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
From: "stephen.arnold42" <[email protected]>
Ideally the part of the subject from "updated..." onwards should go into the commit message. You should really specify that the "rpi" layer you refer to is your own.
So, [meta-openembedded/meta-webserver][PATCH] nginx: new recipe] and be more accurate about lineage.
Use this form:
[meta-webserver][PATCH] nginx: new recipe
You may already be aware, but this would be achieved by using "nginx: new recipe" as the first line of the commit message, and then using --subject-prefix="meta-webserver][PATCH" as an argument to git send-email (or git format-patch if generating the patch first before sending).
Quoted 6 lines
I only know the IRC nick of the original author of the old recipe (bencoh). I wrote the init script and minimal config file, made sure everything built and ran correctly in the rpi-image, and made an rpi-data package. That lead to me making a newer (generic) recipe for 1.4.0 (but without the rpi-graphics). How should I describe that? With bencoh as the original author and me as "upstream"?
It's probably not necessary to fully describe the "lineage" although a credit to the original author would probably be a good thing. Mainly what I was getting at is if you're going to say "meta-rpi" you should probably say that that's your layer since it might be assumed by some to refer to the perhaps more well-known meta-raspberrypi layer.
Quoted 11 lines
Quoted 8 lines
meta-webserver/recipes-httpd/nginx/files/nginx-cross_1.4.0.diff line 1
Quoted 3 lines
+++
b/meta-webserver/recipes-httpd/nginx/files/nginx-cross_1.4.0.diffmeta-webserver/recipes-httpd/nginx/files/nginx-cross_1.4.0.diff new file +1
-0@@ -0,0 +1,212 @@ +diff -uraN nginx-1.0.11.orig/auto/feature nginx-1.0.11/auto/featureCould you please add a header to this patch mentioning what it does, the origin if it wasn't something you wrote, the Upstream-Status and your Signed-
off-by?So you want a bigger commit message mentioning the above in front of the signed-off-by that's already there?
Here I'm referring to the top of the meta-webserver/recipes- httpd/nginx/files/nginx-cross_1.4.0.diff file rather than the overall commit message. Having this information at the top of the patch file itself makes it easy to see what each patch file in the tree is for and whether it needs to be upstreamed without having to go digging through the commit history.
Quoted 3 lines
Origin is described above (bencoh and
then me) but what do you mean by "Upstream-Status"? Who/what is upstream in this case?
Upstream = the nginx project itself; i.e. how does this patch relate to there
- should it be submitted there, or did it come from there already, or is it not appropriate for sending upstream, etc. See:
http://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre