summaryrefslogtreecommitdiffstats
path: root/meta-webserver/recipes-httpd/apache2/apache2_2.4.27.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-webserver/recipes-httpd/apache2/apache2_2.4.27.bb')
-rw-r--r--meta-webserver/recipes-httpd/apache2/apache2_2.4.27.bb182
1 files changed, 182 insertions, 0 deletions
diff --git a/meta-webserver/recipes-httpd/apache2/apache2_2.4.27.bb b/meta-webserver/recipes-httpd/apache2/apache2_2.4.27.bb
new file mode 100644
index 000000000..f053e37f9
--- /dev/null
+++ b/meta-webserver/recipes-httpd/apache2/apache2_2.4.27.bb
@@ -0,0 +1,182 @@
1DESCRIPTION = "The Apache HTTP Server is a powerful, efficient, and \
2extensible web server."
3SUMMARY = "Apache HTTP Server"
4HOMEPAGE = "http://httpd.apache.org/"
5DEPENDS = "libtool-native apache2-native openssl expat pcre apr apr-util"
6SECTION = "net"
7LICENSE = "Apache-2.0"
8
9SRC_URI = "${APACHE_MIRROR}/httpd/httpd-${PV}.tar.bz2 \
10 file://server-makefile.patch \
11 file://httpd-2.4.1-corelimit.patch \
12 file://httpd-2.4.4-export.patch \
13 file://httpd-2.4.1-selinux.patch \
14 file://apache-configure_perlbin.patch \
15 file://replace-lynx-to-curl-in-apachectl-script.patch \
16 file://apache-ssl-ltmain-rpath.patch \
17 file://httpd-2.4.3-fix-race-issue-of-dir-install.patch \
18 file://0001-configure-use-pkg-config-for-PCRE-detection.patch \
19 file://configure-allow-to-disable-selinux-support.patch \
20 file://init \
21 file://apache2-volatile.conf \
22 file://apache2.service \
23 "
24
25LIC_FILES_CHKSUM = "file://LICENSE;md5=dbff5a2b542fa58854455bf1a0b94b83"
26SRC_URI[md5sum] = "97b6bbfa83c866dbe20ef317e3afd108"
27SRC_URI[sha256sum] = "71fcc128238a690515bd8174d5330a5309161ef314a326ae45c7c15ed139c13a"
28
29S = "${WORKDIR}/httpd-${PV}"
30
31inherit autotools update-rc.d pkgconfig systemd
32
33SYSTEMD_SERVICE_${PN} = "apache2.service"
34SYSTEMD_AUTO_ENABLE_${PN} = "disable"
35
36SSTATE_SCAN_FILES += "apxs config_vars.mk config.nice"
37
38CFLAGS_append = " -DPATH_MAX=4096"
39CFLAGS_prepend = "-I${STAGING_INCDIR}/openssl "
40EXTRA_OECONF = "--enable-ssl \
41 --with-ssl=${STAGING_LIBDIR}/.. \
42 --with-expat=${STAGING_LIBDIR}/.. \
43 --with-apr=${STAGING_BINDIR_CROSS}/apr-1-config \
44 --with-apr-util=${STAGING_BINDIR_CROSS}/apu-1-config \
45 --enable-info \
46 --enable-rewrite \
47 --with-dbm=sdbm \
48 --with-berkeley-db=no \
49 --localstatedir=/var/${BPN} \
50 --with-gdbm=no \
51 --with-ndbm=no \
52 --includedir=${includedir}/${BPN} \
53 --datadir=${datadir}/${BPN} \
54 --sysconfdir=${sysconfdir}/${BPN} \
55 --libexecdir=${libdir}/${BPN}/modules \
56 ap_cv_void_ptr_lt_long=no \
57 --enable-mpms-shared \
58 ac_cv_have_threadsafe_pollset=no"
59
60PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}"
61PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux"
62PACKAGECONFIG[openldap] = "--enable-ldap --enable-authnz-ldap,--disable-ldap --disable-authnz-ldap,openldap"
63
64do_install_append() {
65 install -d ${D}/${sysconfdir}/init.d
66 cat ${WORKDIR}/init | \
67 sed -e 's,/usr/sbin/,${sbindir}/,g' \
68 -e 's,/usr/bin/,${bindir}/,g' \
69 -e 's,/usr/lib,${libdir}/,g' \
70 -e 's,/etc/,${sysconfdir}/,g' \
71 -e 's,/usr/,${prefix}/,g' > ${D}/${sysconfdir}/init.d/${BPN}
72 chmod 755 ${D}/${sysconfdir}/init.d/${BPN}
73 # remove the goofy original files...
74 rm -rf ${D}/${sysconfdir}/${BPN}/original
75 # Expat should be found in the staging area via DEPENDS...
76 rm -f ${D}/${libdir}/libexpat.*
77
78 install -d ${D}${sysconfdir}/${BPN}/conf.d
79 install -d ${D}${sysconfdir}/${BPN}/modules.d
80
81 # Ensure configuration file pulls in conf.d and modules.d
82 printf "\nIncludeOptional ${sysconfdir}/${BPN}/conf.d/*.conf" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
83 printf "\nIncludeOptional ${sysconfdir}/${BPN}/modules.d/*.load" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
84 printf "\nIncludeOptional ${sysconfdir}/${BPN}/modules.d/*.conf\n\n" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
85 # match with that is in init script
86 printf "\nPidFile /run/httpd.pid" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
87 # Set 'ServerName' to fix error messages when restart apache service
88 sed -i 's/^#ServerName www.example.com/ServerName localhost/' ${D}/${sysconfdir}/${BPN}/httpd.conf
89
90 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
91 install -d ${D}${sysconfdir}/tmpfiles.d/
92 install -m 0644 ${WORKDIR}/apache2-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
93 fi
94
95 install -d ${D}${systemd_unitdir}/system
96 install -m 0644 ${WORKDIR}/apache2.service ${D}${systemd_unitdir}/system
97 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/apache2.service
98 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/apache2.service
99
100 chown -R root:root ${D}
101}
102
103do_install_append_class-target() {
104 sed -i -e 's,${STAGING_DIR_HOST},,g' \
105 -e 's,APU_INCLUDEDIR = .*,APU_INCLUDEDIR = ,g' \
106 -e 's,APU_CONFIG = .*,APU_CONFIG = ,g' ${D}${datadir}/apache2/build/config_vars.mk
107
108 sed -i -e 's,${STAGING_DIR_HOST},,g' \
109 -e 's,".*/configure","configure",g' ${D}${datadir}/apache2/build/config.nice
110}
111
112SYSROOT_PREPROCESS_FUNCS += "apache_sysroot_preprocess"
113
114apache_sysroot_preprocess () {
115 install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
116 install -m 755 ${D}${bindir}/apxs ${SYSROOT_DESTDIR}${bindir_crossscripts}/
117 install -d ${SYSROOT_DESTDIR}${sbindir}/
118 install -m 755 ${D}${sbindir}/apachectl ${SYSROOT_DESTDIR}${sbindir}/
119 sed -i 's!my $installbuilddir = .*!my $installbuilddir = "${STAGING_DIR_HOST}/${datadir}/${BPN}/build";!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/apxs
120 sed -i 's!my $libtool = .*!my $libtool = "${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool";!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/apxs
121
122 sed -i 's!^APR_CONFIG = .*!APR_CONFIG = ${STAGING_BINDIR_CROSS}/apr-1-config!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
123 sed -i 's!^APU_CONFIG = .*!APU_CONFIG = ${STAGING_BINDIR_CROSS}/apu-1-config!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
124 sed -i 's!^includedir = .*!includedir = ${STAGING_INCDIR}/apache2!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
125 sed -i 's!^CFLAGS = -I[^ ]*!CFLAGS = -I${STAGING_INCDIR}/openssl!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
126 sed -i 's!^EXTRA_LDFLAGS = .*!EXTRA_LDFLAGS = -L${STAGING_LIBDIR}!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
127 sed -i 's!^EXTRA_INCLUDES = .*!EXTRA_INCLUDES = -I$(includedir) -I. -I${STAGING_INCDIR}!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
128 sed -i 's!--sysroot=[^ ]*!--sysroot=${STAGING_DIR_HOST}!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
129}
130
131#
132# implications - used by update-rc.d scripts
133#
134INITSCRIPT_NAME = "apache2"
135INITSCRIPT_PARAMS = "defaults 91 20"
136LEAD_SONAME = "libapr-1.so.0"
137
138PACKAGES = "${PN}-scripts ${PN}-doc ${PN}-dev ${PN}-dbg ${PN}"
139
140CONFFILES_${PN} = "${sysconfdir}/${BPN}/httpd.conf \
141 ${sysconfdir}/${BPN}/magic \
142 ${sysconfdir}/${BPN}/mime.types \
143 ${sysconfdir}/init.d/${BPN} "
144
145# we override here rather than append so that .so links are
146# included in the runtime package rather than here (-dev)
147# and to get build, icons, error into the -dev package
148FILES_${PN}-dev = "${datadir}/${BPN}/build \
149 ${datadir}/${BPN}/icons \
150 ${datadir}/${BPN}/error \
151 ${bindir}/apr-config ${bindir}/apu-config \
152 ${libdir}/apr*.exp \
153 ${includedir}/${BPN} \
154 ${libdir}/*.la \
155 ${libdir}/*.a \
156 ${bindir}/apxs \
157 "
158
159
160# manual to manual
161FILES_${PN}-doc += " ${datadir}/${BPN}/manual"
162
163FILES_${PN}-scripts += "${bindir}/dbmmanage"
164
165#
166# override this too - here is the default, less datadir
167#
168FILES_${PN} = "${bindir} ${sbindir} ${libexecdir} ${libdir}/lib*.so.* ${sysconfdir} \
169 ${sharedstatedir} ${localstatedir} /bin /sbin /lib/*.so* \
170 ${libdir}/${BPN}"
171
172# we want htdocs and cgi-bin to go with the binary
173FILES_${PN} += "${datadir}/${BPN}/htdocs ${datadir}/${BPN}/cgi-bin"
174
175#make sure the lone .so links also get wrapped in the base package
176FILES_${PN} += "${libdir}/lib*.so ${libdir}/pkgconfig/*"
177
178FILES_${PN}-dbg += "${libdir}/${BPN}/modules/.debug"
179
180RDEPENDS_${PN} += "openssl libgcc"
181RDEPENDS_${PN}-scripts += "perl ${PN}"
182RDEPENDS_${PN}-dev = "perl"