-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinpack.toml
110 lines (103 loc) · 3.67 KB
/
inpack.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
[project]
name = "openresty"
version = "1.19.3.2"
vendor = "openresty.org"
homepage = "http://openresty.org/"
description = "Dynamic web platform based on NGINX and LuaJIT"
groups = ["dev/sys-srv"]
[files]
[scripts]
build = """PREFIX=\"/opt/openresty/openresty\"
cd {{.inpack__pack_dir}}/deps
if [ ! -f \"openresty-{{.project__version}}.tar.gz\" ]; then
wget https://openresty.org/download/openresty-{{.project__version}}.tar.gz
fi
if [ -d \"openresty-{{.project__version}}\" ]; then
rm -rf openresty-{{.project__version}}
fi
tar -zxf openresty-{{.project__version}}.tar.gz
if [ ! -f \"pcre-8.44.tar.gz\" ]; then
wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
fi
if [ -d \"pcre-8.44\" ]; then
rm -rf pcre-8.44
fi
tar -zxf pcre-8.44.tar.gz
## if [ ! -f \"openssl-1.1.1h.tar.gz\" ]; then
## wget https://www.openssl.org/source/openssl-1.1.1h.tar.gz
## fi
## if [ -d \"openssl-1.1.1h\" ]; then
## rm -fr openssl-1.1.1h
## fi
## tar -zxf openssl-1.1.1h.tar.gz
cd openresty-{{.project__version}}
./configure \
--user=action \
--group=action \
--with-compat \
--with-pcre-jit \
--with-luajit \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_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_gunzip_module \
--with-http_gzip_static_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_sub_module \
--with-http_v2_module \
--with-stream \
--with-stream_ssl_module \
--with-stream_ssl_preread_module \
--with-stream_realip_module \
--with-threads \
--with-file-aio \
--prefix=$PREFIX \
--sbin-path=$PREFIX/bin/nginx \
--conf-path=$PREFIX/conf/nginx.conf \
--http-log-path=$PREFIX/var/log/openresty.access.log \
--error-log-path=$PREFIX/var/log/openresty.error.log \
--with-luajit-xcflags='-DLUAJIT_ENABLE_LUA52COMPAT' \
--pid-path=$PREFIX/var/run.openresty.pid \
--with-pcre=../pcre-8.44 \
-j2
## --with-openssl=../openssl-1.1.1h \
make -j2
des_tmp=/tmp/openresty_build_tmp
mkdir -p $des_tmp
sed -i 's/\\tln\\ \\-sf/#\\tln\\ \\-sf/g' Makefile
make install DESTDIR=$des_tmp
rm -rf {{.buildroot}}/*
mkdir -p {{.buildroot}}/{bin,conf/conf.d,var/log,luajit}
mkdir -p {{.buildroot}}/nginx/{html,client_body_temp,fastcgi_temp,proxy_temp,scgi_temp,uwsgi_temp}
install $des_tmp/$PREFIX/bin/nginx {{.buildroot}}/bin/nginx
strip -s {{.buildroot}}/bin/nginx
mv $des_tmp/$PREFIX/lualib {{.buildroot}}/
mv $des_tmp/$PREFIX/luajit/lib {{.buildroot}}/luajit/
rm -f {{.buildroot}}/luajit/lib/*.a
rm -rf {{.buildroot}}/luajit/lib/lua
rm -rf {{.buildroot}}/luajit/lib/pkgconfig
cp -rp $des_tmp/$PREFIX/conf/* {{.buildroot}}/conf/
rm -f {{.buildroot}}/conf/*.default
cd {{.inpack__pack_dir}}
cp -rp misc/nginx.conf.tpl {{.buildroot}}/conf/nginx.conf
sed -i 's/{\\[worker_processes\\]}/1/g' {{.buildroot}}/conf/nginx.conf
sed -i 's/{\\[events_worker_connections\\]}/8192/g' {{.buildroot}}/conf/nginx.conf
sed -i 's/{\\[http_server_default_listen\\]}/80/g' {{.buildroot}}/conf/nginx.conf
install {{.buildroot}}/conf/nginx.conf {{.buildroot}}/conf/nginx.conf.default
install misc/index.html {{.buildroot}}/nginx/html/index.html
install misc/50x.html {{.buildroot}}/nginx/html/50x.html
install misc/404.html {{.buildroot}}/nginx/html/404.html
cd {{.inpack__pack_dir}}/deps
rm -rf openresty-{{.project__version}}
rm -rf pcre-8.44
"""