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.

214 lines
6.2 KiB

  1. #
  2. # Copyright (C) 2012-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:=nginx
  9. PKG_VERSION:=1.9.6
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://nginx.org/download/
  13. PKG_MD5SUM:=f6899825e7a8deadba4948ff84515ad6
  14. PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
  15. PKG_LICENSE:=2-clause BSD-like license
  16. PKG_BUILD_DIR:=$(BUILD_DIR)/nginx-$(PKG_VERSION)
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_INSTALL:=1
  19. PKG_CONFIG_DEPENDS := \
  20. CONFIG_NGINX_SSL \
  21. CONFIG_NGINX_DAV \
  22. CONFIG_NGINX_FLV \
  23. CONFIG_NGINX_STUB_STATUS \
  24. CONFIG_NGINX_HTTP_CHARSET \
  25. CONFIG_NGINX_HTTP_GZIP \
  26. CONFIG_NGINX_HTTP_SSI \
  27. CONFIG_NGINX_HTTP_USERID \
  28. CONFIG_NGINX_HTTP_ACCESS \
  29. CONFIG_NGINX_HTTP_AUTH_BASIC \
  30. CONFIG_NGINX_HTTP_AUTOINDEX \
  31. CONFIG_NGINX_HTTP_GEO \
  32. CONFIG_NGINX_HTTP_MAP \
  33. CONFIG_NGINX_HTTP_SPLIT_CLIENTS \
  34. CONFIG_NGINX_HTTP_REFERER \
  35. CONFIG_NGINX_HTTP_REWRITE \
  36. CONFIG_NGINX_HTTP_PROXY \
  37. CONFIG_NGINX_HTTP_FASTCGI \
  38. CONFIG_NGINX_HTTP_UWSGI \
  39. CONFIG_NGINX_HTTP_SCGI \
  40. CONFIG_NGINX_HTTP_MEMCACHED \
  41. CONFIG_NGINX_HTTP_LIMIT_CONN \
  42. CONFIG_NGINX_HTTP_LIMIT_REQ \
  43. CONFIG_NGINX_HTTP_EMPTY_GIF \
  44. CONFIG_NGINX_HTTP_BROWSER \
  45. CONFIG_NGINX_HTTP_UPSTREAM_HASH \
  46. CONFIG_NGINX_HTTP_UPSTREAM_IP_HASH \
  47. CONFIG_NGINX_HTTP_UPSTREAM_LEAST_CONN \
  48. CONFIG_NGINX_HTTP_UPSTREAM_KEEPALIVE \
  49. CONFIG_NGINX_HTTP_UPSTREAM_ZONE \
  50. CONFIG_NGINX_HTTP_CACHE \
  51. CONFIG_NGINX_PCRE
  52. include $(INCLUDE_DIR)/package.mk
  53. define Package/nginx
  54. SECTION:=net
  55. CATEGORY:=Network
  56. SUBMENU:=Web Servers/Proxies
  57. TITLE:=Nginx web server
  58. URL:=http://nginx.org/
  59. DEPENDS:=+NGINX_PCRE:libpcre +(NGINX_SSL||NGINX_HTTP_CACHE||NGINX_HTTP_AUTH_BASIC):libopenssl +NGINX_HTTP_GZIP:zlib +libpthread
  60. MENU:=1
  61. endef
  62. define Package/nginx/description
  63. nginx is an HTTP and reverse proxy server, as well as a mail proxy server,
  64. written by Igor Sysoev.
  65. endef
  66. define Package/nginx/config
  67. source "$(SOURCE)/Config.in"
  68. endef
  69. config_files=nginx.conf mime.types fastcgi_params koi-utf koi-win win-utf
  70. define Package/nginx/conffiles
  71. /etc/nginx/
  72. endef
  73. ADDITIONAL_MODULES:=
  74. ifeq ($(CONFIG_IPV6),y)
  75. ADDITIONAL_MODULES += --with-ipv6
  76. endif
  77. ifeq ($(CONFIG_NGINX_STUB_STATUS),y)
  78. ADDITIONAL_MODULES += --with-http_stub_status_module
  79. endif
  80. ifeq ($(CONFIG_NGINX_FLV),y)
  81. ADDITIONAL_MODULES += --with-http_flv_module
  82. endif
  83. ifeq ($(CONFIG_NGINX_SSL),y)
  84. ADDITIONAL_MODULES += --with-http_ssl_module
  85. endif
  86. ifeq ($(CONFIG_NGINX_DAV),y)
  87. ADDITIONAL_MODULES += --with-http_dav_module
  88. endif
  89. ifneq ($(CONFIG_NGINX_HTTP_CACHE),y)
  90. ADDITIONAL_MODULES += --without-http-cache
  91. endif
  92. ifneq ($(CONFIG_NGINX_PCRE),y)
  93. ADDITIONAL_MODULES += --without-pcre
  94. endif
  95. ifneq ($(CONFIG_NGINX_HTTP_CHARSET),y)
  96. ADDITIONAL_MODULES += --without-http_charset_module
  97. endif
  98. ifneq ($(CONFIG_NGINX_HTTP_GZIP),y)
  99. ADDITIONAL_MODULES += --without-http_gzip_module
  100. endif
  101. ifneq ($(CONFIG_NGINX_HTTP_SSI),y)
  102. ADDITIONAL_MODULES += --without-http_ssi_module
  103. endif
  104. ifneq ($(CONFIG_NGINX_HTTP_USERID),y)
  105. ADDITIONAL_MODULES += --without-http_userid_module
  106. endif
  107. ifneq ($(CONFIG_NGINX_HTTP_ACCESS),y)
  108. ADDITIONAL_MODULES += --without-http_access_module
  109. endif
  110. ifneq ($(CONFIG_NGINX_HTTP_AUTH_BASIC),y)
  111. ADDITIONAL_MODULES += --without-http_auth_basic_module
  112. endif
  113. ifneq ($(CONFIG_NGINX_HTTP_AUTOINDEX),y)
  114. ADDITIONAL_MODULES += --without-http_autoindex_module
  115. endif
  116. ifneq ($(CONFIG_NGINX_HTTP_GEO),y)
  117. ADDITIONAL_MODULES += --without-http_geo_module
  118. endif
  119. ifneq ($(CONFIG_NGINX_HTTP_MAP),y)
  120. ADDITIONAL_MODULES += --without-http_map_module
  121. endif
  122. ifneq ($(CONFIG_NGINX_HTTP_SPLIT_CLIENTS),y)
  123. ADDITIONAL_MODULES += --without-http_split_clients_module
  124. endif
  125. ifneq ($(CONFIG_NGINX_HTTP_REFERER),y)
  126. ADDITIONAL_MODULES += --without-http_referer_module
  127. endif
  128. ifneq ($(CONFIG_NGINX_HTTP_REWRITE),y)
  129. ADDITIONAL_MODULES += --without-http_rewrite_module
  130. endif
  131. ifneq ($(CONFIG_NGINX_HTTP_PROXY),y)
  132. ADDITIONAL_MODULES += --without-http_proxy_module
  133. endif
  134. ifneq ($(CONFIG_NGINX_HTTP_FASTCGI),y)
  135. ADDITIONAL_MODULES += --without-http_fastcgi_module
  136. endif
  137. ifneq ($(CONFIG_NGINX_HTTP_UWSGI),y)
  138. ADDITIONAL_MODULES += --without-http_uwsgi_module
  139. endif
  140. ifneq ($(CONFIG_NGINX_HTTP_SCGI),y)
  141. ADDITIONAL_MODULES += --without-http_scgi_module
  142. endif
  143. ifneq ($(CONFIG_NGINX_HTTP_MEMCACHED),y)
  144. ADDITIONAL_MODULES += --without-http_memcached_module
  145. endif
  146. ifneq ($(CONFIG_NGINX_HTTP_LIMIT_CONN),y)
  147. ADDITIONAL_MODULES += --without-http_limit_conn_module
  148. endif
  149. ifneq ($(CONFIG_NGINX_HTTP_LIMIT_REQ),y)
  150. ADDITIONAL_MODULES += --without-http_limit_req_module
  151. endif
  152. ifneq ($(CONFIG_NGINX_HTTP_EMPTY_GIF),y)
  153. ADDITIONAL_MODULES += --without-http_empty_gif_module
  154. endif
  155. ifneq ($(CONFIG_NGINX_HTTP_BROWSER),y)
  156. ADDITIONAL_MODULES += --without-http_browser_module
  157. endif
  158. ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_HASH),y)
  159. ADDITIONAL_MODULES += --without-http_upstream_hash_module
  160. endif
  161. ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_IP_HASH),y)
  162. ADDITIONAL_MODULES += --without-http_upstream_ip_hash_module
  163. endif
  164. ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_LEAST_CONN),y)
  165. ADDITIONAL_MODULES += --without-http_upstream_least_conn_module
  166. endif
  167. ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_KEEPALIVE),y)
  168. ADDITIONAL_MODULES += --without-http_upstream_keepalive_module
  169. endif
  170. define Build/Configure
  171. ( cd $(PKG_BUILD_DIR) ; \
  172. ./configure \
  173. --crossbuild=Linux::$(ARCH) \
  174. --prefix=/usr \
  175. --conf-path=/etc/nginx/nginx.conf \
  176. $(ADDITIONAL_MODULES) \
  177. --error-log-path=/var/log/nginx/error.log \
  178. --pid-path=/var/run/nginx.pid \
  179. --lock-path=/var/lock/nginx.lock \
  180. --http-log-path=/var/log/nginx/access.log \
  181. --http-client-body-temp-path=/var/lib/nginx/body \
  182. --http-proxy-temp-path=/var/lib/nginx/proxy \
  183. --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
  184. --with-cc="$(TARGET_CC)" \
  185. --with-cc-opt="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
  186. --with-ld-opt="$(TARGET_LDFLAGS)" \
  187. --without-http_upstream_zone_module \
  188. )
  189. endef
  190. define Package/nginx/install
  191. $(INSTALL_DIR) $(1)/usr/sbin
  192. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nginx $(1)/usr/sbin/
  193. $(INSTALL_DIR) $(1)/etc/nginx
  194. $(INSTALL_DATA) $(addprefix $(PKG_INSTALL_DIR)/etc/nginx/,$(config_files)) $(1)/etc/nginx/
  195. $(INSTALL_DIR) $(1)/etc/init.d
  196. $(INSTALL_BIN) ./files/nginx.init $(1)/etc/init.d/nginx
  197. endef
  198. $(eval $(call BuildPackage,nginx))