summaryrefslogtreecommitdiff
path: root/package/nginx
diff options
context:
space:
mode:
authorWaldemar Brodkorb <mail@waldemar-brodkorb.de>2012-07-16 14:00:00 (GMT)
committerWaldemar Brodkorb <mail@waldemar-brodkorb.de>2012-07-16 14:00:00 (GMT)
commit583d7f013250768de7b26d2b4000445764a03626 (patch)
tree20faea083fb9458f5abcc19cd90b89ad545f5642 /package/nginx
parent2636f0ed7b5fe9ddbc1cb3f9c9348550c7eac099 (diff)
add new package nginx
Diffstat (limited to 'package/nginx')
-rw-r--r--package/nginx/Makefile50
-rw-r--r--package/nginx/files/nginx.init28
-rw-r--r--package/nginx/files/nginx.postinst7
-rw-r--r--package/nginx/patches/patch-auto_cc_conf20
-rw-r--r--package/nginx/patches/patch-auto_cc_name11
-rw-r--r--package/nginx/patches/patch-auto_os_linux38
-rw-r--r--package/nginx/patches/patch-auto_types_sizeof26
-rw-r--r--package/nginx/patches/patch-auto_unix38
-rw-r--r--package/nginx/patches/patch-src_os_unix_ngx_errno_c12
9 files changed, 230 insertions, 0 deletions
diff --git a/package/nginx/Makefile b/package/nginx/Makefile
new file mode 100644
index 0000000..436d561
--- /dev/null
+++ b/package/nginx/Makefile
@@ -0,0 +1,50 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= nginx
+PKG_VERSION:= 1.2.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 53105bbe3ac9319db54d9eb46119695b
+PKG_DESCR:= powerful http reverse proxy
+PKG_SECTION:= proxy
+PKG_BUILDDEP:= openssl pcre zlib
+PKG_DEPENDS:= libopenssl libpcre libpthread zlib
+PKG_URL:= http://nginx.org/
+PKG_SITES:= http://nginx.org/download/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,NGINX,nginx,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+CONFIG_STYLE:= minimal
+TARGET_CFLAGS+= -fPIC
+CONFIGURE_ARGS:= --prefix=/usr \
+ --user=nginx \
+ --group=nginx \
+ --crossbuild=Linux::$(ARCH) \
+ --with-cc="$(TARGET_CC)" \
+ --with-cc-opt="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
+ --with-ld-opt="$(TARGET_LDFLAGS)" \
+ --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
+ALL_TARGET:=
+XAKE_FLAGS+= GCC_HONOUR_COPTS=s
+
+nginx-install:
+ $(INSTALL_DIR) $(IDIR_NGINX)/usr/sbin $(IDIR_NGINX)/etc/nginx
+ $(INSTALL_BIN) $(WRKINST)/usr/sbin/nginx \
+ $(IDIR_NGINX)/usr/sbin
+ for f in nginx.conf mime.types fastcgi_params koi-utf koi-win win-utf; do \
+ cp $(WRKINST)/etc/nginx/$${f} \
+ $(IDIR_NGINX)/etc/nginx ; \
+ done
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/nginx/files/nginx.init b/package/nginx/files/nginx.init
new file mode 100644
index 0000000..456e90a
--- /dev/null
+++ b/package/nginx/files/nginx.init
@@ -0,0 +1,28 @@
+#!/bin/sh
+#PKG nginx
+#INIT 70
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${nginx:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -d /var/lib/nginx ] || mkdir -p /var/lib/nginx
+ [ -d /var/log/nginx ] || mkdir -p /var/log/nginx
+ /usr/sbin/nginx
+ ;;
+stop)
+ kill $(pgrep -f /usr/sbin/nginx)
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ ;;
+esac
+exit $?
diff --git a/package/nginx/files/nginx.postinst b/package/nginx/files/nginx.postinst
new file mode 100644
index 0000000..5220c8e
--- /dev/null
+++ b/package/nginx/files/nginx.postinst
@@ -0,0 +1,7 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf nginx nginx NO
+gid=$(get_next_gid)
+add_group nginx $gid
+add_user nginx $(get_next_uid) $gid /tmp/.nginx
+
diff --git a/package/nginx/patches/patch-auto_cc_conf b/package/nginx/patches/patch-auto_cc_conf
new file mode 100644
index 0000000..bc516d8
--- /dev/null
+++ b/package/nginx/patches/patch-auto_cc_conf
@@ -0,0 +1,20 @@
+--- nginx-1.2.2.orig/auto/cc/conf 2012-01-18 16:07:43.000000000 +0100
++++ nginx-1.2.2/auto/cc/conf 2012-07-16 09:27:16.000000000 +0200
+@@ -149,7 +149,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
+ else
+ ngx_feature="C99 variadic macros"
+ ngx_feature_name="NGX_HAVE_C99_VARIADIC_MACROS"
+- ngx_feature_run=yes
++ ngx_feature_run=no
+ ngx_feature_incs="#include <stdio.h>
+ #define var(dummy, ...) sprintf(__VA_ARGS__)"
+ ngx_feature_path=
+@@ -163,7 +163,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
+
+ ngx_feature="gcc variadic macros"
+ ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS"
+- ngx_feature_run=yes
++ ngx_feature_run=no
+ ngx_feature_incs="#include <stdio.h>
+ #define var(dummy, args...) sprintf(args)"
+ ngx_feature_path=
diff --git a/package/nginx/patches/patch-auto_cc_name b/package/nginx/patches/patch-auto_cc_name
new file mode 100644
index 0000000..a54e184
--- /dev/null
+++ b/package/nginx/patches/patch-auto_cc_name
@@ -0,0 +1,11 @@
+--- nginx-1.2.2.orig/auto/cc/name 2012-02-27 17:23:44.000000000 +0100
++++ nginx-1.2.2/auto/cc/name 2012-07-16 09:27:16.000000000 +0200
+@@ -7,7 +7,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
+
+ ngx_feature="C compiler"
+ ngx_feature_name=
+- ngx_feature_run=yes
++ ngx_feature_run=
+ ngx_feature_incs=
+ ngx_feature_path=
+ ngx_feature_libs=
diff --git a/package/nginx/patches/patch-auto_os_linux b/package/nginx/patches/patch-auto_os_linux
new file mode 100644
index 0000000..bd0b5aa
--- /dev/null
+++ b/package/nginx/patches/patch-auto_os_linux
@@ -0,0 +1,38 @@
+--- nginx-1.2.2.orig/auto/os/linux 2012-03-21 14:58:51.000000000 +0100
++++ nginx-1.2.2/auto/os/linux 2012-07-16 09:27:16.000000000 +0200
+@@ -48,7 +48,7 @@ fi
+
+ ngx_feature="epoll"
+ ngx_feature_name="NGX_HAVE_EPOLL"
+-ngx_feature_run=yes
++ngx_feature_run=no
+ ngx_feature_incs="#include <sys/epoll.h>"
+ ngx_feature_path=
+ ngx_feature_libs=
+@@ -73,7 +73,7 @@ fi
+ CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE"
+ ngx_feature="sendfile()"
+ ngx_feature_name="NGX_HAVE_SENDFILE"
+-ngx_feature_run=yes
++ngx_feature_run=no
+ ngx_feature_incs="#include <sys/sendfile.h>
+ #include <errno.h>"
+ ngx_feature_path=
+@@ -94,7 +94,7 @@ fi
+ CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
+ ngx_feature="sendfile64()"
+ ngx_feature_name="NGX_HAVE_SENDFILE64"
+-ngx_feature_run=yes
++ngx_feature_run=no
+ ngx_feature_incs="#include <sys/sendfile.h>
+ #include <errno.h>"
+ ngx_feature_path=
+@@ -112,7 +112,7 @@ ngx_include="sys/prctl.h"; . auto/includ
+
+ ngx_feature="prctl(PR_SET_DUMPABLE)"
+ ngx_feature_name="NGX_HAVE_PR_SET_DUMPABLE"
+-ngx_feature_run=yes
++ngx_feature_run=no
+ ngx_feature_incs="#include <sys/prctl.h>"
+ ngx_feature_path=
+ ngx_feature_libs=
diff --git a/package/nginx/patches/patch-auto_types_sizeof b/package/nginx/patches/patch-auto_types_sizeof
new file mode 100644
index 0000000..219385d
--- /dev/null
+++ b/package/nginx/patches/patch-auto_types_sizeof
@@ -0,0 +1,26 @@
+--- nginx-1.2.2.orig/auto/types/sizeof 2012-03-16 08:33:55.000000000 +0100
++++ nginx-1.2.2/auto/types/sizeof 2012-07-16 09:28:44.000000000 +0200
+@@ -25,8 +25,13 @@ $NGX_INCLUDE_UNISTD_H
+ $NGX_INCLUDE_INTTYPES_H
+ $NGX_INCLUDE_AUTO_CONFIG_H
+
++char object_code_block[] = {
++ '\n', 'e', '4', 'V', 'A',
++ '0', 'x', ('0' + sizeof($ngx_type)),
++ 'Y', '3', 'p', 'M', '\n'
++};
++
+ int main() {
+- printf("%d", (int) sizeof($ngx_type));
+ return 0;
+ }
+
+@@ -40,7 +45,7 @@ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&
+
+
+ if [ -x $NGX_AUTOTEST ]; then
+- ngx_size=`$NGX_AUTOTEST`
++ ngx_size=`sed -ne 's/^e4VA0x\(.\)Y3pM$/\1/p' < $NGX_AUTOTEST`
+ echo " $ngx_size bytes"
+ fi
+
diff --git a/package/nginx/patches/patch-auto_unix b/package/nginx/patches/patch-auto_unix
new file mode 100644
index 0000000..5a37087
--- /dev/null
+++ b/package/nginx/patches/patch-auto_unix
@@ -0,0 +1,38 @@
+--- nginx-1.2.2.orig/auto/unix 2012-07-02 18:51:02.000000000 +0200
++++ nginx-1.2.2/auto/unix 2012-07-16 09:27:16.000000000 +0200
+@@ -618,7 +618,7 @@ ngx_feature_test="void *p; p = memalign(
+
+ ngx_feature="mmap(MAP_ANON|MAP_SHARED)"
+ ngx_feature_name="NGX_HAVE_MAP_ANON"
+-ngx_feature_run=yes
++ngx_feature_run=no
+ ngx_feature_incs="#include <sys/mman.h>"
+ ngx_feature_path=
+ ngx_feature_libs=
+@@ -631,7 +631,7 @@ ngx_feature_test="void *p;
+
+ ngx_feature='mmap("/dev/zero", MAP_SHARED)'
+ ngx_feature_name="NGX_HAVE_MAP_DEVZERO"
+-ngx_feature_run=yes
++ngx_feature_run=no
+ ngx_feature_incs="#include <sys/mman.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>"
+@@ -646,7 +646,7 @@ ngx_feature_test='void *p; int fd;
+
+ ngx_feature="System V shared memory"
+ ngx_feature_name="NGX_HAVE_SYSVSHM"
+-ngx_feature_run=yes
++ngx_feature_run=no
+ ngx_feature_incs="#include <sys/ipc.h>
+ #include <sys/shm.h>"
+ ngx_feature_path=
+@@ -660,7 +660,7 @@ ngx_feature_test="int id;
+
+ ngx_feature="POSIX semaphores"
+ ngx_feature_name="NGX_HAVE_POSIX_SEM"
+-ngx_feature_run=yes
++ngx_feature_run=no
+ ngx_feature_incs="#include <semaphore.h>"
+ ngx_feature_path=
+ ngx_feature_libs=
diff --git a/package/nginx/patches/patch-src_os_unix_ngx_errno_c b/package/nginx/patches/patch-src_os_unix_ngx_errno_c
new file mode 100644
index 0000000..7002093
--- /dev/null
+++ b/package/nginx/patches/patch-src_os_unix_ngx_errno_c
@@ -0,0 +1,12 @@
+--- nginx-1.2.2.orig/src/os/unix/ngx_errno.c 2012-07-02 18:51:02.000000000 +0200
++++ nginx-1.2.2/src/os/unix/ngx_errno.c 2012-07-16 09:32:48.000000000 +0200
+@@ -8,6 +8,9 @@
+ #include <ngx_config.h>
+ #include <ngx_core.h>
+
++#ifndef NGX_SYS_NERR
++#define NGX_SYS_NERR 128
++#endif
+
+ /*
+ * The strerror() messages are copied because: