blob: 8cb3a9a18c65b9ef883482146711888525e98764 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Lightweight high-performance web server"
2HOMEPAGE = "http://www.lighttpd.net/"
Andrew Geissler95ac1b82021-03-31 14:34:31 -05003DESCRIPTION = "Lightweight high-performance web server is designed and optimized for high performance environments. With a small memory footprint compared to other web-servers, effective management of the cpu-load, and advanced feature set (FastCGI, SCGI, Auth, Output-Compression, URL-Rewriting and many more)"
Andrew Geissler82c905d2020-04-13 13:39:40 -05004BUGTRACKER = "http://redmine.lighttpd.net/projects/lighttpd/issues"
5
6LICENSE = "BSD-3-Clause"
7LIC_FILES_CHKSUM = "file://COPYING;md5=e4dac5c6ab169aa212feb5028853a579"
8
9SECTION = "net"
Patrick Williams213cb262021-08-07 19:21:33 -050010RDEPENDS:${PN} = "lighttpd-module-dirlisting \
Andrew Geissler82c905d2020-04-13 13:39:40 -050011 lighttpd-module-indexfile \
12 lighttpd-module-staticfile"
Patrick Williams213cb262021-08-07 19:21:33 -050013RRECOMMENDS:${PN} = "lighttpd-module-access \
Andrew Geissler82c905d2020-04-13 13:39:40 -050014 lighttpd-module-accesslog"
15
16SRC_URI = "http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${PV}.tar.xz \
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050017 file://index.html.lighttpd \
18 file://lighttpd.conf \
19 file://lighttpd \
20 file://0001-Use-pkg-config-for-pcre-dependency-instead-of-config.patch \
21 file://0001-meson-add-with_zstd-to-meson_options.txt.patch \
22 "
Andrew Geissler82c905d2020-04-13 13:39:40 -050023
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060024SRC_URI[sha256sum] = "fb953db273daef08edb6e202556cae8a3d07eed6081c96bd9903db957d1084d5"
Andrew Geissler82c905d2020-04-13 13:39:40 -050025
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050026DEPENDS = "virtual/crypt"
27
Andrew Geissler82c905d2020-04-13 13:39:40 -050028PACKAGECONFIG ??= "openssl pcre zlib \
Andrew Geissler82c905d2020-04-13 13:39:40 -050029 ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
30"
31
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050032PACKAGECONFIG[libev] = "-Dwith_libev=true,-Dwith_libev=false,libev"
33PACKAGECONFIG[mysql] = "-Dwith_mysql=true,-Dwith_mysql=false,mariadb"
34PACKAGECONFIG[ldap] = "-Dwith_ldap=true,-Dwith_ldap=false,openldap"
35PACKAGECONFIG[attr] = "-Dwith_xattr=true,-Dwith_xattr=false,attr"
36PACKAGECONFIG[openssl] = "-Dwith_openssl=true,-Dwith_openssl=false,openssl"
37PACKAGECONFIG[krb5] = "-Dwith_krb5=true,-Dwith_krb5=false,krb5"
38PACKAGECONFIG[pcre] = "-Dwith_pcre=true,-Dwith_pcre=false,libpcre"
39PACKAGECONFIG[zlib] = "-Dwith_zlib=true,-Dwith_zlib=false,zlib"
40PACKAGECONFIG[bzip2] = "-Dwith_bzip=true,-Dwith_bzip=false,bzip2"
41PACKAGECONFIG[webdav-props] = "-Dwith_webdav_props=true,-Dwith_webdav_props=false,libxml2 sqlite3"
42PACKAGECONFIG[webdav-locks] = "-Dwith_webdav_locks=true,-Dwith_webdav_locks=false,util-linux"
43PACKAGECONFIG[gdbm] = "-Dwith_gdbm=true,-Dwith_gdbm=false,gdbm"
44PACKAGECONFIG[memcache] = "-Dwith_memcached=true,-Dwith_memcached=false,libmemcached"
45PACKAGECONFIG[lua] = "-Dwith_lua=true,-Dwith_lua=false,lua"
46PACKAGECONFIG[zstd] = "-Dwith_zstd=true,-Dwith_zstd=false,zstd"
Andrew Geissler82c905d2020-04-13 13:39:40 -050047
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050048inherit meson pkgconfig update-rc.d gettext systemd
Andrew Geissler82c905d2020-04-13 13:39:40 -050049
50INITSCRIPT_NAME = "lighttpd"
51INITSCRIPT_PARAMS = "defaults 70"
52
Patrick Williams213cb262021-08-07 19:21:33 -050053SYSTEMD_SERVICE:${PN} = "lighttpd.service"
Andrew Geissler82c905d2020-04-13 13:39:40 -050054
Patrick Williams213cb262021-08-07 19:21:33 -050055do_install:append() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050056 install -d ${D}${sysconfdir}/init.d ${D}${sysconfdir}/lighttpd ${D}${sysconfdir}/lighttpd.d ${D}/www/pages/dav
57 install -m 0755 ${WORKDIR}/lighttpd ${D}${sysconfdir}/init.d
58 install -m 0644 ${WORKDIR}/lighttpd.conf ${D}${sysconfdir}/lighttpd
59 install -m 0644 ${WORKDIR}/index.html.lighttpd ${D}/www/pages/index.html
60
Andrew Geissler5199d832021-09-24 16:47:35 -050061 install -d ${D}${systemd_system_unitdir}
62 install -m 0644 ${S}/doc/systemd/lighttpd.service ${D}${systemd_system_unitdir}
Andrew Geissler82c905d2020-04-13 13:39:40 -050063 sed -i -e 's,@SBINDIR@,${sbindir},g' \
64 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
65 -e 's,@BASE_BINDIR@,${base_bindir},g' \
Andrew Geissler5199d832021-09-24 16:47:35 -050066 ${D}${systemd_system_unitdir}/lighttpd.service
Andrew Geissler82c905d2020-04-13 13:39:40 -050067 #For FHS compliance, create symbolic links to /var/log and /var/tmp for logs and temporary data
68 ln -sf ${localstatedir}/log ${D}/www/logs
69 ln -sf ${localstatedir}/tmp ${D}/www/var
70}
71
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050072# bitbake.conf sets ${libdir}/${BPN}/* in FILES, which messes up the module split.
73# So we re-do the variable.
74FILES:${PN} = "${sysconfdir} /www ${sbindir}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050075
Patrick Williams213cb262021-08-07 19:21:33 -050076CONFFILES:${PN} = "${sysconfdir}/lighttpd/lighttpd.conf"
Andrew Geissler82c905d2020-04-13 13:39:40 -050077
78PACKAGES_DYNAMIC += "^lighttpd-module-.*"
79
Patrick Williams213cb262021-08-07 19:21:33 -050080python populate_packages:prepend () {
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050081 lighttpd_libdir = d.expand('${prefix}/lib/lighttpd')
Andrew Geissler82c905d2020-04-13 13:39:40 -050082 do_split_packages(d, lighttpd_libdir, r'^mod_(.*)\.so$', 'lighttpd-module-%s', 'Lighttpd module for %s', extra_depends='')
83}