Skip to content

Commit

Permalink
Update build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ononoki1 authored Feb 22, 2024
1 parent 2327a25 commit 8952988
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ echo deb http://deb.debian.org/debian bullseye-backports main >> /etc/apt/source
apt-get update > /dev/null 2>&1
apt-get install --allow-change-held-packages --allow-downgrades --allow-remove-essential \
-o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold -fy \
cmake curl git libmaxminddb-dev ninja-build wget zlib1g-dev > /dev/null 2>&1
apt-get install --allow-change-held-packages --allow-downgrades --allow-remove-essential \
-o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold -fy \
-t bullseye-backports golang > /dev/null 2>&1
cmake curl git libmaxminddb-dev wget zlib1g-dev > /dev/null 2>&1
wget -qO /etc/apt/trusted.gpg.d/nginx_signing.asc https://nginx.org/keys/nginx_signing.key
echo deb-src https://nginx.org/packages/mainline/debian bullseye nginx \
>> /etc/apt/sources.list
Expand All @@ -21,17 +18,8 @@ nginx > /dev/null 2>&1
echo Fetch NGINX source code.
apt-get source nginx > /dev/null 2>&1
cd nginx-*
curl -sL https://raw.githubusercontent.com/kn007/patch/master/Enable_BoringSSL_OCSP.patch \
| patch -p1 > /dev/null 2>&1
echo Fetch boringssl source code.
mkdir debian/modules
cd debian/modules
git clone --depth 1 --recursive https://github.com/google/boringssl > /dev/null 2>&1
echo Build boringssl.
mkdir boringssl/build
cd boringssl/build
cmake -GNinja .. > /dev/null 2>&1
ninja -j$(nproc) > /dev/null 2>&1
echo Fetch additional dependencies.
cd ../..
git clone --depth 1 --recursive https://github.com/google/ngx_brotli > /dev/null 2>&1
Expand All @@ -46,9 +34,7 @@ git clone --depth 1 --recursive https://github.com/openresty/headers-more-nginx-
echo Build nginx.
cd ..
sed -i 's|NGINX Packaging <[email protected]>|ononoki <[email protected]>|g' control
sed -i 's|CFLAGS=""|CFLAGS="-Wno-ignored-qualifiers"|g' rules
sed -i 's|--sbin-path=/usr/sbin/nginx|--sbin-path=/usr/sbin/nginx --add-module=$(CURDIR)/debian/modules/ngx_brotli --add-module=$(CURDIR)/debian/modules/ngx_http_geoip2_module --add-module=$(CURDIR)/debian/modules/headers-more-nginx-module|g' rules
sed -i 's|--with-cc-opt="$(CFLAGS)" --with-ld-opt="$(LDFLAGS)"|--with-cc-opt="-I../modules/boringssl/include $(CFLAGS)" --with-ld-opt="-L../modules/boringssl/build/ssl -L../modules/boringssl/build/crypto $(LDFLAGS)"|g' rules
sed -i 's|--http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx|--user=www-data --group=www-data|g' rules
sed -i 's|--with-compat||g' rules
sed -i 's|--with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module|--with-http_ssl_module|g' rules
Expand Down

0 comments on commit 8952988

Please sign in to comment.