Merge pull request #1 from openresty/master

Rebase
pull/362/head
Marcus Clyne 7 years ago committed by GitHub
commit f645a6fa30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -88,6 +88,8 @@ path to be used for parsing, for example: `local=/tmp/test.conf`.
When `local=off`, parsing will be disabled (this is the default). When `local=off`, parsing will be disabled (this is the default).
This feature is not available on Windows platforms.
[Back to TOC](#table-of-contents) [Back to TOC](#table-of-contents)
Mailing List Mailing List

@ -1,215 +1 @@
Name See [README-windows](./README-windows.md).
====
README-win32 - README for the Windows 32-bit build of OpenResty
Description
===========
The official binary Win32 distribution of OpenResty can be downloaded from the following web page:
https://openresty.org/en/download.html
To start the NGINX server of the nginx server of the Win32 binary distribution of OpenResty:
```bash
start nginx
```
You can also specify the `-p PATH/` option to override the default server prefix, as in
```bash
cd /path/to/my/openresty/app/
start nginx -p $PWD
```
Then you can use the `tasklist` command to check the nginx processes running in the background:
```console
C:\> tasklist /fi "imagename eq nginx.exe"
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
nginx.exe 4616 Console 1 7,412 K
nginx.exe 5836 Console 1 7,800 K
```
One of the two processes is the master process while the other is the worker.
If you are using the MSYS bash instead of the `cmd.exe` console, then you should replace the `/fi` option
with `-fi` in the command above instead.
You can quickly shut down the server like this:
```bash
nginx -s stop
```
or gracefully shut it down like this:
```bash
nginx -s quit
```
You can also forcibly kill the nginx processes via their PIDs with `taskkill`, as in
```console
C:\> taskkill /pid 5488 /F
```
where the PID (5488 in this example) can be found via the aforementioned `tasklist` command.
Again, you should use the form `-pid` and `-F` for the options if you are in an MSYS bash
session.
Similarly, you can use the `nginx -s reload` command to reload nginx configurations without
stopping the server. And you can use `nginx -s reopen` to instruct nginx to re-open
all the log files.
You can run the `resty` script like this:
```console
C:\> resty -e "ngx.say('Hello, OpenResty!')"
Hello, OpenResty!
```
The `resty` command-line utility requires a Perl interpreter installed in your
system and visible to your PATH environment. Any perl distributions should
work, including StrawberryPerl, ActivePerl, and MSYS perl (the former two are
recommended though).
Debugging
=========
Debug symbosl are enabled even in release builds. So that when things go very wrong,
one can still debug things with tools like MSYS GDB.
Inclusion of debug symbols make the binary files (`.exe` and `.dll` files) much larger,
but it generally will not load into memory during normal execution on a modern operating
system.
Caveats
=======
The Win32 port of the NGINX core supports the good old `select` IO multiplexing mechanism
only.
The I/O Completion Ports (IOCP) feature is *not* supported (yet). So do not use this build
for production environments with very high concurrency levels.
This Win32 build of OpenResty is mainly for developers who want to develop their applications
in native Windows environment (though they eventually push the finished work onto a Linux or *BSD box, most of the time).
TODO
====
* Add support for more than one NGINX worker processes.
* Add support for concurrent connections more than 1024.
* Switch to the Microsoft Visual Studio compiler toolchain for better performance and easier binary
package redistribution.
* Bundle StrawberryPerl to make command-line utilities like `resty` work out of the box (without
manually installing a Perl).
* Deliver an alternative Win32 binary package built with best debuggin capabilities (like enabling
NGINX debugging logs, disabling C compiler optimizations, and enabling all the assertions and checks).
* Deliver binary packages for 64-bit Windows (Win64).
Details About The Building Process
==================================
Usually you do not need to worry about how the Win32 binaries were built on the maintainers''
side. But if you do, please read on.
The Win32 build of OpenResty is currently built via the MinGW/MSYS toolchain, including
MinGW gcc 4.8.1, MSYS perl, MSYS bash, MSYS make, and etc. Basically, it is currently built via
the following cmmands:
```bash
PCRE=pcre-8.39
ZLIB=zlib-1.2.8
OPENSSL=openssl-1.0.2j
mkdir -p objs/lib || exit 1
cd objs/lib || exit 1
ls ../../..
tar -xf ../../../$OPENSSL.tar.gz || exit 1
tar -xf ../../../$ZLIB.tar.gz || exit 1
tar -xf ../../../$PCRE.tar.gz || exit 1
cd ../..
cd objs/lib/$OPENSSL || exit 1
patch -p1 < ../../../patches/openssl-1.0.2h-sess_set_get_cb_yield.patch || exit 1
cd ../../..
./configure \
--with-cc=gcc \
--with-ipv6 \
--prefix= \
--with-cc-opt='-DFD_SETSIZE=1024' \
--sbin-path=nginx.exe \
--with-pcre-jit \
--without-http_rds_json_module \
--without-http_rds_csv_module \
--without-lua_rds_parser \
--with-ipv6 \
--with-stream \
--with-stream_ssl_module \
--with-http_v2_module \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_auth_request_module \
--with-http_secure_link_module \
--with-http_random_index_module \
--with-http_gzip_static_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-select_module \
--with-luajit-xcflags="-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT" \
--with-pcre=objs/lib/$PCRE \
--with-zlib=objs/lib/$ZLIB \
--with-openssl=objs/lib/$OPENSSL \
-j5 || exit 1
make
make install
```
where the dependency library source tarballs for OpenSSL, Zlib, and PCRE are downloaded
from their official sites, respectively.
We automate these commands in a dedicated shell script named [build-win32.sh](https://github.com/openresty/openresty/blob/master/util/build-win32.sh).
Furthermore, we automate the packaging process of the resulting binaries and supporting files
with this [package-win32.sh](https://github.com/openresty/openresty/blob/master/util/package-win32.sh)
script.
Usually you can just download and use the binary distribution of OpenResty without
installing the build toolchain.
Author
======
Yichun "agentzh" Zhang <agentzh@gmail.com>, OpenResty Inc.
Copyright & License
===================
This module is licensed under the BSD license.
Copyright (C) 2015-2016, by Yichun "agentzh" Zhang () <agentzh@gmail.com>, OpenResty Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

@ -0,0 +1,238 @@
Name
====
README-windows - README for the official 32-bit and 64-bit Windows builds of OpenResty
Table of Contents
=================
* [Name](#name)
* [Description](#description)
* [Debugging](#debugging)
* [Caveats](#caveats)
* [TODO](#todo)
* [Details About The Building Process](#details-about-the-building-process)
* [Author](#author)
* [Copyright & License](#copyright--license)
Description
===========
The official binary Win32 and Win64 distributions of OpenResty can be downloaded from the following web page:
https://openresty.org/en/download.html
To start the NGINX server of the nginx server of the Win32 binary distribution of OpenResty:
```bash
start nginx
```
You can also specify the `-p PATH/` option to override the default server prefix, as in
```bash
cd /path/to/my/openresty/app/
start nginx -p $PWD
```
Then you can use the `tasklist` command to check the nginx processes running in the background:
```console
C:\> tasklist /fi "imagename eq nginx.exe"
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
nginx.exe 4616 Console 1 7,412 K
nginx.exe 5836 Console 1 7,800 K
```
One of the two processes is the master process while the other is the worker.
If you are using the MSYS2 bash instead of the `cmd.exe` console, then you should replace the `/fi` option
with `-fi` in the command above instead.
You can quickly shut down the server like this:
```bash
nginx -s stop
```
or gracefully shut it down like this:
```bash
nginx -s quit
```
You can also forcibly kill the nginx processes via their PIDs with `taskkill`, as in
```console
C:\> taskkill /pid 5488 /F
```
where the PID (5488 in this example) can be found via the aforementioned `tasklist` command.
Again, you should use the form `-pid` and `-F` for the options if you are in an MSYS2 bash
session.
Similarly, you can use the `nginx -s reload` command to reload nginx configurations without
stopping the server. And you can use `nginx -s reopen` to instruct nginx to re-open
all the log files.
You can run the `resty` script like this:
```console
C:\> resty -e "ngx.say('Hello, OpenResty!')"
Hello, OpenResty!
```
The `resty` command-line utility requires a Perl interpreter installed in your
system and visible to your PATH environment. Any perl distributions should
work, including StrawberryPerl, ActivePerl, and MSYS2 perl.
recommended though).
Debugging
=========
Debug symbosl are enabled even in release builds. So that when things go very wrong,
one can still debug things with tools like MSYS2 GDB.
Inclusion of debug symbols make the binary files (`.exe` and `.dll` files) much larger,
but it generally will not load into memory during normal execution on a modern operating
system.
Caveats
=======
The Win32/Win64 port of the NGINX core supports the good old `select` IO multiplexing mechanism
only.
The I/O Completion Ports (IOCP) feature is *not* supported (yet). So do not use this build
for production environments with very high concurrency levels.
This Win32/Win64 build of OpenResty is mainly for developers who want to develop their applications
in native Windows environment (though they eventually push the finished work onto a Linux or *BSD box, most of the time).
[Back to TOC](#table-of-contents)
TODO
====
* Add support for more than one NGINX worker processes.
* Add support for concurrent connections more than 1024.
* Switch to the Microsoft Visual Studio compiler toolchain for better performance and easier binary
package redistribution.
* Bundle StrawberryPerl to make command-line utilities like `resty` work out of the box (without
manually installing a Perl).
* Deliver an alternative Win32/Win64 binary package built with best debuggin capabilities (like enabling
NGINX debugging logs, disabling C compiler optimizations, and enabling all the assertions and checks).
[Back to TOC](#table-of-contents)
Details About The Building Process
==================================
Usually you do not need to worry about how the Win32/Win64 binaries were built on the maintainers''
side. But if you do, please read on.
The Win32/Win64 build of OpenResty is currently built via the MSYS2/MinGW toolchain, including
MinGW gcc 7.2.3, MSYS2 perl 5.24.4, MSYS2 bash, MSYS2 make, and etc. Basically, it is currently built via
the following cmmands:
```bash
PCRE=pcre-8.42
ZLIB=zlib-1.2.11
OPENSSL=openssl-1.1.0h
mkdir -p objs/lib || exit 1
cd objs/lib || exit 1
ls ../../..
tar -xf ../../../$OPENSSL.tar.gz || exit 1
tar -xf ../../../$ZLIB.tar.gz || exit 1
tar -xf ../../../$PCRE.tar.gz || exit 1
cd ../..
cd objs/lib/$OPENSSL || exit 1
patch -p1 < ../../../patches/openssl-1.1.0d-sess_set_get_cb_yield.patch || exit 1
cd ../../..
./configure \
--with-cc=gcc \
--with-ipv6 \
--prefix= \
--with-cc-opt='-DFD_SETSIZE=1024' \
--sbin-path=nginx.exe \
--with-pcre-jit \
--without-http_rds_json_module \
--without-http_rds_csv_module \
--without-lua_rds_parser \
--with-ipv6 \
--with-stream \
--with-stream_ssl_module \
--with-stream_ssl_preread_module \
--with-http_v2_module \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_auth_request_module \
--with-http_secure_link_module \
--with-http_random_index_module \
--with-http_gzip_static_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-select_module \
--with-luajit-xcflags="-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT" \
--with-pcre=objs/lib/$PCRE \
--with-zlib=objs/lib/$ZLIB \
--with-openssl=objs/lib/$OPENSSL \
-j9 || exit 1
make -j9
make install
```
where the dependency library source tarballs for OpenSSL, Zlib, and PCRE are downloaded
from their official sites, respectively.
We automate these commands in a dedicated shell script named [build-win32.sh](https://github.com/openresty/openresty/blob/master/util/build-win32.sh).
Furthermore, we automate the packaging process of the resulting binaries and supporting files
with this [package-win32.sh](https://github.com/openresty/openresty/blob/master/util/package-win32.sh)
script.
Usually you can just download and use the binary distribution of OpenResty without
installing the build toolchain.
[Back to TOC](#table-of-contents)
Author
======
Yichun "agentzh" Zhang <agentzh@gmail.com>, OpenResty Inc.
[Back to TOC](#table-of-contents)
Copyright & License
===================
This module is licensed under the BSD license.
Copyright (C) 2015-2018, by Yichun "agentzh" Zhang () <agentzh@gmail.com>, OpenResty Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[Back to TOC](#table-of-contents)

@ -1,19 +1,22 @@
diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c
index cd55520c..df55a484 100644 index cd55520c..dade1846 100644
--- a/src/core/ngx_resolver.c --- a/src/core/ngx_resolver.c
+++ b/src/core/ngx_resolver.c +++ b/src/core/ngx_resolver.c
@@ -5,6 +5,7 @@ @@ -9,12 +9,26 @@
*/
+#include <resolv.h>
#include <ngx_config.h>
#include <ngx_core.h> #include <ngx_core.h>
#include <ngx_event.h> #include <ngx_event.h>
@@ -15,6 +16,14 @@
+#if !(NGX_WIN32)
+#include <resolv.h>
+#endif
+
#define NGX_RESOLVER_UDP_SIZE 4096
#define NGX_RESOLVER_TCP_RSIZE (2 + 65535) #define NGX_RESOLVER_TCP_RSIZE (2 + 65535)
#define NGX_RESOLVER_TCP_WSIZE 8192 #define NGX_RESOLVER_TCP_WSIZE 8192
+#if !(NGX_WIN32)
+/* +/*
+ * note that 2KB should be more than enough for majority of the + * note that 2KB should be more than enough for majority of the
+ * resolv.conf files out there. it also acts as a safety guard to prevent + * resolv.conf files out there. it also acts as a safety guard to prevent
@ -21,14 +24,16 @@ index cd55520c..df55a484 100644
+ */ + */
+#define NGX_RESOLVER_FILE_BUF_SIZE 2048 +#define NGX_RESOLVER_FILE_BUF_SIZE 2048
+#define NGX_RESOLVER_FILE_NAME "/etc/resolv.conf" +#define NGX_RESOLVER_FILE_NAME "/etc/resolv.conf"
+#endif
+ +
typedef struct { typedef struct {
u_char ident_hi; u_char ident_hi;
@@ -131,6 +140,189 @@ static ngx_resolver_node_t *ngx_resolver_lookup_addr6(ngx_resolver_t *r, @@ -131,6 +145,191 @@ static ngx_resolver_node_t *ngx_resolver_lookup_addr6(ngx_resolver_t *r,
#endif #endif
+#if !(NGX_WIN32)
+static ngx_int_t +static ngx_int_t
+ngx_resolver_read_resolv_conf(ngx_conf_t *cf, ngx_resolver_t *r, u_char *path, +ngx_resolver_read_resolv_conf(ngx_conf_t *cf, ngx_resolver_t *r, u_char *path,
+ size_t path_len) + size_t path_len)
@ -210,15 +215,17 @@ index cd55520c..df55a484 100644
+ +
+ return NGX_OK; + return NGX_OK;
+} +}
+#endif
+ +
+ +
ngx_resolver_t * ngx_resolver_t *
ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names, ngx_uint_t n) ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names, ngx_uint_t n)
{ {
@@ -246,6 +438,37 @@ ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names, ngx_uint_t n) @@ -246,6 +445,39 @@ ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names, ngx_uint_t n)
} }
#endif #endif
+#if !(NGX_WIN32)
+ if (ngx_strncmp(names[i].data, "local=", 6) == 0) { + if (ngx_strncmp(names[i].data, "local=", 6) == 0) {
+ +
+ if (ngx_strcmp(&names[i].data[6], "on") == 0) { + if (ngx_strcmp(&names[i].data[6], "on") == 0) {
@ -249,6 +256,7 @@ index cd55520c..df55a484 100644
+ +
+ continue; + continue;
+ } + }
+#endif
+ +
ngx_memzero(&u, sizeof(ngx_url_t)); ngx_memzero(&u, sizeof(ngx_url_t));

@ -18,10 +18,11 @@ With this option disappearing in Nginx 1.11.5, this patch would allow such tools
to assume "ipv6=off" to be safe regardless of ipv6 support in the current to assume "ipv6=off" to be safe regardless of ipv6 support in the current
build. build.
diff -r a3dc657f4e95 -r 8bf038fe006f src/core/ngx_resolver.c diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c
--- a/src/core/ngx_resolver.c Thu Dec 15 21:44:34 2016 +0300 index dade1846..5a3f0aa4 100644
+++ b/src/core/ngx_resolver.c Thu Dec 15 16:17:01 2016 -0800 --- a/src/core/ngx_resolver.c
@@ -224,14 +224,22 @@ +++ b/src/core/ngx_resolver.c
@@ -426,14 +426,22 @@ ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names, ngx_uint_t n)
continue; continue;
} }
@ -45,11 +46,11 @@ diff -r a3dc657f4e95 -r 8bf038fe006f src/core/ngx_resolver.c
} else { } else {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
@@ -241,7 +249,6 @@ @@ -443,7 +451,6 @@ ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names, ngx_uint_t n)
continue; continue;
} }
-#endif -#endif
ngx_memzero(&u, sizeof(ngx_url_t)); #if !(NGX_WIN32)
if (ngx_strncmp(names[i].data, "local=", 6) == 0) {

File diff suppressed because it is too large Load Diff

@ -2,11 +2,12 @@
PCRE=pcre-8.42 PCRE=pcre-8.42
ZLIB=zlib-1.2.11 ZLIB=zlib-1.2.11
OPENSSL=openssl-1.0.2n OPENSSL=openssl-1.1.0h
JOBS=12
# wget https://www.openssl.org/source/openssl-1.0.2k.tar.gz # wget https://www.openssl.org/source/openssl-1.1.0h.tar.gz
# wget http://zlib.net/zlib-1.2.11.tar.gz # wget http://zlib.net/zlib-1.2.11.tar.gz
# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz # wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.42.tar.gz
rm -rf objs || exit 1 rm -rf objs || exit 1
mkdir -p objs/lib || exit 1 mkdir -p objs/lib || exit 1
@ -18,7 +19,8 @@ tar -xf ../../../$PCRE.tar.gz || exit 1
cd ../.. cd ../..
cd objs/lib/$OPENSSL || exit 1 cd objs/lib/$OPENSSL || exit 1
patch -p1 < ../../../patches/openssl-1.0.2h-sess_set_get_cb_yield.patch || exit 1 patch -p1 < ../../../patches/openssl-1.1.0d-sess_set_get_cb_yield.patch \
|| exit 1
cd ../../.. cd ../../..
#--with-openssl-opt="no-asm" \ #--with-openssl-opt="no-asm" \
@ -36,6 +38,7 @@ cd ../../..
--with-ipv6 \ --with-ipv6 \
--with-stream \ --with-stream \
--with-stream_ssl_module \ --with-stream_ssl_module \
--with-stream_ssl_preread_module \
--with-http_v2_module \ --with-http_v2_module \
--without-mail_pop3_module \ --without-mail_pop3_module \
--without-mail_imap_module \ --without-mail_imap_module \
@ -57,7 +60,7 @@ cd ../../..
--with-pcre=objs/lib/$PCRE \ --with-pcre=objs/lib/$PCRE \
--with-zlib=objs/lib/$ZLIB \ --with-zlib=objs/lib/$ZLIB \
--with-openssl=objs/lib/$OPENSSL \ --with-openssl=objs/lib/$OPENSSL \
-j5 || exit 1 -j$JOBS || exit 1
#gmake -j5
make || exit 1 make -j$JOBS || exit 1
make install exec make install

@ -492,7 +492,7 @@ mv openresty-drizzle-nginx-module-* drizzle-nginx-module-$ver || exit 1
################################# #################################
ver=0.10.12 ver=0.10.13
$root/util/get-tarball "https://github.com/openresty/lua-nginx-module/tarball/v$ver" -O lua-nginx-module-$ver.tar.gz || exit 1 $root/util/get-tarball "https://github.com/openresty/lua-nginx-module/tarball/v$ver" -O lua-nginx-module-$ver.tar.gz || exit 1
tar -xzf lua-nginx-module-$ver.tar.gz || exit 1 tar -xzf lua-nginx-module-$ver.tar.gz || exit 1
mv openresty-lua-nginx-module-* ngx_lua-$ver || exit 1 mv openresty-lua-nginx-module-* ngx_lua-$ver || exit 1
@ -506,7 +506,7 @@ mv openresty-lua-upstream-nginx-module-* ngx_lua_upstream-$ver || exit 1
################################# #################################
ver=0.0.4 ver=0.0.5
$root/util/get-tarball "https://github.com/openresty/stream-lua-nginx-module/tarball/v$ver" -O stream-lua-nginx-module-$ver.tar.gz || exit 1 $root/util/get-tarball "https://github.com/openresty/stream-lua-nginx-module/tarball/v$ver" -O stream-lua-nginx-module-$ver.tar.gz || exit 1
tar -xzf stream-lua-nginx-module-$ver.tar.gz || exit 1 tar -xzf stream-lua-nginx-module-$ver.tar.gz || exit 1
mv openresty-stream-lua-nginx-module-* ngx_stream_lua-$ver || exit 1 mv openresty-stream-lua-nginx-module-* ngx_stream_lua-$ver || exit 1
@ -646,7 +646,7 @@ mv openresty-opm-* opm-$ver || exit 1
################################# #################################
ver=2.1-20180419 ver=2.1-20180420
$root/util/get-tarball "https://github.com/openresty/luajit2/archive/v$ver.tar.gz" -O "LuaJIT-$ver.tar.gz" || exit 1 $root/util/get-tarball "https://github.com/openresty/luajit2/archive/v$ver.tar.gz" -O "LuaJIT-$ver.tar.gz" || exit 1
tar -xzf LuaJIT-$ver.tar.gz || exit 1 tar -xzf LuaJIT-$ver.tar.gz || exit 1
mv luajit2-* LuaJIT-$ver || exit 1 mv luajit2-* LuaJIT-$ver || exit 1
@ -822,7 +822,7 @@ cd ..
################################# #################################
ver=0.1.14 ver=0.1.15
$root/util/get-tarball "https://github.com/openresty/lua-resty-core/tarball/v$ver" -O "lua-resty-core-$ver.tar.gz" || exit 1 $root/util/get-tarball "https://github.com/openresty/lua-resty-core/tarball/v$ver" -O "lua-resty-core-$ver.tar.gz" || exit 1
tar -xzf lua-resty-core-$ver.tar.gz || exit 1 tar -xzf lua-resty-core-$ver.tar.gz || exit 1
mv openresty-lua-resty-core-* lua-resty-core-$ver || exit 1 mv openresty-lua-resty-core-* lua-resty-core-$ver || exit 1
@ -856,8 +856,8 @@ mkdir util || exit 1
cp $root/util/package-win32.sh util/ || exit 1 cp $root/util/package-win32.sh util/ || exit 1
cp $root/util/build-win32.sh util/ || exit 1 cp $root/util/build-win32.sh util/ || exit 1
cp $root/COPYRIGHT ./ || exit 1 cp $root/COPYRIGHT ./ || exit 1
perl bundle/$resty_cli/bin/md2pod.pl $root/doc/README-win32.md | pod2text > README-win32.txt || exit 1 perl bundle/$resty_cli/bin/md2pod.pl $root/doc/README-windows.md | pod2text > README-windows.txt || exit 1
unix2dos README-win32.txt || exit 1 unix2dos README-windows.txt || exit 1
mkdir patches/ || exit 1 mkdir patches/ || exit 1
cp $root/patches/openssl-1.0.2h-sess_set_get_cb_yield.patch patches/ || exit 1 cp $root/patches/openssl-1.0.2h-sess_set_get_cb_yield.patch patches/ || exit 1
cp $root/patches/openssl-1.1.0c-sess_set_get_cb_yield.patch patches/ || exit 1 cp $root/patches/openssl-1.1.0c-sess_set_get_cb_yield.patch patches/ || exit 1

@ -1,7 +1,23 @@
#!/bin/bash #!/bin/bash
mingw32=/c/msys64/mingw32
info=`uname -a`
if [[ "$info" == MINGW64* ]]; then
arch="win64";
else
if [[ "$info" == MINGW32* ]]; then
arch="win32";
else
echo "Unknown architecture: $info" > /dev/stderr
exit 1
fi
fi
echo $arch
name=`pwd|perl -e '$d=<>;$d=~s{.*?/}{}g;$d=~s/$//g;print $d'` name=`pwd|perl -e '$d=<>;$d=~s{.*?/}{}g;$d=~s/$//g;print $d'`
name="$name-win32" name="$name-$arch"
echo $name echo $name
if [ -d $name ]; then if [ -d $name ]; then
rm -rf $name rm -rf $name
@ -9,12 +25,15 @@ fi
mkdir $name || exit 1 mkdir $name || exit 1
cp -r resty restydoc restydoc-index nginx.exe luajit.exe lua51.dll lua include lualib html conf logs pod $name/ || exit 1 cp -r resty restydoc restydoc-index nginx.exe luajit.exe lua51.dll lua include lualib html conf logs pod $name/ || exit 1
cp COPYRIGHT $name/ || exit 1 cp COPYRIGHT $name/ || exit 1
cp /c/MinGW/bin/libgcc_s_dw2-1.dll $name/ || exit 1 if [[ "$arch" == "win32" ]]; then
cp $mingw32/bin/libgcc_s_dw2-1.dll $name/ || exit 1
cp $mingw32/bin/libwinpthread-1.dll $name/ || exit 1
fi
cd $name || exit 1 cd $name || exit 1
PATH=/c/Strawberry/perl/bin:$PATH cmd /c 'pl2bat.bat resty' || exit 1 PATH=/c/Strawberry/perl/bin:$PATH cmd /c 'pl2bat.bat resty' || exit 1
PATH=/c/Strawberry/perl/bin:$PATH cmd /c 'pl2bat.bat restydoc' || exit 1 PATH=/c/Strawberry/perl/bin:$PATH cmd /c 'pl2bat.bat restydoc' || exit 1
PATH=/c/Strawberry/perl/bin:$PATH cmd /c 'pl2bat.bat restydoc-index' || exit 1 PATH=/c/Strawberry/perl/bin:$PATH cmd /c 'pl2bat.bat restydoc-index' || exit 1
cp ../README-win32.txt README.txt cp ../README-windows.txt README.txt
unix2dos conf/* html/*.html resty || exit 1 unix2dos conf/* html/*.html resty || exit 1
cd .. || exit 1 cd .. || exit 1
zip -r $name.zip $name || exit 1 zip -r $name.zip $name || exit 1

Loading…
Cancel
Save