[packages] nginx: update to version 1.2.1
[openwrt/svn-archive/archive.git] / net / nginx / Makefile
1 #
2 # Copyright (C) 2009-2012 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=nginx
11 PKG_VERSION:=1.2.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://nginx.org/download/
16 PKG_MD5SUM:=ceacae12d66d1f021bf3737a0269b6f4
17
18 PKG_BUILD_PARALLEL:=1
19 PKG_INSTALL:=1
20
21 PKG_CONFIG_DEPENDS := \
22 CONFIG_NGINX_STUB_STATUS \
23 CONFIG_NGINX_FLV \
24 CONFIG_NGINX_SSL \
25 CONFIG_NGINX_DAV
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/nginx
30 SECTION:=net
31 CATEGORY:=Network
32 SUBMENU:=Web Servers/Proxies
33 TITLE:=Nginx web server
34 URL:=http://nginx.org/
35 DEPENDS:=+libpcre +NGINX_SSL:libopenssl +zlib
36 MENU:=1
37 endef
38
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.
42 endef
43
44 define Package/nginx/config
45 source "$(SOURCE)/Config.in"
46 endef
47
48 config_files=nginx.conf mime.types fastcgi_params koi-utf koi-win win-utf
49
50 define Package/nginx/conffiles
51 /etc/nginx/nginx.conf
52 /etc/nginx/mime.types
53 /etc/nginx/fastcgi_params
54 /etc/nginx/koi-utf
55 /etc/nginx/koi-win
56 /etc/nginx/win-utf
57 endef
58
59 ADDITIONAL_MODULES:=
60
61 ifeq ($(CONFIG_IPV6),y)
62 ADDITIONAL_MODULES += --with-ipv6
63 endif
64 ifeq ($(CONFIG_NGINX_STUB_STATUS),y)
65 ADDITIONAL_MODULES += --with-http_stub_status_module
66 endif
67 ifeq ($(CONFIG_NGINX_FLV),y)
68 ADDITIONAL_MODULES += --with-http_flv_module
69 endif
70 ifeq ($(CONFIG_NGINX_SSL),y)
71 ADDITIONAL_MODULES += --with-http_ssl_module
72 else
73 ADDITIONAL_MODULES += --without-http-cache
74 endif
75 ifeq ($(CONFIG_NGINX_DAV),y)
76 ADDITIONAL_MODULES += --with-http_dav_module
77 endif
78
79 define Build/Configure
80 # TODO: fix --crossbuild
81 (cd $(PKG_BUILD_DIR) ;\
82 ./configure \
83 --crossbuild=Linux::$(ARCH) \
84 --prefix=/usr \
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) )
97 endef
98
99 define Package/nginx/install
100 $(INSTALL_DIR) $(1)/usr/sbin
101 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nginx $(1)/usr/sbin/
102 $(INSTALL_DIR) $(1)/etc/nginx
103 $(INSTALL_DATA) $(addprefix $(PKG_INSTALL_DIR)/etc/nginx/,$(config_files)) $(1)/etc/nginx/
104 $(INSTALL_DIR) $(1)/etc/init.d
105 $(INSTALL_BIN) ./files/nginx.init $(1)/etc/init.d/nginx
106 endef
107
108 $(eval $(call BuildPackage,nginx))