2 # Copyright (C) 2009-2012 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://nginx.org/download/
16 PKG_MD5SUM:=53105bbe3ac9319db54d9eb46119695b
21 PKG_CONFIG_DEPENDS := \
22 CONFIG_NGINX_STUB_STATUS \
27 include $(INCLUDE_DIR)/package.mk
32 SUBMENU:=Web Servers/Proxies
33 TITLE:=Nginx web server
34 URL:=http://nginx.org/
35 DEPENDS:=+libpcre +libopenssl +zlib +libpthread
39 define Package/nginx/description
40 nginx is an HTTP and reverse proxy server, as well as a mail proxy server,
41 written by Igor Sysoev.
44 define Package/nginx/config
45 source "$(SOURCE)/Config.in"
48 config_files=nginx.conf mime.types fastcgi_params koi-utf koi-win win-utf
50 define Package/nginx/conffiles
56 ifeq ($(CONFIG_IPV6),y)
57 ADDITIONAL_MODULES += --with-ipv6
59 ifeq ($(CONFIG_NGINX_STUB_STATUS),y)
60 ADDITIONAL_MODULES += --with-http_stub_status_module
62 ifeq ($(CONFIG_NGINX_FLV),y)
63 ADDITIONAL_MODULES += --with-http_flv_module
65 ifeq ($(CONFIG_NGINX_SSL),y)
66 ADDITIONAL_MODULES += --with-http_ssl_module
68 ADDITIONAL_MODULES += --without-http-cache
70 ifeq ($(CONFIG_NGINX_DAV),y)
71 ADDITIONAL_MODULES += --with-http_dav_module
74 define Build/Configure
75 # TODO: fix --crossbuild
76 (cd $(PKG_BUILD_DIR) ;\
78 --crossbuild=Linux::$(ARCH) \
80 --conf-path=/etc/nginx/nginx.conf \
81 --error-log-path=/var/log/nginx/error.log \
82 --pid-path=/var/run/nginx.pid \
83 --lock-path=/var/lock/nginx.lock \
84 --http-log-path=/var/log/nginx/access.log \
85 --http-client-body-temp-path=/var/lib/nginx/body \
86 --http-proxy-temp-path=/var/lib/nginx/proxy \
87 --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
88 --with-cc="$(TARGET_CC)" \
89 --with-cc-opt="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
90 --with-ld-opt="$(TARGET_LDFLAGS)" \
91 $(ADDITIONAL_MODULES) )
94 define Package/nginx/install
95 $(INSTALL_DIR) $(1)/usr/sbin
96 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nginx $(1)/usr/sbin/
97 $(INSTALL_DIR) $(1)/etc/nginx
98 $(INSTALL_DATA) $(addprefix $(PKG_INSTALL_DIR)/etc/nginx/,$(config_files)) $(1)/etc/nginx/
99 $(INSTALL_DIR) $(1)/etc/init.d
100 $(INSTALL_BIN) ./files/nginx.init $(1)/etc/init.d/nginx
103 $(eval $(call BuildPackage,nginx))