Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | DESCRIPTION = "The Apache HTTP Server is a powerful, efficient, and \ |
| 2 | extensible web server." |
| 3 | SUMMARY = "Apache HTTP Server" |
| 4 | HOMEPAGE = "http://httpd.apache.org/" |
| 5 | SECTION = "net" |
| 6 | LICENSE = "Apache-2.0" |
| 7 | |
| 8 | SRC_URI = "${APACHE_MIRROR}/httpd/httpd-${PV}.tar.bz2 \ |
| 9 | file://0001-configure-use-pkg-config-for-PCRE-detection.patch \ |
| 10 | file://0002-apache2-bump-up-the-core-size-limit-if-CoreDumpDirec.patch \ |
| 11 | file://0003-apache2-do-not-export-apr-apr-util-symbols-when-usin.patch \ |
| 12 | file://0004-apache2-log-the-SELinux-context-at-startup.patch \ |
| 13 | file://0005-replace-lynx-to-curl-in-apachectl-script.patch \ |
| 14 | file://0006-apache2-fix-the-race-issue-of-parallel-installation.patch \ |
| 15 | file://0007-apache2-allow-to-disable-selinux-support.patch \ |
| 16 | file://apache-configure_perlbin.patch \ |
| 17 | " |
| 18 | |
| 19 | SRC_URI_append_class-target = " \ |
| 20 | file://0008-apache2-do-not-use-relative-path-for-gen_test_char.patch \ |
| 21 | file://init \ |
| 22 | file://apache2-volatile.conf \ |
| 23 | file://apache2.service \ |
| 24 | file://volatiles.04_apache2 \ |
| 25 | " |
| 26 | |
| 27 | LIC_FILES_CHKSUM = "file://LICENSE;md5=d52d0fd0bc788f068e647116c01ddfcd" |
| 28 | SRC_URI[md5sum] = "930e217ba2d71e708a3f1521ecae7ec0" |
| 29 | SRC_URI[sha256sum] = "b4ca9d05773aa59b54d66cd8f4744b945289f084d3be17d7981d1783a5decfa2" |
| 30 | |
| 31 | S = "${WORKDIR}/httpd-${PV}" |
| 32 | |
| 33 | inherit autotools update-rc.d pkgconfig systemd update-alternatives |
| 34 | |
| 35 | DEPENDS = "openssl expat pcre apr apr-util apache2-native " |
| 36 | |
| 37 | CVE_PRODUCT = "http_server" |
| 38 | |
| 39 | SSTATE_SCAN_FILES += "apxs config_vars.mk config.nice" |
| 40 | |
| 41 | PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}" |
| 42 | PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux" |
| 43 | PACKAGECONFIG[openldap] = "--enable-ldap --enable-authnz-ldap,--disable-ldap --disable-authnz-ldap,openldap" |
| 44 | PACKAGECONFIG[zlib] = "--enable-deflate,,zlib,zlib" |
| 45 | |
| 46 | CFLAGS_append = " -DPATH_MAX=4096" |
| 47 | |
| 48 | EXTRA_OECONF_class-target = "\ |
| 49 | --enable-layout=Debian \ |
| 50 | --prefix=${base_prefix} \ |
| 51 | --exec_prefix=${exec_prefix} \ |
| 52 | --includedir=${includedir}/${BPN} \ |
| 53 | --sysconfdir=${sysconfdir}/${BPN} \ |
| 54 | --datadir=${datadir}/${BPN} \ |
| 55 | --libdir=${libdir} \ |
| 56 | --libexecdir=${libdir}/${BPN}/modules \ |
| 57 | --localstatedir=${localstatedir} \ |
| 58 | --enable-ssl \ |
| 59 | --with-dbm=sdbm \ |
| 60 | --with-gdbm=no \ |
| 61 | --with-ndbm=no \ |
| 62 | --with-berkeley-db=no \ |
| 63 | --enable-info \ |
| 64 | --enable-rewrite \ |
| 65 | --enable-mpms-shared \ |
| 66 | ap_cv_void_ptr_lt_long=no \ |
| 67 | ac_cv_have_threadsafe_pollset=no \ |
| 68 | " |
| 69 | |
| 70 | EXTRA_OECONF_class-native = "\ |
| 71 | --prefix=${prefix} \ |
| 72 | --includedir=${includedir}/${BPN} \ |
| 73 | --sysconfdir=${sysconfdir}/${BPN} \ |
| 74 | --datadir=${datadir}/${BPN} \ |
| 75 | --libdir=${libdir} \ |
| 76 | --libexecdir=${libdir}/${BPN}/modules \ |
| 77 | --localstatedir=${localstatedir} \ |
| 78 | " |
| 79 | |
| 80 | do_configure_prepend() { |
| 81 | sed -i -e 's:$''{prefix}/usr/lib/cgi-bin:$''{libdir}/cgi-bin:g' ${S}/config.layout |
| 82 | } |
| 83 | |
| 84 | do_install_append_class-target() { |
| 85 | install -d ${D}/${sysconfdir}/init.d |
| 86 | |
| 87 | cat ${WORKDIR}/init | \ |
| 88 | sed -e 's,/usr/sbin/,${sbindir}/,g' \ |
| 89 | -e 's,/usr/bin/,${bindir}/,g' \ |
| 90 | -e 's,/usr/lib/,${libdir}/,g' \ |
| 91 | -e 's,/etc/,${sysconfdir}/,g' \ |
| 92 | -e 's,/usr/,${prefix}/,g' > ${D}/${sysconfdir}/init.d/${BPN} |
| 93 | |
| 94 | chmod 755 ${D}/${sysconfdir}/init.d/${BPN} |
| 95 | |
| 96 | # Remove the goofy original files... |
| 97 | rm -rf ${D}/${sysconfdir}/${BPN}/original |
| 98 | |
| 99 | install -d ${D}${sysconfdir}/${BPN}/conf.d |
| 100 | install -d ${D}${sysconfdir}/${BPN}/modules.d |
| 101 | |
| 102 | # Ensure configuration file pulls in conf.d and modules.d |
| 103 | printf "\nIncludeOptional ${sysconfdir}/${BPN}/conf.d/*.conf" >> ${D}/${sysconfdir}/${BPN}/httpd.conf |
| 104 | printf "\nIncludeOptional ${sysconfdir}/${BPN}/modules.d/*.load" >> ${D}/${sysconfdir}/${BPN}/httpd.conf |
| 105 | printf "\nIncludeOptional ${sysconfdir}/${BPN}/modules.d/*.conf\n\n" >> ${D}/${sysconfdir}/${BPN}/httpd.conf |
| 106 | |
| 107 | # Match with that is in init script |
| 108 | printf "\nPidFile /run/httpd.pid" >> ${D}/${sysconfdir}/${BPN}/httpd.conf |
| 109 | |
| 110 | # Set 'ServerName' to fix error messages when restart apache service |
| 111 | sed -i 's/^#ServerName www.example.com/ServerName localhost/' ${D}/${sysconfdir}/${BPN}/httpd.conf |
| 112 | |
| 113 | sed -i 's/^ServerRoot/#ServerRoot/' ${D}/${sysconfdir}/${BPN}/httpd.conf |
| 114 | |
| 115 | sed -i -e 's,${STAGING_DIR_TARGET},,g' \ |
| 116 | -e 's,${DEBUG_PREFIX_MAP},,g' \ |
| 117 | -e 's,-fdebug-prefix-map[^ ]*,,g; s,-fmacro-prefix-map[^ ]*,,g' \ |
| 118 | -e 's,${HOSTTOOLS_DIR}/,,g' \ |
| 119 | -e 's,APU_INCLUDEDIR = .*,APU_INCLUDEDIR = ,g' \ |
| 120 | -e 's,APU_CONFIG = .*,APU_CONFIG = ,g' ${D}${datadir}/apache2/build/config_vars.mk |
| 121 | |
| 122 | sed -i -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ |
| 123 | -e 's,${DEBUG_PREFIX_MAP},,g' \ |
| 124 | -e 's,${RECIPE_SYSROOT},,g' \ |
| 125 | -e 's,-fdebug-prefix-map[^ ]*,,g; s,-fmacro-prefix-map[^ ]*,,g' \ |
| 126 | -e 's,APU_INCLUDEDIR = .*,APU_INCLUDEDIR = ,g' \ |
| 127 | -e 's,".*/configure","configure",g' ${D}${datadir}/apache2/build/config.nice |
| 128 | |
| 129 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 130 | install -d ${D}${sysconfdir}/tmpfiles.d/ |
| 131 | install -m 0644 ${WORKDIR}/apache2-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ |
| 132 | |
| 133 | install -d ${D}${systemd_unitdir}/system |
| 134 | install -m 0644 ${WORKDIR}/apache2.service ${D}${systemd_unitdir}/system |
| 135 | sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/apache2.service |
| 136 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/apache2.service |
| 137 | elif ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 138 | install -d ${D}${sysconfdir}/default/volatiles |
| 139 | install -m 0644 ${WORKDIR}/volatiles.04_apache2 ${D}${sysconfdir}/default/volatiles/04_apache2 |
| 140 | fi |
| 141 | |
| 142 | rm -rf ${D}${localstatedir} |
| 143 | chown -R root:root ${D} |
| 144 | } |
| 145 | |
| 146 | do_install_append_class-native() { |
| 147 | install -d ${D}${bindir} ${D}${libdir} |
| 148 | install -m 755 server/gen_test_char ${D}${bindir} |
| 149 | } |
| 150 | |
| 151 | SYSROOT_PREPROCESS_FUNCS_append_class-target = " apache_sysroot_preprocess" |
| 152 | |
| 153 | apache_sysroot_preprocess() { |
| 154 | install -d ${SYSROOT_DESTDIR}${bindir_crossscripts} |
| 155 | install -m 755 ${D}${bindir}/apxs ${SYSROOT_DESTDIR}${bindir_crossscripts} |
| 156 | install -d ${SYSROOT_DESTDIR}${sbindir} |
| 157 | install -m 755 ${D}${sbindir}/apachectl ${SYSROOT_DESTDIR}${sbindir} |
| 158 | sed -i 's!my $installbuilddir = .*!my $installbuilddir = "${STAGING_DIR_HOST}/${datadir}/${BPN}/build";!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/apxs |
| 159 | sed -i 's!my $libtool = .*!my $libtool = "${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool";!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/apxs |
| 160 | |
| 161 | sed -i 's!^APR_CONFIG = .*!APR_CONFIG = ${STAGING_BINDIR_CROSS}/apr-1-config!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk |
| 162 | sed -i 's!^APU_CONFIG = .*!APU_CONFIG = ${STAGING_BINDIR_CROSS}/apu-1-config!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk |
| 163 | sed -i 's!^includedir = .*!includedir = ${STAGING_INCDIR}/apache2!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk |
| 164 | sed -i 's!^CFLAGS = -I[^ ]*!CFLAGS = -I${STAGING_INCDIR}/openssl!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk |
| 165 | sed -i 's!^EXTRA_LDFLAGS = .*!EXTRA_LDFLAGS = -L${STAGING_LIBDIR}!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk |
| 166 | sed -i 's!^EXTRA_INCLUDES = .*!EXTRA_INCLUDES = -I$(includedir) -I. -I${STAGING_INCDIR}!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk |
| 167 | sed -i 's!--sysroot=[^ ]*!--sysroot=${STAGING_DIR_HOST}!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk |
| 168 | } |
| 169 | |
| 170 | # Implications - used by update-rc.d scripts |
| 171 | INITSCRIPT_NAME = "apache2" |
| 172 | INITSCRIPT_PARAMS = "defaults 91 20" |
| 173 | |
| 174 | SYSTEMD_SERVICE_${PN} = "apache2.service" |
| 175 | SYSTEMD_AUTO_ENABLE_${PN} = "enable" |
| 176 | |
| 177 | ALTERNATIVE_${PN}-doc = "htpasswd.1" |
| 178 | ALTERNATIVE_LINK_NAME[htpasswd.1] = "${mandir}/man1/htpasswd.1" |
| 179 | |
| 180 | PACKAGES = "${PN}-scripts ${PN}-doc ${PN}-dev ${PN}-dbg ${PN}" |
| 181 | |
| 182 | CONFFILES_${PN} = "${sysconfdir}/${BPN}/httpd.conf \ |
| 183 | ${sysconfdir}/${BPN}/magic \ |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 184 | ${sysconfdir}/${BPN}/mime.types \ |
| 185 | ${sysconfdir}/${BPN}/extra/*" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 186 | |
| 187 | # We override here rather than append so that .so links are |
| 188 | # included in the runtime package rather than here (-dev) |
| 189 | # and to get build, icons, error into the -dev package |
| 190 | FILES_${PN}-dev = "${datadir}/${BPN}/build \ |
| 191 | ${datadir}/${BPN}/icons \ |
| 192 | ${datadir}/${BPN}/error \ |
| 193 | ${includedir}/${BPN} \ |
| 194 | ${bindir}/apxs \ |
| 195 | " |
| 196 | |
| 197 | # Add the manual to -doc |
| 198 | FILES_${PN}-doc += " ${datadir}/${BPN}/manual" |
| 199 | |
| 200 | FILES_${PN}-scripts += "${bindir}/dbmmanage" |
| 201 | |
| 202 | # Override this too - here is the default, less datadir |
| 203 | FILES_${PN} = "${bindir} ${sbindir} ${libexecdir} ${libdir} \ |
| 204 | ${sysconfdir} ${libdir}/${BPN}" |
| 205 | |
| 206 | # We want htdocs and cgi-bin to go with the binary |
| 207 | FILES_${PN} += "${datadir}/${BPN}/ ${libdir}/cgi-bin" |
| 208 | |
| 209 | FILES_${PN}-dbg += "${libdir}/${BPN}/modules/.debug" |
| 210 | |
| 211 | RDEPENDS_${PN} += "openssl libgcc" |
| 212 | RDEPENDS_${PN}-scripts += "perl ${PN}" |
| 213 | RDEPENDS_${PN}-dev = "perl" |
| 214 | |
| 215 | BBCLASSEXTEND = "native" |