nginx: Add openssl dependency. Also fix parallel build.
[openwrt/svn-archive/archive.git] / net / nginx / Makefile
1 #
2 # Copyright (C) 2009-2010 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:=0.7.67
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://sysoev.ru/nginx/
16 PKG_MD5SUM:=b6e175f969d03a4d3c5643aaabc6a5ff
17
18 PKG_BUILD_PARALLEL:=1
19 PKG_INSTALL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/nginx
24 SECTION:=net
25 CATEGORY:=Network
26 TITLE:=Nginx web server
27 URL:=http://nginx.net/
28 DEPENDS:=+libpcre +libopenssl
29 MENU:=1
30 endef
31
32 define Package/nginx/description
33 Nginx is a free, open-source, high-performance HTTP server
34 and reverse proxy, as well as an IMAP/POP3 proxy server,
35 written by Igor Sysoev.
36 endef
37
38 define Package/nginx/config
39 source "$(SOURCE)/Config.in"
40 endef
41
42 config_files=nginx.conf mime.types fastcgi_params koi-utf koi-win win-utf
43
44 define Package/nginx/conffiles
45 /etc/nginx/nginx.conf
46 /etc/nginx/mime.types
47 /etc/nginx/fastcgi_params
48 /etc/nginx/koi-utf
49 /etc/nginx/koi-win
50 /etc/nginx/win-utf
51 endef
52
53 ADDITIONAL_MODULES:=
54
55 ifeq ($(CONFIG_IPV6),y)
56 ADDITIONAL_MODULES += --with-ipv6
57 endif
58 ifeq ($(CONFIG_NGINX_STUB_STATUS),y)
59 ADDITIONAL_MODULES += --with-http_stub_status_module
60 endif
61 ifeq ($(CONFIG_NGINX_FLV),y)
62 ADDITIONAL_MODULES += --with-http_flv_module
63 endif
64 ifeq ($(CONFIG_NGINX_SSL),y)
65 ADDITIONAL_MODULES += --with-http_ssl_module
66 endif
67 ifeq ($(CONFIG_NGINX_DAV),y)
68 ADDITIONAL_MODULES += --with-http_dav_module
69 endif
70
71 define Build/Configure
72 # TODO: fix --crossbuild
73 (cd $(PKG_BUILD_DIR) ;\
74 ./configure \
75 --crossbuild=Linux::$(ARCH) \
76 --prefix=/usr \
77 --conf-path=/etc/nginx/nginx.conf \
78 --error-log-path=/var/log/nginx/error.log \
79 --pid-path=/var/run/nginx.pid \
80 --lock-path=/var/lock/nginx.lock \
81 --http-log-path=/var/log/nginx/access.log \
82 --http-client-body-temp-path=/var/lib/nginx/body \
83 --http-proxy-temp-path=/var/lib/nginx/proxy \
84 --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
85 --with-cc="$(TARGET_CC)" \
86 --with-cc-opt="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
87 --with-ld-opt="$(TARGET_LDFLAGS)" \
88 $(ADDITIONAL_MODULES) )
89 endef
90
91 define Build/Compile
92 $(call Build/Compile/Default,build)
93 endef
94
95 define Package/nginx/install
96 $(INSTALL_DIR) $(1)/usr/sbin
97 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nginx $(1)/usr/sbin/
98 $(INSTALL_DIR) $(1)/etc/nginx
99 $(INSTALL_DATA) $(addprefix $(PKG_INSTALL_DIR)/etc/nginx/,$(config_files)) $(1)/etc/nginx
100 # make nginx bind on both IPv4 and IPv6 by default, when available
101 ifeq ($(CONFIG_IPV6),y)
102 $(SED) 's/listen\( \+\)80;/listen\1[::]:80;/' $(1)/etc/nginx/nginx.conf
103 endif
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))