Yocto 2.4

Move OpenBMC to Yocto 2.4(rocko)

Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I12057b18610d6fb0e6903c60213690301e9b0c67
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2-native_2.4.25.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2-native_2.4.27.bb
similarity index 90%
rename from import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2-native_2.4.25.bb
rename to import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2-native_2.4.27.bb
index 99717d2..4e893db 100644
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2-native_2.4.25.bb
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2-native_2.4.27.bb
@@ -15,8 +15,8 @@
 S = "${WORKDIR}/httpd-${PV}"
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=dbff5a2b542fa58854455bf1a0b94b83"
-SRC_URI[md5sum] = "2826f49619112ad5813c0be5afcc7ddb"
-SRC_URI[sha256sum] = "f87ec2df1c9fee3e6bfde3c8b855a3ddb7ca1ab20ca877bd0e2b6bf3f05c80b2"
+SRC_URI[md5sum] = "97b6bbfa83c866dbe20ef317e3afd108"
+SRC_URI[sha256sum] = "71fcc128238a690515bd8174d5330a5309161ef314a326ae45c7c15ed139c13a"
 
 EXTRA_OECONF = "--with-apr=${STAGING_BINDIR_CROSS}/apr-1-config \
                 --with-apr-util=${STAGING_BINDIR_CROSS}/apu-1-config \
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2_2.4.25.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2_2.4.27.bb
similarity index 90%
rename from import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2_2.4.25.bb
rename to import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2_2.4.27.bb
index 0ba7d3c..1880867 100644
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2_2.4.25.bb
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2_2.4.27.bb
@@ -20,11 +20,12 @@
            file://init \
            file://apache2-volatile.conf \
            file://apache2.service \
+           file://volatiles.04_apache2 \
           "
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=dbff5a2b542fa58854455bf1a0b94b83"
-SRC_URI[md5sum] = "2826f49619112ad5813c0be5afcc7ddb"
-SRC_URI[sha256sum] = "f87ec2df1c9fee3e6bfde3c8b855a3ddb7ca1ab20ca877bd0e2b6bf3f05c80b2"
+SRC_URI[md5sum] = "97b6bbfa83c866dbe20ef317e3afd108"
+SRC_URI[sha256sum] = "71fcc128238a690515bd8174d5330a5309161ef314a326ae45c7c15ed139c13a"
 
 S = "${WORKDIR}/httpd-${PV}"
 
@@ -58,9 +59,13 @@
     ac_cv_have_threadsafe_pollset=no"
 
 PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}"
-PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux"
+PACKAGECONFIG[selinux] = "--enable-selinux --enable-layout=Debian --prefix=${base_prefix}/,--disable-selinux,libselinux,libselinux"
 PACKAGECONFIG[openldap] = "--enable-ldap --enable-authnz-ldap,--disable-ldap --disable-authnz-ldap,openldap"
 
+do_configure_prepend() {
+        sed -i -e 's:$''{prefix}/usr/lib/cgi-bin:$''{libdir}/cgi-bin:g' ${S}/config.layout
+}
+
 do_install_append() {
     install -d ${D}/${sysconfdir}/init.d
     cat ${WORKDIR}/init | \
@@ -90,6 +95,9 @@
     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
         install -d ${D}${sysconfdir}/tmpfiles.d/
         install -m 0644 ${WORKDIR}/apache2-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
+    elif ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+        install -d ${D}${sysconfdir}/default/volatiles
+        install -m 0644 ${WORKDIR}/volatiles.04_apache2 ${D}${sysconfdir}/default/volatiles/04_apache2
     fi
 
     install -d ${D}${systemd_unitdir}/system
@@ -107,6 +115,7 @@
 
     sed -i -e 's,${STAGING_DIR_HOST},,g' \
            -e 's,".*/configure","configure",g' ${D}${datadir}/apache2/build/config.nice
+    rm -rf ${D}${localstatedir}/run
 }
 
 SYSROOT_PREPROCESS_FUNCS += "apache_sysroot_preprocess"
@@ -180,3 +189,6 @@
 RDEPENDS_${PN} += "openssl libgcc"
 RDEPENDS_${PN}-scripts += "perl ${PN}"
 RDEPENDS_${PN}-dev = "perl"
+
+FILES_${PN} += "${libdir}/cgi-bin"
+FILES_${PN} += "${datadir}/${BPN}/"
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/files/volatiles.04_apache2 b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/files/volatiles.04_apache2
new file mode 100644
index 0000000..922075b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/apache2/files/volatiles.04_apache2
@@ -0,0 +1,3 @@
+# <type> <owner> <group> <mode> <path> <linksource>
+d root root 0755 /var/run/apache2 none
+d root root 0755 /var/log/apache2 none
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/cherokee/cherokee/0001-configure.ac-Add-foreign-to-AM_INIT_AUTOMAKE.patch b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/cherokee/cherokee/0001-configure.ac-Add-foreign-to-AM_INIT_AUTOMAKE.patch
new file mode 100644
index 0000000..f3be7c6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/cherokee/cherokee/0001-configure.ac-Add-foreign-to-AM_INIT_AUTOMAKE.patch
@@ -0,0 +1,30 @@
+From 4591b5b40d66c19edc73b951ad091dac639454c9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 25 Jul 2017 16:00:34 -0700
+Subject: [PATCH] configure.ac: Add foreign to AM_INIT_AUTOMAKE
+
+Fixes errors like
+| Makefile.am: error: required file './README' not found
+| Makefile.am: error: required file './ChangeLog' not found
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index d6298f27..98cab791 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -32,7 +32,7 @@ dnl Init autoconf and automake
+ AC_INIT([cherokee], [cherokee_version], [http://bugs.cherokee-project.com/], [cherokee])
+ AC_CONFIG_SRCDIR([cherokee/server.c])
+ AC_CONFIG_MACRO_DIR([m4])
+-AM_INIT_AUTOMAKE([no-define])
++AM_INIT_AUTOMAKE([no-define foreign])
+ 
+ dnl Define version
+ AC_DEFINE(PACKAGE_MAJOR_VERSION, "cherokee_major_version", [Version string])
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/cherokee/cherokee/0001-make-Do-not-build-po-files.patch b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/cherokee/cherokee/0001-make-Do-not-build-po-files.patch
new file mode 100644
index 0000000..d4c0b6e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/cherokee/cherokee/0001-make-Do-not-build-po-files.patch
@@ -0,0 +1,27 @@
+From e9ae3231ec188df801fe51aa95d6afec2e52db58 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 25 Jul 2017 16:14:19 -0700
+Subject: [PATCH] make: Do not build po files
+
+Target fails to build
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index f01278c3..eb864c36 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,6 +1,6 @@
+ ## Cherokee: Makefile.am  -*- makefile -*-
+ 
+-SUBDIRS = po m4 www icons themes qa doc . admin contrib cherokee cget packages dbslayer
++SUBDIRS = m4 www icons themes qa doc . admin contrib cherokee cget packages dbslayer
+ SUFFIXES = .sample.pre .sample .h.pre .h .xml.pre .xml
+ ACLOCAL_AMFLAGS = -I m4
+ 
+-- 
+2.13.3
+
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/cherokee/cherokee_1.2.98.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/cherokee/cherokee_git.bb
similarity index 81%
rename from import-layers/meta-openembedded/meta-webserver/recipes-httpd/cherokee/cherokee_1.2.98.bb
rename to import-layers/meta-openembedded/meta-webserver/recipes-httpd/cherokee/cherokee_git.bb
index ba39f97..3f7eae4 100644
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/cherokee/cherokee_1.2.98.bb
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/cherokee/cherokee_git.bb
@@ -5,19 +5,21 @@
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 
-PR = "r9"
+DEPENDS = "unzip-native libpcre openssl mysql5 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
 
-DEPENDS = "libpcre openssl mysql5 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
-
-SRC_URI = "http://mirror.aarnet.edu.au/pub/${BPN}/1.2/${PV}/${BP}.tar.gz \
+SRCREV = "75f041e2255e6dd0692db2f14611c2647dbe8425"
+PV = "1.2.104+git${SRCPV}"
+SRC_URI = "git://github.com/cherokee/webserver \
            file://cherokee.init \
            file://cherokee.service \
            file://cherokee-install-configured.py-once.patch \
+           file://0001-configure.ac-Add-foreign-to-AM_INIT_AUTOMAKE.patch \
+           file://0001-make-Do-not-build-po-files.patch \
 "
-SRC_URI[md5sum] = "21b01e7d45c0e82ecc0c4257a9c27feb"
-SRC_URI[sha256sum] = "042b5687b1a3db3ca818167548ce5d32c35e227c6640732dcb622a6f4a078b7d"
 
-inherit autotools pkgconfig binconfig update-rc.d systemd
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep pkgconfig binconfig update-rc.d systemd pythonnative
 
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 PACKAGECONFIG[ffmpeg] = "--with-ffmpeg,--without-ffmpeg,libav"
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx.inc b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx.inc
index f98f299..4a97e26 100644
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx.inc
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx.inc
@@ -9,7 +9,7 @@
 
 SECTION = "net"
 
-DEPENDS = "libpcre gzip openssl"
+DEPENDS = "libpcre zlib openssl"
 
 SRC_URI = " \
     http://nginx.org/download/nginx-${PV}.tar.gz \
@@ -72,7 +72,7 @@
     --prefix=${prefix} \
     --with-http_ssl_module \
     --with-http_gzip_static_module \
-    ${EXTRA_OECONF}
+    ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS}
 }
 
 do_install () {
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.10.3.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.10.3.bb
deleted file mode 100644
index b62fd4c..0000000
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.10.3.bb
+++ /dev/null
@@ -1,6 +0,0 @@
-require nginx.inc
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=0bb58ed0dfd4f5dbece3b52aba79f023"
-
-SRC_URI[md5sum] = "204a20cb4f0b0c9db746c630d89ff4ea"
-SRC_URI[sha256sum] = "75020f1364cac459cb733c4e1caed2d00376e40ea05588fb8793076a4c69dd90"
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.11.10.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.11.10.bb
deleted file mode 100644
index 37565fc..0000000
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.11.10.bb
+++ /dev/null
@@ -1,10 +0,0 @@
-require nginx.inc
-
-# 1.10.x branch is the current stable branch, the recommended default
-# 1.11.x is the current mainline branches containing all new features
-DEFAULT_PREFERENCE = "-1"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=903753de5f86a1ee0341fd2f9491b282"
-
-SRC_URI[md5sum] = "6fb10f579055d27a2240d51c7d85c190"
-SRC_URI[sha256sum] = "778b3cabb07633f754cd9dee32fc8e22582bce22bfa407be76a806abd935533d"
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.12.1.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.12.1.bb
new file mode 100644
index 0000000..7f0e3ad
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.12.1.bb
@@ -0,0 +1,6 @@
+require nginx.inc
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=903753de5f86a1ee0341fd2f9491b282"
+
+SRC_URI[md5sum] = "a307e74aca95403e5ee00f153807ce58"
+SRC_URI[sha256sum] = "8793bf426485a30f91021b6b945a9fd8a84d87d17b566562c3797aba8fac76fb"
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.13.5.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.13.5.bb
new file mode 100644
index 0000000..9f2c117
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/nginx/nginx_1.13.5.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=903753de5f86a1ee0341fd2f9491b282"
+
+SRC_URI[md5sum] = "f193722159adfb1eb8117c0491fd17ec"
+SRC_URI[sha256sum] = "0e75b94429b3f745377aeba3aff97da77bf2b03fcb9ff15b3bad9b038db29f2e"
diff --git a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.27.0.bb b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.27.1.bb
similarity index 87%
rename from import-layers/meta-openembedded/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.27.0.bb
rename to import-layers/meta-openembedded/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.27.1.bb
index 2125b24..c9fe55b 100644
--- a/import-layers/meta-openembedded/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.27.0.bb
+++ b/import-layers/meta-openembedded/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.27.1.bb
@@ -6,13 +6,13 @@
 
 DEPENDS += "base-passwd"
 
-SRC_URI = "http://opensource.dyc.edu/pub/sthttpd/sthttpd-${PV}.tar.gz \
+SRC_URI = "https://github.com/blueness/${BPN}/archive/v${PV}.tar.gz;downloadfilename=${BP}.tar.gz \
            file://thttpd.service \
            file://thttpd.conf \
            file://init"
 
-SRC_URI[md5sum] = "f7dd2d506dc5fad2ad8794b1800d2634"
-SRC_URI[sha256sum] = "97d660a881331e93818e872ce11536f461105d70a18dfc5de5895851c4b2afdb"
+SRC_URI[md5sum] = "3cda1b6c8c8542b1510eadb8e540d8b6"
+SRC_URI[sha256sum] = "a1ee2806432eaf5b5dd267a0523701f9f1fa00fefd499d5bec42165a41e05846"
 
 S = "${WORKDIR}/sthttpd-${PV}"