You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

219 lines
9.8 KiB

  1. #
  2. # Copyright (C) 2006-2018 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=lighttpd
  9. PKG_VERSION:=1.4.64
  10. PKG_RELEASE:=1
  11. # release candidate ~rcX testing; remove for release
  12. #PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-1.4.64
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  14. PKG_SOURCE_URL:=https://download.lighttpd.net/lighttpd/releases-1.4.x
  15. PKG_HASH:=e1489d9fa7496fbf2e071c338b593b2300d38c23f1e5967e52c9ef482e1b0e26
  16. PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
  17. PKG_LICENSE:=BSD-3-Clause
  18. PKG_LICENSE_FILES:=COPYING
  19. PKG_CPE_ID:=cpe:/a:lighttpd:lighttpd
  20. PKG_INSTALL:=1
  21. PKG_CONFIG_DEPENDS:=CONFIG_LIGHTTPD_SSL $(patsubst %,CONFIG_PACKAGE_lighttpd-mod-%,$(REBUILD_MODULES))
  22. REBUILD_MODULES=authn_gssapi authn_ldap magnet webdav
  23. include $(INCLUDE_DIR)/package.mk
  24. include $(INCLUDE_DIR)/meson.mk
  25. define Package/lighttpd/Default
  26. SECTION:=net
  27. CATEGORY:=Network
  28. SUBMENU:=Web Servers/Proxies
  29. URL:=https://www.lighttpd.net/
  30. endef
  31. define Package/lighttpd
  32. $(call Package/lighttpd/Default)
  33. MENU:=1
  34. DEPENDS:=+libnettle +libpcre2 +libpthread +LIGHTTPD_LOGROTATE:logrotate
  35. TITLE:=A flexible and lightweight web server
  36. endef
  37. define Package/lighttpd/config
  38. config LIGHTTPD_SSL
  39. bool "SSL support"
  40. depends on PACKAGE_lighttpd
  41. default y
  42. help
  43. Implements SSL support in lighttpd (using libopenssl). This
  44. option is enabled by default for backwards compatibility.
  45. Select one TLS module below if you enable the SSL engine in
  46. your lighttpd configuration file.
  47. (mod_gnutls, mod_mbedtls, mod_nss, mod_openssl, mod_wolfssl)
  48. config LIGHTTPD_SSL_DEPENDS
  49. bool
  50. depends on LIGHTTPD_SSL
  51. default PACKAGE_lighttpd-mod-mbedtls || PACKAGE_lighttpd-mod-wolfssl || PACKAGE_lighttpd-mod-gnutls || PACKAGE_lighttpd-mod-nss
  52. config LIGHTTPD_SSL_SELECT
  53. tristate
  54. depends on LIGHTTPD_SSL
  55. default m if !LIGHTTPD_SSL_DEPENDS
  56. select PACKAGE_lighttpd-mod-openssl
  57. config LIGHTTPD_LOGROTATE
  58. bool "Logrotate support"
  59. depends on PACKAGE_lighttpd
  60. default n
  61. help
  62. It adds support for logrotate functionality.
  63. endef
  64. MESON_ARGS += \
  65. -Dwith_brotli=false \
  66. -Dwith_bzip=false \
  67. -Dwith_dbi=$(if $(CONFIG_PACKAGE_lighttpd-mod-authn_dbi)$(CONFIG_PACKAGE_lighttpd-mod-vhostdb_dbi),true,false) \
  68. -Dwith_fam=false \
  69. -Dwith_gnutls=$(if $(CONFIG_PACKAGE_lighttpd-mod-gnutls),true,false) \
  70. -Dwith_krb5=$(if $(CONFIG_PACKAGE_lighttpd-mod-authn_gssapi),true,false) \
  71. -Dwith_ldap=$(if $(CONFIG_PACKAGE_lighttpd-mod-authn_ldap)$(CONFIG_PACKAGE_lighttpd-mod-vhostdb_ldap),true,false) \
  72. -Dwith_libev=false \
  73. -Dwith_libunwind=false \
  74. -Dwith_lua=$(if $(CONFIG_PACKAGE_lighttpd-mod-magnet),true,false) \
  75. -Dwith_maxminddb=$(if $(CONFIG_PACKAGE_lighttpd-mod-maxminddb),true,false) \
  76. -Dwith_mbedtls=$(if $(CONFIG_PACKAGE_lighttpd-mod-mbedtls),true,false) \
  77. -Dwith_mysql=$(if $(CONFIG_PACKAGE_lighttpd-mod-vhostdb_mysql),true,false) \
  78. -Dwith_nettle=true \
  79. -Dwith_nss=$(if $(CONFIG_PACKAGE_lighttpd-mod-nss),true,false) \
  80. -Dwith_openssl=$(if $(CONFIG_PACKAGE_lighttpd-mod-openssl),true,false) \
  81. -Dwith_pam=$(if $(CONFIG_PACKAGE_lighttpd-mod-authn_pam),true,false) \
  82. -Dwith_pcre2=true \
  83. -Dwith_pgsql=$(if $(CONFIG_PACKAGE_lighttpd-mod-vhostdb_pgsql),true,false) \
  84. -Dwith_sasl=$(if $(CONFIG_PACKAGE_lighttpd-mod-authn_sasl),true,false) \
  85. -Dwith_webdav_locks=$(if $(CONFIG_PACKAGE_lighttpd-mod-webdav),true,false) \
  86. -Dwith_webdav_props=$(if $(CONFIG_PACKAGE_lighttpd-mod-webdav),true,false) \
  87. -Dwith_wolfssl=$(if $(CONFIG_PACKAGE_lighttpd-mod-wolfssl),true,false) \
  88. -Dwith_xattr=false \
  89. -Dwith_zlib=$(if $(CONFIG_PACKAGE_lighttpd-mod-deflate),true,false) \
  90. -Dwith_zstd=false
  91. BASE_MODULES:=dirlisting indexfile staticfile
  92. define Package/lighttpd/conffiles
  93. /etc/lighttpd/lighttpd.conf
  94. endef
  95. define Package/lighttpd/install
  96. $(INSTALL_DIR) $(1)/etc/lighttpd
  97. $(INSTALL_DATA) ./files/lighttpd.conf $(1)/etc/lighttpd/
  98. $(INSTALL_DATA) $(PKG_BUILD_DIR)/doc/config/conf.d/mime.conf $(1)/etc/lighttpd/
  99. $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d
  100. $(INSTALL_DIR) $(1)/etc/init.d
  101. $(INSTALL_BIN) ./files/lighttpd.init $(1)/etc/init.d/lighttpd
  102. $(INSTALL_DIR) $(1)/usr/lib/lighttpd
  103. for m in $(BASE_MODULES); do \
  104. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$$$${m}.so $(1)/usr/lib/lighttpd/ ; \
  105. done
  106. $(INSTALL_DIR) $(1)/usr/sbin
  107. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/lighttpd $(1)/usr/sbin/
  108. ifneq ($(strip $(CONFIG_LIGHTTPD_LOGROTATE)),)
  109. $(INSTALL_DIR) $(1)/etc/logrotate.d
  110. $(CP) ./files/lighttpd.logrotate $(1)/etc/logrotate.d/lighttpd.conf
  111. endif
  112. endef
  113. define BuildPlugin
  114. define Package/lighttpd-mod-$(1)
  115. $(call Package/lighttpd/Default)
  116. DEPENDS:=lighttpd
  117. ifneq ($(3),)
  118. DEPENDS+= $(3)
  119. endif
  120. TITLE:=$(2) module
  121. endef
  122. define Package/lighttpd-mod-$(1)/conffiles
  123. /etc/lighttpd/conf.d/$(4)-$(1).conf
  124. endef
  125. ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-$(1)),)
  126. define Package/lighttpd-mod-$(1)/install
  127. $(INSTALL_DIR) $$(1)/usr/lib/lighttpd
  128. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$(1).so $$(1)/usr/lib/lighttpd
  129. $(INSTALL_DIR) $$(1)/etc/lighttpd/conf.d
  130. if [ -f $(PKG_BUILD_DIR)/doc/config/conf.d/$(1).conf ]; then \
  131. $(CP) $(PKG_BUILD_DIR)/doc/config/conf.d/$(1).conf $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \
  132. if ! grep -qF 'mod_$(1)' $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf; then \
  133. sed -i "`sed '/^##/ !q' $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf | wc -l` i\
  134. server.modules += ( \"mod_$(1)\" )" $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \
  135. fi \
  136. else \
  137. echo 'server.modules += ( "mod_$(1)" )' > $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \
  138. fi
  139. endef
  140. endif
  141. $$(eval $$(call BuildPackage,lighttpd-mod-$(1)))
  142. endef
  143. $(eval $(call BuildPackage,lighttpd))
  144. # First, permit redirect from HTTP to HTTPS.
  145. $(eval $(call BuildPlugin,redirect,URL redirection,+PACKAGE_lighttpd-mod-redirect:libpcre2,10))
  146. # Next, permit authentication.
  147. $(eval $(call BuildPlugin,auth,Authentication,+PACKAGE_lighttpd-mod-auth:libnettle,20))
  148. $(eval $(call BuildPlugin,authn_dbi,DBI-based authentication,lighttpd-mod-auth +PACKAGE_lighttpd-mod-authn_dbi:libnettle +PACKAGE_lighttpd-mod-authn_dbi:libdbi,20))
  149. $(eval $(call BuildPlugin,authn_file,File-based authentication,lighttpd-mod-auth +PACKAGE_lighttpd-mod-authn_file:libnettle,20))
  150. $(eval $(call BuildPlugin,authn_gssapi,Kerberos-based authentication,lighttpd-mod-auth +PACKAGE_lighttpd-mod-authn_gssapi:krb5-libs,20))
  151. $(eval $(call BuildPlugin,authn_ldap,LDAP-based authentication,lighttpd-mod-auth +PACKAGE_lighttpd-mod-authn_ldap:libopenldap,20))
  152. $(eval $(call BuildPlugin,authn_pam,PAM-based authentication,lighttpd-mod-auth +PACKAGE_lighttpd-mod-authn_pam:libpam,20))
  153. $(eval $(call BuildPlugin,authn_sasl,SASL-based authentication,lighttpd-mod-auth +PACKAGE_lighttpd-mod-authn_sasl:libsasl2,20))
  154. # Finally, everything else.
  155. $(eval $(call BuildPlugin,access,Access restrictions,,30))
  156. $(eval $(call BuildPlugin,accesslog,Access logging,,30))
  157. $(eval $(call BuildPlugin,ajp13,AJP13 Tomcat connector,,30))
  158. $(eval $(call BuildPlugin,alias,Directory alias,,30))
  159. $(eval $(call BuildPlugin,cgi,CGI,,30))
  160. $(eval $(call BuildPlugin,deflate,Compress dynamic output,+PACKAGE_lighttpd-mod-deflate:zlib,30))
  161. $(eval $(call BuildPlugin,evasive,Evasive,,30))
  162. $(eval $(call BuildPlugin,evhost,Enhanced Virtual-Hosting,,30))
  163. $(eval $(call BuildPlugin,expire,Expire,,30))
  164. $(eval $(call BuildPlugin,extforward,Extract client,,30))
  165. $(eval $(call BuildPlugin,fastcgi,FastCGI,,30))
  166. $(eval $(call BuildPlugin,gnutls,TLS using gnutls,@LIGHTTPD_SSL +PACKAGE_lighttpd-mod-gnutls:libgnutls,30))
  167. $(eval $(call BuildPlugin,magnet,Magnet,+PACKAGE_lighttpd-mod-magnet:liblua,30))
  168. $(eval $(call BuildPlugin,maxminddb,MaxMind DB,+PACKAGE_lighttpd-mod-maxminddb:libmaxminddb,30))
  169. $(eval $(call BuildPlugin,mbedtls,TLS using mbedtls,@LIGHTTPD_SSL +PACKAGE_lighttpd-mod-mbedtls:libmbedtls,30))
  170. $(eval $(call BuildPlugin,nss,TLS using nss,@LIGHTTPD_SSL +PACKAGE_lighttpd-mod-nss:libnss,30))
  171. $(eval $(call BuildPlugin,openssl,TLS using openssl,@LIGHTTPD_SSL +PACKAGE_lighttpd-mod-openssl:libopenssl,30))
  172. $(eval $(call BuildPlugin,proxy,Proxy,,30))
  173. $(eval $(call BuildPlugin,rewrite,URL rewriting,+PACKAGE_lighttpd-mod-rewrite:libpcre2,30))
  174. $(eval $(call BuildPlugin,rrdtool,RRDtool,,30))
  175. $(eval $(call BuildPlugin,scgi,SCGI,,30))
  176. $(eval $(call BuildPlugin,secdownload,Secure and fast download,+PACKAGE_lighttpd-mod-secdownload:libnettle,30))
  177. $(eval $(call BuildPlugin,setenv,Environment variable setting,,30))
  178. $(eval $(call BuildPlugin,simple_vhost,Simple virtual hosting,,30))
  179. $(eval $(call BuildPlugin,sockproxy,sockproxy,,30))
  180. $(eval $(call BuildPlugin,ssi,SSI,,30))
  181. $(eval $(call BuildPlugin,staticfile,staticfile,,30))
  182. $(eval $(call BuildPlugin,status,Server status display,,30))
  183. $(eval $(call BuildPlugin,uploadprogress,Upload Progress,,30))
  184. $(eval $(call BuildPlugin,userdir,User directory,,30))
  185. $(eval $(call BuildPlugin,usertrack,User tracking,+PACKAGE_lighttpd-mod-usertrack:libnettle,30))
  186. $(eval $(call BuildPlugin,vhostdb,Virtual Host Database,,30))
  187. $(eval $(call BuildPlugin,vhostdb_dbi,Virtual Host Database (DBI),lighttpd-mod-vhostdb +PACKAGE_lighttpd-mod-vhostdb_dbi:libdbi,30))
  188. $(eval $(call BuildPlugin,vhostdb_ldap,Virtual Host Database (LDAP),lighttpd-mod-vhostdb +PACKAGE_lighttpd-mod-vhostdb_ldap:libopenldap,30))
  189. $(eval $(call BuildPlugin,vhostdb_mysql,Virtual Host Database (MariaDB),lighttpd-mod-vhostdb +PACKAGE_lighttpd-mod-vhostdb_mysql:libmariadb,30))
  190. $(eval $(call BuildPlugin,vhostdb_pgsql,Virtual Host Database (PostgreSQL),lighttpd-mod-vhostdb +PACKAGE_lighttpd-mod-vhostdb_pgsql:libpq,30))
  191. $(eval $(call BuildPlugin,webdav,WebDAV,+PACKAGE_lighttpd-mod-webdav:libsqlite3 +PACKAGE_lighttpd-mod-webdav:libuuid +PACKAGE_lighttpd-mod-webdav:libxml2,30))
  192. $(eval $(call BuildPlugin,wolfssl,TLS using wolfssl,@LIGHTTPD_SSL +PACKAGE_lighttpd-mod-wolfssl:libwolfssl,30))
  193. $(eval $(call BuildPlugin,wstunnel,Websocket tunneling,+PACKAGE_lighttpd-mod-wstunnel:libnettle,30))