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.

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