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.

238 lines
7.9 KiB

  1. #
  2. # Copyright (C) 2006-2015 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.48
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=https://download.lighttpd.net/lighttpd/releases-1.4.x
  13. PKG_HASH:=0f8ad5aac7529d7b948b9d7e8cd0b4a9e177309d85d6bf6516e28e6e40d74f36
  14. PKG_LICENSE:=BSD-3c
  15. PKG_LICENSE_FILES:=COPYING
  16. PKG_FIXUP:=autoreconf
  17. PKG_INSTALL:=1
  18. PKG_CONFIG_DEPENDS:=CONFIG_LIGHTTPD_SSL
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/lighttpd/Default
  21. SUBMENU:=Web Servers/Proxies
  22. SECTION:=net
  23. CATEGORY:=Network
  24. URL:=http://www.lighttpd.net/
  25. MAINTAINER:=W. Michael Petullo <mike@flyn.org>
  26. endef
  27. define Package/lighttpd
  28. $(call Package/lighttpd/Default)
  29. MENU:=1
  30. DEPENDS:=+LIGHTTPD_SSL:libopenssl +libpcre +libpthread
  31. TITLE:=A flexible and lightweight web server
  32. endef
  33. define Package/lighttpd/config
  34. config LIGHTTPD_SSL
  35. bool "SSL support"
  36. depends on PACKAGE_lighttpd
  37. default y
  38. help
  39. Implements SSL support in lighttpd (using libopenssl). This
  40. option is required if you enable the SSL engine in your
  41. lighttpd confguration file.
  42. endef
  43. BASE_MODULES:=dirlisting indexfile staticfile
  44. CONFIGURE_ARGS+= \
  45. --libdir=/usr/lib/lighttpd \
  46. --sysconfdir=/etc/lighttpd \
  47. --enable-shared \
  48. --enable-static \
  49. --disable-rpath \
  50. --without-attr \
  51. --without-bzip2 \
  52. --without-fam \
  53. --with-pcre \
  54. --without-valgrind \
  55. $(call autoconf_bool,CONFIG_IPV6,ipv6)
  56. CONFIGURE_VARS+= \
  57. PCRE_LIB="-lpcre" \
  58. ifneq ($(strip $(CONFIG_LIGHTTPD_SSL)),)
  59. CONFIGURE_ARGS+= \
  60. --with-openssl="$(STAGING_DIR)/usr"
  61. BASE_MODULES+= openssl
  62. else
  63. CONFIGURE_ARGS+= \
  64. --without-openssl
  65. endif
  66. ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-authn_gssapi),)
  67. CONFIGURE_ARGS+= --with-krb5
  68. else
  69. CONFIGURE_ARGS+= --without-krb5
  70. endif
  71. ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-authn_ldap),)
  72. CONFIGURE_ARGS+= --with-ldap
  73. else
  74. CONFIGURE_ARGS+= --without-ldap
  75. endif
  76. ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-authn_mysql),)
  77. CONFIGURE_ARGS+= --with-mysql
  78. else
  79. CONFIGURE_ARGS+= --without-mysql
  80. endif
  81. #ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-geoip),)
  82. # CONFIGURE_ARGS+= --with-geoip
  83. #else
  84. # CONFIGURE_ARGS+= --without-geoip
  85. #endif
  86. ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-cml)$(CONFIG_PACKAGE_lighttpd-mod-magnet),)
  87. CONFIGURE_ARGS+= --with-lua
  88. else
  89. CONFIGURE_ARGS+= --without-lua
  90. endif
  91. ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-mysql_vhost),)
  92. CONFIGURE_ARGS+= --with-mysql
  93. else
  94. CONFIGURE_ARGS+= --without-mysql
  95. endif
  96. #ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-cml)$(CONFIG_PACKAGE_lighttpd-mod-trigger_b4_dl),)
  97. # CONFIGURE_ARGS+= --with-memcached
  98. #else
  99. # CONFIGURE_ARGS+= --without-memcached
  100. #endif
  101. ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-trigger_b4_dl),)
  102. CONFIGURE_ARGS+= --with-gdbm
  103. else
  104. CONFIGURE_ARGS+= --without-gdbm
  105. endif
  106. ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-webdav),)
  107. CONFIGURE_ARGS+= \
  108. --with-webdav-locks \
  109. --with-webdav-props
  110. # XXX: needed by sqlite3 to prevent segfaults in mod_webdav.so
  111. CONFIGURE_VARS+= \
  112. LIBS="-lpthread"
  113. else
  114. CONFIGURE_ARGS+= \
  115. --without-webdav-locks \
  116. --without-webdav-props
  117. endif
  118. define Build/Configure
  119. $(call Build/Configure/Default)
  120. # XXX: override pcre (mis)detection by ./configure when cross-compiling
  121. echo "#define HAVE_LIBPCRE 1" >>$(PKG_BUILD_DIR)/config.h
  122. echo "#define HAVE_PCRE_H 1" >>$(PKG_BUILD_DIR)/config.h
  123. endef
  124. define Package/lighttpd/conffiles
  125. /etc/lighttpd/lighttpd.conf
  126. endef
  127. define Package/lighttpd/install
  128. $(INSTALL_DIR) $(1)/etc/lighttpd
  129. $(INSTALL_DATA) ./files/lighttpd.conf $(1)/etc/lighttpd/
  130. $(INSTALL_DATA) $(PKG_BUILD_DIR)/doc/config/conf.d/mime.conf $(1)/etc/lighttpd/
  131. $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d
  132. $(INSTALL_DIR) $(1)/etc/init.d
  133. $(INSTALL_BIN) ./files/lighttpd.init $(1)/etc/init.d/lighttpd
  134. $(INSTALL_DIR) $(1)/usr/lib/lighttpd
  135. for m in $(BASE_MODULES); do \
  136. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$$$${m}.so $(1)/usr/lib/lighttpd/ ; \
  137. done
  138. $(INSTALL_DIR) $(1)/usr/sbin
  139. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/lighttpd $(1)/usr/sbin/
  140. endef
  141. define BuildPlugin
  142. define Package/lighttpd-mod-$(1)
  143. $(call Package/lighttpd/Default)
  144. DEPENDS:=lighttpd
  145. ifneq ($(3),)
  146. DEPENDS+= $(3)
  147. endif
  148. TITLE:=$(2) module
  149. endef
  150. ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-$(1)),)
  151. define Package/lighttpd-mod-$(1)/install
  152. $(INSTALL_DIR) $$(1)/usr/lib/lighttpd
  153. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$(1).so $$(1)/usr/lib/lighttpd
  154. $(INSTALL_DIR) $$(1)/etc/lighttpd/conf.d
  155. if [ -f $(PKG_BUILD_DIR)/doc/config/conf.d/$(1).conf ]; then \
  156. $(CP) $(PKG_BUILD_DIR)/doc/config/conf.d/$(1).conf $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \
  157. else \
  158. echo 'server.modules += ( "mod_$(1)" )' > $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \
  159. fi
  160. endef
  161. endif
  162. $$(eval $$(call BuildPackage,lighttpd-mod-$(1)))
  163. endef
  164. $(eval $(call BuildPackage,lighttpd))
  165. # First, permit redirect from HTTP to HTTPS.
  166. $(eval $(call BuildPlugin,redirect,URL redirection,+PACKAGE_lighttpd-mod-redirect:libpcre,10))
  167. # Next, permit authentication.
  168. $(eval $(call BuildPlugin,auth,Authentication,,20))
  169. $(eval $(call BuildPlugin,authn_file,File-based authentication,,20))
  170. $(eval $(call BuildPlugin,authn_gssapi,Kerberos-based authentication,+PACKAGE_lighttpd-mod-authn_gssapi:krb5-libs,20))
  171. $(eval $(call BuildPlugin,authn_ldap,LDAP-based authentication,+PACKAGE_lighttpd-mod-authn_ldap:libopenldap,20))
  172. $(eval $(call BuildPlugin,authn_mysql,Mysql-based authentication,+PACKAGE_lighttpd-mod-authn_mysql:libmysqlclient,20))
  173. # Finally, everything else.
  174. $(eval $(call BuildPlugin,access,Access restrictions,,30))
  175. $(eval $(call BuildPlugin,accesslog,Access logging,,30))
  176. $(eval $(call BuildPlugin,alias,Directory alias,,30))
  177. $(eval $(call BuildPlugin,cgi,CGI,,30))
  178. #$(eval $(call BuildPlugin,cml,Cache Meta Language,+PACKAGE_lighttpd-mod-cml:liblua +PACKAGE_lighttpd-mod-cml:libmemcached,30))
  179. $(eval $(call BuildPlugin,cml,Cache Meta Language,+PACKAGE_lighttpd-mod-cml:liblua,30))
  180. $(eval $(call BuildPlugin,compress,Compress output,+PACKAGE_lighttpd-mod-compress:zlib,30))
  181. $(eval $(call BuildPlugin,deflate,Compress dynamic output,+PACKAGE_lighttpd-mod-deflate:zlib,30))
  182. $(eval $(call BuildPlugin,evasive,Evasive,,30))
  183. $(eval $(call BuildPlugin,evhost,Enhanced Virtual-Hosting,,30))
  184. $(eval $(call BuildPlugin,expire,Expire,,30))
  185. $(eval $(call BuildPlugin,extforward,Extract client,,30))
  186. $(eval $(call BuildPlugin,fastcgi,FastCGI,,30))
  187. $(eval $(call BuildPlugin,flv_streaming,FLV streaming,,30))
  188. #$(eval $(call BuildPlugin,geoip,Geolocation,+PACKAGE_lighttpd-mod-geoip:libgeoip,30))
  189. $(eval $(call BuildPlugin,magnet,Magnet,+PACKAGE_lighttpd-mod-magnet:liblua,30))
  190. $(eval $(call BuildPlugin,mysql_vhost,Mysql virtual hosting,+PACKAGE_lighttpd-mod-mysql_vhost:libmysqlclient,30))
  191. $(eval $(call BuildPlugin,proxy,Proxy,,30))
  192. $(eval $(call BuildPlugin,rewrite,URL rewriting,+PACKAGE_lighttpd-mod-rewrite:libpcre,30))
  193. $(eval $(call BuildPlugin,rrdtool,RRDtool,,30))
  194. $(eval $(call BuildPlugin,scgi,SCGI,,30))
  195. $(eval $(call BuildPlugin,secdownload,Secure and fast download,,30))
  196. $(eval $(call BuildPlugin,setenv,Environment variable setting,,30))
  197. $(eval $(call BuildPlugin,simple_vhost,Simple virtual hosting,,30))
  198. $(eval $(call BuildPlugin,ssi,SSI,+PACKAGE_lighttpd-mod-ssi:libpcre,30))
  199. $(eval $(call BuildPlugin,status,Server status display,,30))
  200. #$(eval $(call BuildPlugin,trigger_b4_dl,Trigger before download,+PACKAGE_lighttpd-mod-trigger_b4_dl:libpcre +PACKAGE_lighttpd-mod-trigger_b4_dl:libgdbm +PACKAGE_lighttpd-mod-trigger_b4_dl:libmemcached,30))
  201. $(eval $(call BuildPlugin,trigger_b4_dl,Trigger before download,+PACKAGE_lighttpd-mod-trigger_b4_dl:libpcre +PACKAGE_lighttpd-mod-trigger_b4_dl:libgdbm,30))
  202. $(eval $(call BuildPlugin,userdir,User directory,,30))
  203. $(eval $(call BuildPlugin,usertrack,User tracking,,30))
  204. $(eval $(call BuildPlugin,webdav,WebDAV,+PACKAGE_lighttpd-mod-webdav:libsqlite3 +PACKAGE_lighttpd-mod-webdav:libuuid +PACKAGE_lighttpd-mod-webdav:libxml2,30))