* mark python sqlite DEP opt and update .cache
[t2sde.git] / package / network / freenginx / freenginx.conf
blob16100b654b5dd0812dcec343ec76b9bb810e9710
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/freenginx/freenginx.conf
3 # Copyright (C) 2023 - 2024 The T2 SDE Project
4
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
7
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License version 2.
10 # --- T2-COPYRIGHT-NOTE-END ---
12 prepare_nginx_modules() {
13         local module=
14         local moddir=$builddir/nginx-modules
16         mkdir -pv $builddir/nginx-modules
17         for x in $(match_source_file -p | grep -v $pkg-$ver); do
18                 module=${x##*/} module=${module%%.tar.*}
20                 echo "[INFO] extracting nginx module $moddir"
21                 tar -C $moddir $taropt $x
23                 var_append confopt ' ' "--add-dynamic-module=$moddir/$module"
24         done
26 hook_add prepatch 5 prepare_nginx_modules
28 # make our build system find config options
29 # context here: grep sub_scripts scripts/functions.in
30 hook_add preconf 5 "ln -svf $builddir/$pkg-$ver/auto/{options,configure}"
32 nginx_fix_cross_integers() {
33         # TODO make a condition for 32 bits too
35         cat <<-EOF >> objs/ngx_auto_config.h
36         #ifndef NGX_PTR_SIZE
37         #define NGX_PTR_SIZE  8
38         #endif
40         #ifndef NGX_MAX_SIZE_T_VALUE
41         #define NGX_MAX_SIZE_T_VALUE  9223372036854775807LL
42         #endif
44         #ifndef NGX_SIZE_T_LEN
45         #define NGX_SIZE_T_LEN  (sizeof("-9223372036854775808") - 1)
46         #endif
48         #ifndef NGX_MAX_OFF_T_VALUE
49         #define NGX_MAX_OFF_T_VALUE  9223372036854775807LL
50         #endif
52         #ifndef NGX_OFF_T_LEN
53         #define NGX_OFF_T_LEN  (sizeof("-9223372036854775808") - 1)
54         #endif
56         #ifndef NGX_TIME_T_SIZE
57         #define NGX_TIME_T_SIZE  8
58         #endif
60         #ifndef NGX_TIME_T_LEN
61         #define NGX_TIME_T_LEN  (sizeof("-9223372036854775808") - 1)
62         #endif
64         #ifndef NGX_MAX_TIME_T_VALUE
65         #define NGX_MAX_TIME_T_VALUE  9223372036854775807LL
66         #endif
67         EOF
69 hook_add premake 5 "nginx_fix_cross_integers"
71 var_append confopt ' ' "
72         --user=$pkg \
73         --group=$pkg \
74         --prefix=$localstatedir/lib/$pkg \
75         --sbin-path=$sbindir/$pkg \
76         --conf-path=$sysconfdir/$pkg/$pkg.conf \
77         --pid-path=$localstatedir/run/$pkg/$pkg.pid \
78         --lock-path=$localstatedir/run/$pkg/$pkg.lock \
79         --error-log-path=stderr \
81         --with-threads \
82         --with-pcre-jit \
84         --without-mail \
85         --with-pcre2 \
87         --http-client-body-temp-path=$localstatedir/lib/$pkg/tmp/client_body \
88         --http-fastcgi-temp-path=$localstatedir/lib/$pkg/tmp/fastcgi \
89         --http-log-path=$localstatedir/log/nginx/access.log \
90         --http-proxy-temp-path=$localstatedir/lib/$pkg/tmp/proxy \
91         --http-scgi-temp-path=$localstatedir/lib/$pkg/tmp/scgi \
92         --http-uwsgi-temp-path=$localstatedir/lib/$pkg/tmp/uwsgi \
94         --with-file-aio \
95         --with-http_addition_module \
96         --with-http_auth_request_module \
97         --with-http_dav_module \
98         --with-http_degradation_module \
99         --with-http_flv_module \
100         --with-http_gunzip_module \
101         --with-http_gzip_static_module \
102         --with-http_mp4_module \
103         --with-http_random_index_module \
104         --with-http_realip_module \
105         --with-http_secure_link_module \
106         --with-http_slice_module \
107         --with-http_ssl_module \
108         --with-http_stub_status_module \
109         --with-http_sub_module \
110         --with-http_v2_module \
111         --with-http_xslt_module=dynamic \
113         --with-stream \
114         --with-stream=dynamic \
115         --with-stream_realip_module \
116         --with-stream_ssl_module \
117         --with-stream_ssl_preread_module
120 if pkginstalled libgd; then
121         var_append confopt ' ' --with-http_image_filter_module=dynamic
122 else
123         hook_add preconf 5 "rm -f $builddir/$pkg-$ver/src/http/modules/ngx_http_image_filter_module.c"
126 nginx_load_modules() {
127         mkdir -pv $root$sysconfdir/$pkg/modules
128         for x in $root$localstatedir/lib/$pkg/modules/*; do
129                 local module=${x##*/}
130                 echo "load_module \"modules/${x##*/}\";" > $root$sysconfdir/$pkg/modules/${module%%.so}.conf
131         done
133 hook_add postinstall 5 nginx_load_modules