Makefile 6.0 KB

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