apache2_2.4.9.bb 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. DEPENDS = "libtool-native apache2-native openssl expat pcre apr apr-util"
  6. SECTION = "net"
  7. LICENSE = "Apache-2.0"
  8. SRC_URI = "http://www.apache.org/dist/httpd/httpd-${PV}.tar.bz2 \
  9. file://server-makefile.patch \
  10. file://httpd-2.4.1-corelimit.patch \
  11. file://httpd-2.4.4-export.patch \
  12. file://httpd-2.4.1-selinux.patch \
  13. file://apache-configure_perlbin.patch \
  14. file://replace-lynx-to-curl-in-apachectl-script.patch \
  15. file://apache-ssl-ltmain-rpath.patch \
  16. file://httpd-2.4.3-fix-race-issue-of-dir-install.patch \
  17. file://npn-patch-2.4.7.patch \
  18. file://0001-configure-use-pkg-config-for-PCRE-detection.patch \
  19. file://init \
  20. file://apache2-volatile.conf"
  21. LIC_FILES_CHKSUM = "file://LICENSE;md5=dbff5a2b542fa58854455bf1a0b94b83"
  22. SRC_URI[md5sum] = "2ef4e65353497606b24fa9bb3e5a3c40"
  23. SRC_URI[sha256sum] = "f78cc90dfa47caf3d83ad18fd6b4e85f237777c1733fc9088594b70ce2847603"
  24. S = "${WORKDIR}/httpd-${PV}"
  25. inherit autotools update-rc.d pkgconfig
  26. SSTATE_SCAN_FILES += "apxs config_vars.mk config.nice"
  27. CFLAGS_append = " -DPATH_MAX=4096"
  28. CFLAGS_prepend = "-I${STAGING_INCDIR}/openssl "
  29. EXTRA_OECONF = "--enable-ssl \
  30. --with-ssl=${STAGING_LIBDIR}/.. \
  31. --with-expat=${STAGING_LIBDIR}/.. \
  32. --with-apr=${STAGING_BINDIR_CROSS}/apr-1-config \
  33. --with-apr-util=${STAGING_BINDIR_CROSS}/apu-1-config \
  34. --enable-info \
  35. --enable-rewrite \
  36. --with-dbm=sdbm \
  37. --with-berkeley-db=no \
  38. --localstatedir=/var/${BPN} \
  39. --with-gdbm=no \
  40. --with-ndbm=no \
  41. --includedir=${includedir}/${BPN} \
  42. --datadir=${datadir}/${BPN} \
  43. --sysconfdir=${sysconfdir}/${BPN} \
  44. --libexecdir=${libdir}/${BPN}/modules \
  45. ap_cv_void_ptr_lt_long=no \
  46. --enable-mpms-shared \
  47. ac_cv_have_threadsafe_pollset=no"
  48. do_install_append() {
  49. install -d ${D}/${sysconfdir}/init.d
  50. cat ${WORKDIR}/init | \
  51. sed -e 's,/usr/sbin/,${sbindir}/,g' \
  52. -e 's,/usr/bin/,${bindir}/,g' \
  53. -e 's,/usr/lib,${libdir}/,g' \
  54. -e 's,/etc/,${sysconfdir}/,g' \
  55. -e 's,/usr/,${prefix}/,g' > ${D}/${sysconfdir}/init.d/${BPN}
  56. chmod 755 ${D}/${sysconfdir}/init.d/${BPN}
  57. # remove the goofy original files...
  58. rm -rf ${D}/${sysconfdir}/${BPN}/original
  59. # Expat should be found in the staging area via DEPENDS...
  60. rm -f ${D}/${libdir}/libexpat.*
  61. install -d ${D}${sysconfdir}/${BPN}/conf.d
  62. install -d ${D}${sysconfdir}/${BPN}/modules.d
  63. # Ensure configuration file pulls in conf.d and modules.d
  64. printf "\nIncludeOptional ${sysconfdir}/${BPN}/conf.d/*.conf" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
  65. printf "\nIncludeOptional ${sysconfdir}/${BPN}/modules.d/*.conf\n\n" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
  66. # match with that is in init script
  67. printf "\nPidFile /run/httpd.pid" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
  68. # Set 'ServerName' to fix error messages when restart apache service
  69. sed -i 's/^#ServerName www.example.com/ServerName localhost/' ${D}/${sysconfdir}/${BPN}/httpd.conf
  70. if ${@base_contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
  71. install -d ${D}${sysconfdir}/tmpfiles.d/
  72. install -m 0644 ${WORKDIR}/apache2-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
  73. fi
  74. }
  75. SYSROOT_PREPROCESS_FUNCS += "apache_sysroot_preprocess"
  76. apache_sysroot_preprocess () {
  77. install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
  78. install -m 755 ${D}${bindir}/apxs ${SYSROOT_DESTDIR}${bindir_crossscripts}/
  79. sed -i 's!my $installbuilddir = .*!my $installbuilddir = "${STAGING_DIR_HOST}/${datadir}/${BPN}/build";!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/apxs
  80. sed -i 's!my $libtool = .*!my $libtool = "${STAGING_BINDIR_CROSS}/${TARGET_PREFIX}libtool";!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/apxs
  81. sed -i 's!^APR_CONFIG = .*!APR_CONFIG = ${STAGING_BINDIR_CROSS}/apr-1-config!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
  82. sed -i 's!^APU_CONFIG = .*!APU_CONFIG = ${STAGING_BINDIR_CROSS}/apu-1-config!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
  83. sed -i 's!^includedir = .*!includedir = ${STAGING_INCDIR}/apache2!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
  84. }
  85. #
  86. # implications - used by update-rc.d scripts
  87. #
  88. INITSCRIPT_NAME = "apache2"
  89. INITSCRIPT_PARAMS = "defaults 91 20"
  90. LEAD_SONAME = "libapr-1.so.0"
  91. PACKAGES = "${PN}-doc ${PN}-dev ${PN}-dbg ${PN}"
  92. CONFFILES_${PN} = "${sysconfdir}/${BPN}/httpd.conf \
  93. ${sysconfdir}/${BPN}/magic \
  94. ${sysconfdir}/${BPN}/mime.types \
  95. ${sysconfdir}/init.d/${BPN} "
  96. # we override here rather than append so that .so links are
  97. # included in the runtime package rather than here (-dev)
  98. # and to get build, icons, error into the -dev package
  99. FILES_${PN}-dev = "${datadir}/${BPN}/build \
  100. ${datadir}/${BPN}/icons \
  101. ${datadir}/${BPN}/error \
  102. ${bindir}/apr-config ${bindir}/apu-config \
  103. ${libdir}/apr*.exp \
  104. ${includedir}/${BPN} \
  105. ${libdir}/*.la \
  106. ${libdir}/*.a"
  107. # manual to manual
  108. FILES_${PN}-doc += " ${datadir}/${BPN}/manual"
  109. #
  110. # override this too - here is the default, less datadir
  111. #
  112. FILES_${PN} = "${bindir} ${sbindir} ${libexecdir} ${libdir}/lib*.so.* ${sysconfdir} \
  113. ${sharedstatedir} ${localstatedir} /bin /sbin /lib/*.so* \
  114. ${libdir}/${BPN}"
  115. # we want htdocs and cgi-bin to go with the binary
  116. FILES_${PN} += "${datadir}/${BPN}/htdocs ${datadir}/${BPN}/cgi-bin"
  117. #make sure the lone .so links also get wrapped in the base package
  118. FILES_${PN} += "${libdir}/lib*.so ${libdir}/pkgconfig/*"
  119. FILES_${PN}-dbg += "${libdir}/${BPN}/modules/.debug"
  120. RDEPENDS_${PN} += "openssl libgcc"