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.

188 lines
5.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:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=http://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. --without-gdbm \
  52. --without-ldap \
  53. --with-lua \
  54. --without-memcache \
  55. --with-pcre \
  56. --without-valgrind \
  57. $(call autoconf_bool,CONFIG_IPV6,ipv6)
  58. CONFIGURE_VARS+= \
  59. PCRE_LIB="-lpcre" \
  60. ifneq ($(strip $(CONFIG_LIGHTTPD_SSL)),)
  61. CONFIGURE_ARGS+= \
  62. --with-openssl="$(STAGING_DIR)/usr"
  63. else
  64. CONFIGURE_ARGS+= \
  65. --without-openssl
  66. endif
  67. ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-mysql-vhost),)
  68. CONFIGURE_ARGS+= \
  69. --with-mysql
  70. else
  71. CONFIGURE_ARGS+= \
  72. --without-mysql
  73. endif
  74. ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-webdav),)
  75. CONFIGURE_ARGS+= \
  76. --with-webdav-locks \
  77. --with-webdav-props
  78. # XXX: needed by sqlite3 to prevent segfaults in mod_webdav.so
  79. CONFIGURE_VARS+= \
  80. LIBS="-lpthread"
  81. else
  82. CONFIGURE_ARGS+= \
  83. --without-webdav-locks \
  84. --without-webdav-props
  85. endif
  86. define Build/Configure
  87. $(call Build/Configure/Default)
  88. # XXX: override pcre (mis)detection by ./configure when cross-compiling
  89. echo "#define HAVE_LIBPCRE 1" >>$(PKG_BUILD_DIR)/config.h
  90. echo "#define HAVE_PCRE_H 1" >>$(PKG_BUILD_DIR)/config.h
  91. endef
  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 dirlisting indexfile staticfile; 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. endef
  109. define BuildPlugin
  110. define Package/lighttpd-mod-$(1)
  111. $(call Package/lighttpd/Default)
  112. DEPENDS:=lighttpd
  113. ifneq ($(3),)
  114. DEPENDS+= $(3)
  115. endif
  116. TITLE:=$(2) module
  117. endef
  118. define Package/lighttpd-mod-$(1)/install
  119. $(INSTALL_DIR) $$(1)/usr/lib/lighttpd
  120. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$(1).so $$(1)/usr/lib/lighttpd
  121. $(INSTALL_DIR) $$(1)/etc/lighttpd/conf.d
  122. if [ -f $(PKG_BUILD_DIR)/doc/config/conf.d/$(1).conf ]; then \
  123. $(CP) $(PKG_BUILD_DIR)/doc/config/conf.d/$(1).conf $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \
  124. else \
  125. echo 'server.modules += ( "mod_$(1)" )' > $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \
  126. fi
  127. endef
  128. $$(eval $$(call BuildPackage,lighttpd-mod-$(1)))
  129. endef
  130. $(eval $(call BuildPackage,lighttpd))
  131. # First, permit redirect from HTTP to HTTPS.
  132. $(eval $(call BuildPlugin,redirect,URL redirection,+PACKAGE_lighttpd-mod-redirect:libpcre,10))
  133. # Next, permit authentication.
  134. $(eval $(call BuildPlugin,auth,Authentication,,20))
  135. $(eval $(call BuildPlugin,authn_file,File-based authentication,,20))
  136. # Finally, everything else.
  137. $(eval $(call BuildPlugin,access,Access restrictions,,30))
  138. $(eval $(call BuildPlugin,accesslog,Access logging,,30))
  139. $(eval $(call BuildPlugin,alias,Directory alias,,30))
  140. $(eval $(call BuildPlugin,cgi,CGI,,30))
  141. $(eval $(call BuildPlugin,cml,Cache Meta Language,+liblua,30))
  142. $(eval $(call BuildPlugin,compress,Compress output,+PACKAGE_lighttpd-mod-compress:zlib,30))
  143. $(eval $(call BuildPlugin,evasive,Evasive,,30))
  144. $(eval $(call BuildPlugin,evhost,Exnhanced Virtual-Hosting,,30))
  145. $(eval $(call BuildPlugin,expire,Expire,,30))
  146. $(eval $(call BuildPlugin,extforward,Extract client,,30))
  147. $(eval $(call BuildPlugin,fastcgi,FastCGI,,30))
  148. $(eval $(call BuildPlugin,flv_streaming,FLV streaming,,30))
  149. $(eval $(call BuildPlugin,magnet,Magnet,+liblua,30))
  150. $(eval $(call BuildPlugin,mysql_vhost,Mysql virtual hosting,+PACKAGE_lighttpd-mod-mysql_vhost:libmysqlclient,30))
  151. $(eval $(call BuildPlugin,proxy,Proxy,,30))
  152. $(eval $(call BuildPlugin,rewrite,URL rewriting,+PACKAGE_lighttpd-mod-rewrite:libpcre,30))
  153. $(eval $(call BuildPlugin,rrdtool,RRDtool,,30))
  154. $(eval $(call BuildPlugin,scgi,SCGI,,30))
  155. $(eval $(call BuildPlugin,secdownload,Secure and fast download,,30))
  156. $(eval $(call BuildPlugin,setenv,Environment variable setting,,30))
  157. $(eval $(call BuildPlugin,simple_vhost,Simple virtual hosting,,30))
  158. $(eval $(call BuildPlugin,ssi,SSI,+libpcre,30))
  159. $(eval $(call BuildPlugin,status,Server status display,,30))
  160. $(eval $(call BuildPlugin,trigger_b4_dl,Trigger before download,+PACKAGE_lighttpd-mod-trigger_b4_dl:libpcre,30))
  161. $(eval $(call BuildPlugin,userdir,User directory,,30))
  162. $(eval $(call BuildPlugin,usertrack,User tracking,,30))
  163. $(eval $(call BuildPlugin,webdav,WebDAV,+PACKAGE_lighttpd-mod-webdav:libsqlite3 +PACKAGE_lighttpd-mod-webdav:libuuid +PACKAGE_lighttpd-mod-webdav:libxml2,30))