2009-12-03 14:22:48 +00:00
|
|
|
#
|
2010-04-20 21:13:33 +00:00
|
|
|
# Copyright (C) 2009-2010 OpenWrt.org
|
2009-12-03 14:22:48 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=nginx
|
2010-08-26 00:08:55 +00:00
|
|
|
PKG_VERSION:=0.7.67
|
2010-11-04 13:04:45 +00:00
|
|
|
PKG_RELEASE:=3
|
2009-12-03 14:22:48 +00:00
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
|
|
PKG_SOURCE_URL:=http://sysoev.ru/nginx/
|
2010-08-26 00:08:55 +00:00
|
|
|
PKG_MD5SUM:=b6e175f969d03a4d3c5643aaabc6a5ff
|
2009-12-03 14:22:48 +00:00
|
|
|
|
2010-10-08 22:36:18 +00:00
|
|
|
PKG_BUILD_PARALLEL:=1
|
|
|
|
PKG_INSTALL:=1
|
|
|
|
|
2010-10-13 17:38:31 +00:00
|
|
|
PKG_CONFIG_DEPENDS:=\
|
|
|
|
CONFIG_NGINX_STUB_STATUS \
|
|
|
|
CONFIG_NGINX_FLV \
|
|
|
|
CONFIG_NGINX_SSL \
|
|
|
|
CONFIG_NGINX_DAV
|
|
|
|
|
2009-12-03 14:22:48 +00:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
|
|
|
define Package/nginx
|
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
2011-03-12 04:41:35 +00:00
|
|
|
SUBMENU:=Web Servers/Proxies
|
2009-12-03 14:22:48 +00:00
|
|
|
TITLE:=Nginx web server
|
|
|
|
URL:=http://nginx.net/
|
2010-11-04 13:04:45 +00:00
|
|
|
DEPENDS:=+libpcre +NGINX_SSL:libopenssl +zlib
|
2010-08-26 00:05:56 +00:00
|
|
|
MENU:=1
|
2009-12-03 14:22:48 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/nginx/description
|
|
|
|
Nginx is a free, open-source, high-performance HTTP server
|
|
|
|
and reverse proxy, as well as an IMAP/POP3 proxy server,
|
|
|
|
written by Igor Sysoev.
|
|
|
|
endef
|
|
|
|
|
2010-08-26 00:05:56 +00:00
|
|
|
define Package/nginx/config
|
|
|
|
source "$(SOURCE)/Config.in"
|
|
|
|
endef
|
|
|
|
|
2009-12-03 14:22:48 +00:00
|
|
|
config_files=nginx.conf mime.types fastcgi_params koi-utf koi-win win-utf
|
|
|
|
|
2010-08-26 00:05:56 +00:00
|
|
|
define Package/nginx/conffiles
|
|
|
|
/etc/nginx/nginx.conf
|
|
|
|
/etc/nginx/mime.types
|
|
|
|
/etc/nginx/fastcgi_params
|
|
|
|
/etc/nginx/koi-utf
|
|
|
|
/etc/nginx/koi-win
|
|
|
|
/etc/nginx/win-utf
|
|
|
|
endef
|
|
|
|
|
|
|
|
ADDITIONAL_MODULES:=
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_IPV6),y)
|
|
|
|
ADDITIONAL_MODULES += --with-ipv6
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_NGINX_STUB_STATUS),y)
|
|
|
|
ADDITIONAL_MODULES += --with-http_stub_status_module
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_NGINX_FLV),y)
|
|
|
|
ADDITIONAL_MODULES += --with-http_flv_module
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_NGINX_SSL),y)
|
|
|
|
ADDITIONAL_MODULES += --with-http_ssl_module
|
2010-10-13 17:38:31 +00:00
|
|
|
else
|
|
|
|
ADDITIONAL_MODULES += --without-http-cache
|
2010-08-26 00:05:56 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_NGINX_DAV),y)
|
|
|
|
ADDITIONAL_MODULES += --with-http_dav_module
|
|
|
|
endif
|
|
|
|
|
2009-12-03 14:22:48 +00:00
|
|
|
define Build/Configure
|
2010-08-26 00:05:56 +00:00
|
|
|
# TODO: fix --crossbuild
|
2009-12-03 14:22:48 +00:00
|
|
|
(cd $(PKG_BUILD_DIR) ;\
|
|
|
|
./configure \
|
|
|
|
--crossbuild=Linux::$(ARCH) \
|
|
|
|
--prefix=/usr \
|
|
|
|
--conf-path=/etc/nginx/nginx.conf \
|
|
|
|
--error-log-path=/var/log/nginx/error.log \
|
|
|
|
--pid-path=/var/run/nginx.pid \
|
|
|
|
--lock-path=/var/lock/nginx.lock \
|
|
|
|
--http-log-path=/var/log/nginx/access.log \
|
|
|
|
--http-client-body-temp-path=/var/lib/nginx/body \
|
|
|
|
--http-proxy-temp-path=/var/lib/nginx/proxy \
|
|
|
|
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
|
|
|
|
--with-cc="$(TARGET_CC)" \
|
|
|
|
--with-cc-opt="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
|
|
|
|
--with-ld-opt="$(TARGET_LDFLAGS)" \
|
2010-08-26 00:05:56 +00:00
|
|
|
$(ADDITIONAL_MODULES) )
|
2009-12-03 14:22:48 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Compile
|
2010-10-08 22:36:18 +00:00
|
|
|
$(call Build/Compile/Default,build)
|
2009-12-03 14:22:48 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/nginx/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nginx $(1)/usr/sbin/
|
|
|
|
$(INSTALL_DIR) $(1)/etc/nginx
|
|
|
|
$(INSTALL_DATA) $(addprefix $(PKG_INSTALL_DIR)/etc/nginx/,$(config_files)) $(1)/etc/nginx
|
2010-08-26 00:05:56 +00:00
|
|
|
# make nginx bind on both IPv4 and IPv6 by default, when available
|
|
|
|
ifeq ($(CONFIG_IPV6),y)
|
|
|
|
$(SED) 's/listen\( \+\)80;/listen\1[::]:80;/' $(1)/etc/nginx/nginx.conf
|
|
|
|
endif
|
2009-12-03 14:22:48 +00:00
|
|
|
$(INSTALL_DIR) $(1)/etc/init.d
|
|
|
|
$(INSTALL_BIN) ./files/nginx.init $(1)/etc/init.d/nginx
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,nginx))
|