2 # Copyright (C) 2009-2010 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
://sysoev.ru
/nginx
/
16 PKG_MD5SUM
:=b6e175f969d03a4d3c5643aaabc6a5ff
22 CONFIG_NGINX_STUB_STATUS \
27 include $(INCLUDE_DIR
)/package.mk
32 TITLE
:=Nginx web server
33 URL
:=http
://nginx.net
/
34 DEPENDS
:=+libpcre
+NGINX_SSL
:libopenssl
+zlib
38 define Package
/nginx
/description
39 Nginx is a free
, open-source
, high-performance HTTP server
40 and reverse proxy
, as well
as an IMAP
/POP3 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
53 /etc
/nginx
/fastcgi_params
61 ifeq ($(CONFIG_IPV6
),y
)
62 ADDITIONAL_MODULES
+= --with-ipv6
64 ifeq ($(CONFIG_NGINX_STUB_STATUS
),y
)
65 ADDITIONAL_MODULES
+= --with-http_stub_status_module
67 ifeq ($(CONFIG_NGINX_FLV
),y
)
68 ADDITIONAL_MODULES
+= --with-http_flv_module
70 ifeq ($(CONFIG_NGINX_SSL
),y
)
71 ADDITIONAL_MODULES
+= --with-http_ssl_module
73 ADDITIONAL_MODULES
+= --without-http-cache
75 ifeq ($(CONFIG_NGINX_DAV
),y
)
76 ADDITIONAL_MODULES
+= --with-http_dav_module
79 define Build
/Configure
80 # TODO: fix --crossbuild
81 (cd
$(PKG_BUILD_DIR
) ;\
83 --crossbuild
=Linux
::$(ARCH
) \
85 --conf-path
=/etc
/nginx
/nginx.conf \
86 --error-log-path
=/var
/log
/nginx
/error.log \
87 --pid-path
=/var
/run
/nginx.pid \
88 --lock-path
=/var
/lock
/nginx.lock \
89 --http-log-path
=/var
/log
/nginx
/access.log \
90 --http-client-body-temp-path
=/var
/lib
/nginx
/body \
91 --http-proxy-temp-path
=/var
/lib
/nginx
/proxy \
92 --http-fastcgi-temp-path
=/var
/lib
/nginx
/fastcgi \
93 --with-cc
="$(TARGET_CC)" \
94 --with-cc-opt
="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
95 --with-ld-opt
="$(TARGET_LDFLAGS)" \
96 $(ADDITIONAL_MODULES
) )
100 $(call Build
/Compile
/Default
,build
)
103 define Package
/nginx
/install
104 $(INSTALL_DIR
) $(1)/usr
/sbin
105 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/nginx
$(1)/usr
/sbin
/
106 $(INSTALL_DIR
) $(1)/etc
/nginx
107 $(INSTALL_DATA
) $(addprefix $(PKG_INSTALL_DIR
)/etc
/nginx
/,$(config_files
)) $(1)/etc
/nginx
108 # make nginx bind on both IPv4 and IPv6 by default, when available
109 ifeq ($(CONFIG_IPV6
),y
)
110 $(SED
) 's/listen\( \+\)80;/listen\1[::]:80;/' $(1)/etc
/nginx
/nginx.conf
112 $(INSTALL_DIR
) $(1)/etc
/init.d
113 $(INSTALL_BIN
) .
/files
/nginx.init
$(1)/etc
/init.d
/nginx
116 $(eval
$(call BuildPackage
,nginx
))