add nginx

This commit is contained in:
joborun linux 2022-06-24 22:10:40 +03:00
parent 9ac696e6ab
commit d44c62b3a7
10 changed files with 576 additions and 0 deletions

154
nginx/PKGBUILD Normal file
View file

@ -0,0 +1,154 @@
#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=nginx
pkgver=1.22.0
pkgrel=02
pkgdesc="Lightweight HTTP server and IMAP/POP3 proxy server w/o systemd or ipv6"
provides=("nginx=${pkgver}")
arch=(x86_64)
#url='https://github.com/cuber/ngx_http_google_filter_module'
url="http://nginx.org"
depends=(pcre2 zlib openssl geoip mailcap libxcrypt)
makedepends=(mercurial)
checkdepends=(perl perl-gd perl-io-socket-ssl perl-fcgi perl-cache-memcached
memcached ffmpeg)
backup=(etc/nginx/fastcgi.conf
etc/nginx/fastcgi_params
etc/nginx/koi-win
etc/nginx/koi-utf
etc/nginx/mime.types
etc/nginx/nginx.conf
etc/nginx/scgi_params
etc/nginx/uwsgi_params
etc/nginx/win-utf
etc/logrotate.d/nginx)
install=nginx.install
source=($url/download/${pkgname}-${pkgver}.tar.gz{,.asc}
hg+https://hg.nginx.org/nginx-tests#revision=34fc85598287
logrotate)
_common_flags=(
--with-compat
--with-debug
--with-file-aio
--with-http_addition_module
--with-http_auth_request_module
--with-http_dav_module
--with-http_degradation_module
--with-http_flv_module
--with-http_geoip_module
--with-http_gunzip_module
--with-http_gzip_static_module
--with-http_mp4_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_v2_module
--with-mail
--with-mail_ssl_module
--with-pcre-jit
--with-stream
--with-stream_geoip_module
--with-stream_realip_module
--with-stream_ssl_module
--with-stream_ssl_preread_module
--with-threads
)
_stable_flags=(
)
prepare() {
cp -r $pkgbase-$pkgver{,-src}
}
build() {
cd $pkgname-$pkgver
./configure \
--prefix=/etc/nginx \
--conf-path=/etc/nginx/nginx.conf \
--sbin-path=/usr/bin/nginx \
--pid-path=/run/nginx.pid \
--lock-path=/run/lock/nginx.lock \
--user=http \
--group=http \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=stderr \
--http-client-body-temp-path=/var/lib/nginx/client-body \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-scgi-temp-path=/var/lib/nginx/scgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--with-cc-opt="$CFLAGS $CPPFLAGS" \
--with-ld-opt="$LDFLAGS" \
${_common_flags[@]} \
${_stable_flags[@]}
make
}
check() {
cd nginx-tests
TEST_NGINX_BINARY="$srcdir/$pkgbase-$pkgver/objs/nginx" prove .
}
package() {
cd $pkgname-$pkgver
make DESTDIR="$pkgdir" install
sed -e 's|\<user\s\+\w\+;|user http;|g' \
-e '44s|html|/usr/share/nginx/html|' \
-e '54s|html|/usr/share/nginx/html|' \
-i "$pkgdir"/etc/nginx/nginx.conf
rm "$pkgdir"/etc/nginx/*.default
rm "$pkgdir"/etc/nginx/mime.types # in mailcap
install -d "$pkgdir"/var/lib/nginx
install -dm700 "$pkgdir"/var/lib/nginx/proxy
chmod 755 "$pkgdir"/var/log/nginx
chown root:root "$pkgdir"/var/log/nginx
install -d "$pkgdir"/usr/share/nginx
mv "$pkgdir"/etc/nginx/html/ "$pkgdir"/usr/share/nginx
install -Dm644 ../logrotate "$pkgdir"/etc/logrotate.d/nginx
# install -Dm644 ../google.conf "$pkgdir"/etc/nginx/google.conf
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
rmdir "$pkgdir"/run
install -d "$pkgdir"/usr/share/man/man8/
gzip -9c man/nginx.8 > "$pkgdir"/usr/share/man/man8/nginx.8.gz
for i in ftdetect ftplugin indent syntax; do
install -Dm644 contrib/vim/$i/nginx.vim \
"$pkgdir/usr/share/vim/vimfiles/$i/nginx.vim"
done
}
#---- license gpg-key sha256sums ----
license=(custom)
validpgpkeys=(B0F4253373F8F6F510D42178520A9993A1C052F8 # Maxim Dounin <mdounin@mdounin.ru>
13C82A63B603576156E30A4EA0EA981B66B0D967) # Konstantin Pavlov <thresh@nginx.com>
sha256sums=(b33d569a6f11a01433a57ce17e83935e953ad4dc77cdd4d40f896c88ac26eb53 # nginx-1.22.0.tar.gz
9aa5c5775d8fa435a235dc1aa2919cfb5fac6273db316949dfb489c4a1b40217 # nginx-1.22.0.tar.gz.asc
SKIP # nginx tests
06ebe161af3e761f2e2e35a67c6c0af27bf61aea7cd4ba8b28372ced5e3b3175) # logrotate

151
nginx/PKGBUILD-arch Normal file
View file

@ -0,0 +1,151 @@
# Maintainer: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Sébastien Luttringer
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Miroslaw Szot <mss@czlug.icis.pcz.pl>
# Contributor: Daniel Micay <danielmicay@gmail.com>
pkgbase=nginx
pkgname=(nginx nginx-src)
pkgver=1.22.0
pkgrel=2
pkgdesc='Lightweight HTTP server and IMAP/POP3 proxy server'
arch=(x86_64)
url='https://nginx.org'
license=(custom)
depends=(pcre2 zlib openssl geoip mailcap libxcrypt)
makedepends=(mercurial)
checkdepends=(perl perl-gd perl-io-socket-ssl perl-fcgi perl-cache-memcached
memcached ffmpeg)
backup=(etc/nginx/fastcgi.conf
etc/nginx/fastcgi_params
etc/nginx/koi-win
etc/nginx/koi-utf
etc/nginx/nginx.conf
etc/nginx/scgi_params
etc/nginx/uwsgi_params
etc/nginx/win-utf
etc/logrotate.d/nginx)
install=nginx.install
source=($url/download/nginx-$pkgver.tar.gz{,.asc}
hg+https://hg.nginx.org/nginx-tests#revision=34fc85598287
service
logrotate)
validpgpkeys=('B0F4253373F8F6F510D42178520A9993A1C052F8' # Maxim Dounin <mdounin@mdounin.ru>
'13C82A63B603576156E30A4EA0EA981B66B0D967') # Konstantin Pavlov <thresh@nginx.com>
sha512sums=('074782dba9cd5f8f493fbb57e20bda6dc9171814d919a47ee9f825d93f12c9f9d496e25d063c983191b55ad6a236bcef252ce16ecc1d253dc8b23433557559b1'
'SKIP'
'SKIP'
'be2858613d9cca85d80e7b894e9d5fa7892cbddd7a677d2d2f68f419d75fdc1f6802de8014f43ce063b116afd4ff17369873a6adea2dd58ac6f94e617de66fec'
'9232342c0914575ce438c5a8ee7e1c25b0befb457a2934e9cb77d1fe9a103634ea403b57bc0ef0cd6cf72248aee5e5584282cea611bc79198aeac9a65d8df5d7')
_common_flags=(
--with-compat
--with-debug
--with-file-aio
--with-http_addition_module
--with-http_auth_request_module
--with-http_dav_module
--with-http_degradation_module
--with-http_flv_module
--with-http_geoip_module
--with-http_gunzip_module
--with-http_gzip_static_module
--with-http_mp4_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_v2_module
--with-mail
--with-mail_ssl_module
--with-pcre-jit
--with-stream
--with-stream_geoip_module
--with-stream_realip_module
--with-stream_ssl_module
--with-stream_ssl_preread_module
--with-threads
)
_stable_flags=(
)
prepare() {
cp -r $pkgbase-$pkgver{,-src}
}
build() {
cd $pkgbase-$pkgver
./configure \
--prefix=/etc/nginx \
--conf-path=/etc/nginx/nginx.conf \
--sbin-path=/usr/bin/nginx \
--pid-path=/run/nginx.pid \
--lock-path=/run/lock/nginx.lock \
--user=http \
--group=http \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=stderr \
--http-client-body-temp-path=/var/lib/nginx/client-body \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-scgi-temp-path=/var/lib/nginx/scgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--with-cc-opt="$CFLAGS $CPPFLAGS" \
--with-ld-opt="$LDFLAGS" \
${_common_flags[@]} \
${_stable_flags[@]}
make
}
check() {
cd nginx-tests
TEST_NGINX_BINARY="$srcdir/$pkgbase-$pkgver/objs/nginx" prove .
}
package_nginx() {
cd $pkgbase-$pkgver
make DESTDIR="$pkgdir" install
sed -e 's|\<user\s\+\w\+;|user http;|g' \
-e '44s|html|/usr/share/nginx/html|' \
-e '54s|html|/usr/share/nginx/html|' \
-i "$pkgdir"/etc/nginx/nginx.conf
rm "$pkgdir"/etc/nginx/*.default
rm "$pkgdir"/etc/nginx/mime.types # in mailcap
install -d "$pkgdir"/var/lib/nginx
install -dm700 "$pkgdir"/var/lib/nginx/proxy
chmod 755 "$pkgdir"/var/log/nginx
chown root:root "$pkgdir"/var/log/nginx
install -d "$pkgdir"/usr/share/nginx
mv "$pkgdir"/etc/nginx/html/ "$pkgdir"/usr/share/nginx
install -Dm644 ../logrotate "$pkgdir"/etc/logrotate.d/nginx
install -Dm644 ../service "$pkgdir"/usr/lib/systemd/system/nginx.service
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
rmdir "$pkgdir"/run
install -d "$pkgdir"/usr/share/man/man8/
gzip -9c man/nginx.8 > "$pkgdir"/usr/share/man/man8/nginx.8.gz
for i in ftdetect ftplugin indent syntax; do
install -Dm644 contrib/vim/$i/nginx.vim \
"$pkgdir/usr/share/vim/vimfiles/$i/nginx.vim"
done
}
package_nginx-src() {
pkgdesc="Source code of nginx $pkgver, useful for building modules"
depends=()
install -d "$pkgdir/usr/src"
cp -r $pkgbase-$pkgver-src "$pkgdir/usr/src/nginx"
}

1
nginx/clean Normal file
View file

@ -0,0 +1 @@
rm -rf {src,pkg,nginx-1.*.tar.gz*,nginx-tests}

176
nginx/configure vendored Normal file
View file

@ -0,0 +1,176 @@
--help print this message
--prefix=PATH set installation prefix
--sbin-path=PATH set nginx binary pathname
--modules-path=PATH set modules path
--conf-path=PATH set nginx.conf pathname
--error-log-path=PATH set error log pathname
--pid-path=PATH set nginx.pid pathname
--lock-path=PATH set nginx.lock pathname
--user=USER set non-privileged user for
worker processes
--group=GROUP set non-privileged group for
worker processes
--build=NAME set build name
--builddir=DIR set build directory
--with-select_module enable select module
--without-select_module disable select module
--with-poll_module enable poll module
--without-poll_module disable poll module
--with-threads enable thread pool support
--with-file-aio enable file AIO support
--with-http_ssl_module enable ngx_http_ssl_module
--with-http_v2_module enable ngx_http_v2_module
--with-http_realip_module enable ngx_http_realip_module
--with-http_addition_module enable ngx_http_addition_module
--with-http_xslt_module enable ngx_http_xslt_module
--with-http_xslt_module=dynamic enable dynamic ngx_http_xslt_module
--with-http_image_filter_module enable ngx_http_image_filter_module
--with-http_image_filter_module=dynamic
enable dynamic ngx_http_image_filter_module
--with-http_geoip_module enable ngx_http_geoip_module
--with-http_geoip_module=dynamic enable dynamic ngx_http_geoip_module
--with-http_sub_module enable ngx_http_sub_module
--with-http_dav_module enable ngx_http_dav_module
--with-http_flv_module enable ngx_http_flv_module
--with-http_mp4_module enable ngx_http_mp4_module
--with-http_gunzip_module enable ngx_http_gunzip_module
--with-http_gzip_static_module enable ngx_http_gzip_static_module
--with-http_auth_request_module enable ngx_http_auth_request_module
--with-http_random_index_module enable ngx_http_random_index_module
--with-http_secure_link_module enable ngx_http_secure_link_module
--with-http_degradation_module enable ngx_http_degradation_module
--with-http_slice_module enable ngx_http_slice_module
--with-http_stub_status_module enable ngx_http_stub_status_module
--without-http_charset_module disable ngx_http_charset_module
--without-http_gzip_module disable ngx_http_gzip_module
--without-http_ssi_module disable ngx_http_ssi_module
--without-http_userid_module disable ngx_http_userid_module
--without-http_access_module disable ngx_http_access_module
--without-http_auth_basic_module disable ngx_http_auth_basic_module
--without-http_mirror_module disable ngx_http_mirror_module
--without-http_autoindex_module disable ngx_http_autoindex_module
--without-http_geo_module disable ngx_http_geo_module
--without-http_map_module disable ngx_http_map_module
--without-http_split_clients_module disable ngx_http_split_clients_module
--without-http_referer_module disable ngx_http_referer_module
--without-http_rewrite_module disable ngx_http_rewrite_module
--without-http_proxy_module disable ngx_http_proxy_module
--without-http_fastcgi_module disable ngx_http_fastcgi_module
--without-http_uwsgi_module disable ngx_http_uwsgi_module
--without-http_scgi_module disable ngx_http_scgi_module
--without-http_grpc_module disable ngx_http_grpc_module
--without-http_memcached_module disable ngx_http_memcached_module
--without-http_limit_conn_module disable ngx_http_limit_conn_module
--without-http_limit_req_module disable ngx_http_limit_req_module
--without-http_empty_gif_module disable ngx_http_empty_gif_module
--without-http_browser_module disable ngx_http_browser_module
--without-http_upstream_hash_module
disable ngx_http_upstream_hash_module
--without-http_upstream_ip_hash_module
disable ngx_http_upstream_ip_hash_module
--without-http_upstream_least_conn_module
disable ngx_http_upstream_least_conn_module
--without-http_upstream_random_module
disable ngx_http_upstream_random_module
--without-http_upstream_keepalive_module
disable ngx_http_upstream_keepalive_module
--without-http_upstream_zone_module
disable ngx_http_upstream_zone_module
--with-http_perl_module enable ngx_http_perl_module
--with-http_perl_module=dynamic enable dynamic ngx_http_perl_module
--with-perl_modules_path=PATH set Perl modules path
--with-perl=PATH set perl binary pathname
--http-log-path=PATH set http access log pathname
--http-client-body-temp-path=PATH set path to store
http client request body temporary files
--http-proxy-temp-path=PATH set path to store
http proxy temporary files
--http-fastcgi-temp-path=PATH set path to store
http fastcgi temporary files
--http-uwsgi-temp-path=PATH set path to store
http uwsgi temporary files
--http-scgi-temp-path=PATH set path to store
http scgi temporary files
--without-http disable HTTP server
--without-http-cache disable HTTP cache
--with-mail enable POP3/IMAP4/SMTP proxy module
--with-mail=dynamic enable dynamic POP3/IMAP4/SMTP proxy module
--with-mail_ssl_module enable ngx_mail_ssl_module
--without-mail_pop3_module disable ngx_mail_pop3_module
--without-mail_imap_module disable ngx_mail_imap_module
--without-mail_smtp_module disable ngx_mail_smtp_module
--with-stream enable TCP/UDP proxy module
--with-stream=dynamic enable dynamic TCP/UDP proxy module
--with-stream_ssl_module enable ngx_stream_ssl_module
--with-stream_realip_module enable ngx_stream_realip_module
--with-stream_geoip_module enable ngx_stream_geoip_module
--with-stream_geoip_module=dynamic enable dynamic ngx_stream_geoip_module
--with-stream_ssl_preread_module enable ngx_stream_ssl_preread_module
--without-stream_limit_conn_module disable ngx_stream_limit_conn_module
--without-stream_access_module disable ngx_stream_access_module
--without-stream_geo_module disable ngx_stream_geo_module
--without-stream_map_module disable ngx_stream_map_module
--without-stream_split_clients_module
disable ngx_stream_split_clients_module
--without-stream_return_module disable ngx_stream_return_module
--without-stream_set_module disable ngx_stream_set_module
--without-stream_upstream_hash_module
disable ngx_stream_upstream_hash_module
--without-stream_upstream_least_conn_module
disable ngx_stream_upstream_least_conn_module
--without-stream_upstream_random_module
disable ngx_stream_upstream_random_module
--without-stream_upstream_zone_module
disable ngx_stream_upstream_zone_module
--with-google_perftools_module enable ngx_google_perftools_module
--with-cpp_test_module enable ngx_cpp_test_module
--add-module=PATH enable external module
--add-dynamic-module=PATH enable dynamic external module
--with-compat dynamic modules compatibility
--with-cc=PATH set C compiler pathname
--with-cpp=PATH set C preprocessor pathname
--with-cc-opt=OPTIONS set additional C compiler options
--with-ld-opt=OPTIONS set additional linker options
--with-cpu-opt=CPU build for the specified CPU, valid values:
pentium, pentiumpro, pentium3, pentium4,
athlon, opteron, sparc32, sparc64, ppc64
--without-pcre disable PCRE library usage
--with-pcre force PCRE library usage
--with-pcre=DIR set path to PCRE library sources
--with-pcre-opt=OPTIONS set additional build options for PCRE
--with-pcre-jit build PCRE with JIT compilation support
--without-pcre2 do not use PCRE2 library
--with-zlib=DIR set path to zlib library sources
--with-zlib-opt=OPTIONS set additional build options for zlib
--with-zlib-asm=CPU use zlib assembler sources optimized
for the specified CPU, valid values:
pentium, pentiumpro
--with-libatomic force libatomic_ops library usage
--with-libatomic=DIR set path to libatomic_ops library sources
--with-openssl=DIR set path to OpenSSL library sources
--with-openssl-opt=OPTIONS set additional build options for OpenSSL
--with-debug enable debug logging

10
nginx/deps Normal file
View file

@ -0,0 +1,10 @@
perl-gd
perl-io-socket-ssl
perl-fcgi
perl-cache-memcached
memcached
geoip
mailcap
mercurial
ffmpeg
jack2

42
nginx/google.conf Normal file
View file

@ -0,0 +1,42 @@
# vim: ft=nginx:
# Sample configuration for ngx_http_google_filter_module
# This file should be included in an `http` context
# See also: https://github.com/cuber/ngx_http_google_filter_module
server {
listen 80;
listen 443 ssl;
# You can generate self-signed certificate and key with one command:
# openssl req -x509 -newkey rsa:2048 -nodes -keyout google.example.org.key -out google.example.org.crt -days 30 -subj /CN=google.example.org/
# But it's strongly recommended to get a valid certificate.
server_name google.example.org;
ssl_certificate google.example.org.crt;
ssl_certificate_key google.example.org.key;
# Improve TLS performance and security
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1.2;
ssl_ciphers ECDHE+AES;
ssl_prefer_server_ciphers on;
# Google on!
location / {
google on;
google_scholar on;
google_language en;
}
# `resolver` is needed to resolve domains.
resolver 8.8.8.8;
# `upstream` can help you to avoid name resolving cost, decrease the
# possibility of google robot detection and proxy through some
# specific servers.
#upstream www.google.com {
# server 173.194.38.1:443;
# server 173.194.38.2:443;
# server 173.194.38.3:443;
# server 173.194.38.4:443;
#}
}

1
nginx/key Normal file
View file

@ -0,0 +1 @@
gpg --recv-keys A0EA981B66B0D967

10
nginx/logrotate Normal file
View file

@ -0,0 +1,10 @@
/var/log/nginx/*log {
missingok
notifempty
create 640 http log
sharedscripts
compress
postrotate
test ! -r /run/nginx.pid || kill -USR1 `cat /run/nginx.pid`
endscript
}

26
nginx/nginx.install Normal file
View file

@ -0,0 +1,26 @@
post_upgrade() {
if (( $(vercmp $2 1.2.7-4) <= 0 )); then
chmod 750 var/log/nginx
chown http:log var/log/nginx
fi
if (( $(vercmp $2 1.2.1-2) <= 0 )); then
echo ' >>> Since 1.2.1-2 several changes has been made in package:'
echo ' - *.conf files have been moved to /etc/nginx'
echo ' - /etc/conf.d/nginx has been removed'
echo ' Main configuration file is set to /etc/nginx/nginx.conf'
echo ' - access.log and error.log can be found in /var/log/nginx by default'
echo ' - bundled *.html files have been moved to /usr/share/nginx/html'
echo ' - /etc/nginx/{html,logs} symbolic links and *.default files have been removed'
fi
if (( $(vercmp $2 1.10.2-3) < 0)); then
chown root:root var/log/nginx
fi
if (( $(vercmp $2 1.10.3-2) < 0 )); then
chmod 755 var/log/nginx
echo ':: Security notice:'
echo ' - When additional log directories are used in /var/log/nginx make sure they'
echo ' are owned by root:root and have 755 set as permission to mitigate CVE-2016-1247'
fi
}

5
nginx/time Normal file
View file

@ -0,0 +1,5 @@
real 7m56.248s
user 2m55.472s
sys 0m18.013s