initial import
This commit is contained in:
133
freenginx/PKGBUILD
Normal file
133
freenginx/PKGBUILD
Normal file
@@ -0,0 +1,133 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
# Based on nginx package
|
||||
|
||||
pkgname=freenginx
|
||||
pkgver=1.26.0
|
||||
pkgrel=1
|
||||
pkgdesc="Lightweight, free and libre HTTP server and IMAP/POP3 proxy server"
|
||||
arch=('i686' 'x86_64')
|
||||
url='https://freenginx.org'
|
||||
license=('Simplified-BSD')
|
||||
depends=('pcre' 'zlib' 'libressl' 'geoip')
|
||||
makedepends=('quilt')
|
||||
optdepends=('logger: message logging support')
|
||||
backup=('etc/freenginx/fastcgi.conf'
|
||||
'etc/freenginx/fastcgi_params'
|
||||
'etc/freenginx/koi-win'
|
||||
'etc/freenginx/koi-utf'
|
||||
'etc/freenginx/mime.types'
|
||||
'etc/freenginx/freenginx.conf'
|
||||
'etc/freenginx/scgi_params'
|
||||
'etc/freenginx/uwsgi_params'
|
||||
'etc/freenginx/win-utf'
|
||||
'etc/logrotate.d/freenginx'
|
||||
'etc/conf.d/freenginx')
|
||||
conflicts=('nginx')
|
||||
replaces=('nginx')
|
||||
source=("https://freenginx.org/download/${pkgname}-${pkgver}.tar.gz"{,.asc}
|
||||
"logrotate"
|
||||
"freenginx.confd"
|
||||
"freenginx.initd"
|
||||
"freenginx.run")
|
||||
sha512sums=('5804671c8195c00cb52440585dd84d3fb77964624a8154e2f8c523f859c3d2bd0e35872945acbb3b2edd53c6789938e059208cac8463ff87f1be07b17ca99164'
|
||||
'SKIP'
|
||||
'e058ff261ab5b810faa39526113553fc560b811b01879998d15fbde9ea4827662b007181f15c94daf4174584cece0327b6b4a143a034e1fb7f97484b5b401672'
|
||||
'26ad9c7577286ae4e095991344c6d1abcab32e3f5e71ed53ae6eb53193e2447d52026ef0182750797c226f49bcc5fdf8c62698e90c4ef0d8eafff92bfdd5ed83'
|
||||
'9fd98df5970358cf5a14e7511028d2c7e4f0d8cc5357d92280ca0adcdf6ef26875963a5c6c552fd4e6969a3a795b7258ea057c1df7941ced169864145469c859'
|
||||
'58024c8091f101bb5f4a5cfbfb77259f0f620ec858e680543c8c2d2a114fa9ce33c08bf8c0fbc8c047704e92106cd717f4526d868054784a2f9676f73566aff9')
|
||||
validpgpkeys=('B0F4253373F8F6F510D42178520A9993A1C052F8') # Maxim Dounin <mdounin@mdounin.ru>
|
||||
|
||||
_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=(
|
||||
)
|
||||
|
||||
build() {
|
||||
cd "${pkgname}-${pkgver}"
|
||||
|
||||
./configure \
|
||||
--prefix=/etc/freenginx \
|
||||
--conf-path=/etc/freenginx/freenginx.conf \
|
||||
--sbin-path=/usr/sbin/freenginx \
|
||||
--pid-path=/run/freenginx.pid \
|
||||
--lock-path=/run/lock/freenginx.lock \
|
||||
--user=http \
|
||||
--group=http \
|
||||
--http-log-path=/var/log/freenginx/access.log \
|
||||
--error-log-path=stderr \
|
||||
--http-client-body-temp-path=/var/lib/freenginx/client-body \
|
||||
--http-proxy-temp-path=/var/lib/freenginx/proxy \
|
||||
--http-fastcgi-temp-path=/var/lib/freenginx/fastcgi \
|
||||
--http-scgi-temp-path=/var/lib/freenginx/scgi \
|
||||
--http-uwsgi-temp-path=/var/lib/freenginx/uwsgi \
|
||||
${_common_flags[@]} \
|
||||
${_stable_flags[@]}
|
||||
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${pkgname}-${pkgver}"
|
||||
make DESTDIR="${pkgdir}" install
|
||||
|
||||
sed -e 's|\<user\s\+\w\+;|user html;|g' \
|
||||
-e '44s|html|/usr/share/freenginx/html|' \
|
||||
-e '54s|html|/usr/share/freenginx/html|' \
|
||||
-i "${pkgdir}/etc/freenginx/freenginx.conf"
|
||||
|
||||
rm "${pkgdir}"/etc/freenginx/*.default
|
||||
|
||||
install -d "${pkgdir}/var/lib/freenginx"
|
||||
install -dm700 "${pkgdir}/var/lib/freenginx/proxy"
|
||||
|
||||
chmod 755 "${pkgdir}/var/log/freenginx"
|
||||
chown root:root "${pkgdir}/var/log/freenginx"
|
||||
|
||||
install -d "${pkgdir}/usr/share/freenginx"
|
||||
mv "${pkgdir}"/etc/freenginx/html/ "${pkgdir}"/usr/share/freenginx
|
||||
touch "${pkgdir}"/usr/share/freenginx/html/favicon.ico
|
||||
|
||||
install -Dm644 "${srcdir}/logrotate" "${pkgdir}/etc/logrotate.d/freenginx"
|
||||
install -Dm644 "${srcdir}/freenginx.confd" "${pkgdir}/etc/conf.d/freenginx"
|
||||
install -Dm755 "${srcdir}/freenginx.initd" "${pkgdir}/etc/init.d/freenginx"
|
||||
install -Dm755 "${srcdir}/freenginx.run" "${pkgdir}/etc/sv/freenginx/run"
|
||||
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
||||
|
||||
rmdir "${pkgdir}"/run
|
||||
|
||||
install -Dm644 man/nginx.8 -t "${pkgdir}/usr/share/man/man8"
|
||||
|
||||
for i in ftdetect indent syntax; do
|
||||
install -Dm644 contrib/vim/$i/nginx.vim "${pkgdir}/usr/share/vim/vimfiles/$i/nginx.vim"
|
||||
done
|
||||
}
|
||||
32
freenginx/freenginx.confd
Normal file
32
freenginx/freenginx.confd
Normal file
@@ -0,0 +1,32 @@
|
||||
# /etc/conf.d/freenginx
|
||||
|
||||
# Configuration file
|
||||
#FREENGINX_CONFIGFILE="/etc/freenginx/freenginx.conf"
|
||||
|
||||
# PID file
|
||||
# If you should ever change this, remember to update
|
||||
# "/etc/logrotate.d/freenginx", too.
|
||||
#FREENGINX_PIDFILE="/run/freenginx.pid"
|
||||
|
||||
# User to run freenginx as
|
||||
# If you should ever change this, make sure this user has
|
||||
# execution permission on any of your log directories
|
||||
# (/var/log/freenginx per default) but do NOT forget other log directories
|
||||
# one of your vhost(s) maybe using or logging after logrotation will
|
||||
# be broken).
|
||||
#FREENGINX_USER="freenginx"
|
||||
|
||||
# Group to run freenginx as
|
||||
# See the note above regarding FREENGINX_USER.
|
||||
#FREENGINX_GROUP="freenginx"
|
||||
|
||||
# You can use this configuration option to pass additional options to the
|
||||
# start-stop-daemon, see start-stop-daemon(8) for more details.
|
||||
# Per default we wait 1000ms after we have started the service to ensure
|
||||
# that the daemon is really up and running.
|
||||
#FREENGINX_SSDARGS="--wait 1000"
|
||||
|
||||
# The termination timeout (start-stop-daemon parameter "retry") ensures
|
||||
# that the service will be terminated within a given time (60 + 5 seconds
|
||||
# per default) when you are stopping the service.
|
||||
#FREENGINX_TERMTIMEOUT="TERM/60/KILL/5"
|
||||
92
freenginx/freenginx.initd
Normal file
92
freenginx/freenginx.initd
Normal file
@@ -0,0 +1,92 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2017 Gentoo Foundation
|
||||
# Copyright 2018 Hyperbola Project
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
extra_commands="configtest"
|
||||
extra_started_commands="upgrade reload"
|
||||
|
||||
description="Robust, small and high performance http and reverse proxy server"
|
||||
description_configtest="Run freenginx' internal config check."
|
||||
description_upgrade="Upgrade the freenginx binary without losing connections."
|
||||
description_reload="Reload the freenginx configuration without losing connections."
|
||||
|
||||
FREENGINX_CONFIGFILE=${FREENGINX_CONFIGFILE:-/etc/freenginx/freenginx.conf}
|
||||
|
||||
command="/usr/sbin/freenginx"
|
||||
command_args="-c \"${FREENGINX_CONFIGFILE}\""
|
||||
start_stop_daemon_args=${FREENGINX_SSDARGS:-"--wait 1000"}
|
||||
pidfile=${FREENGINX_PIDFILE:-/run/freenginx.pid}
|
||||
user=${FREENGINX_USER:-freenginx}
|
||||
group=${FREENGINX_GROUP:-freenginx}
|
||||
retry=${FREENGINX_TERMTIMEOUT:-"TERM/60/KILL/5"}
|
||||
|
||||
depend() {
|
||||
use net dns logger netmount
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
if [ "${RC_CMD}" != "restart" ]; then
|
||||
configtest || return 1
|
||||
fi
|
||||
}
|
||||
|
||||
stop_pre() {
|
||||
if [ "${RC_CMD}" = "restart" ]; then
|
||||
configtest || return 1
|
||||
fi
|
||||
}
|
||||
|
||||
stop_post() {
|
||||
rm -f ${pidfile}
|
||||
}
|
||||
|
||||
reload() {
|
||||
configtest || return 1
|
||||
ebegin "Refreshing freenginx' configuration"
|
||||
start-stop-daemon --signal SIGHUP --pidfile "${pidfile}"
|
||||
eend $? "Failed to reload freenginx"
|
||||
}
|
||||
|
||||
upgrade() {
|
||||
configtest || return 1
|
||||
ebegin "Upgrading freenginx"
|
||||
|
||||
einfo "Sending USR2 to old binary"
|
||||
start-stop-daemon --signal SIGUSR2 --pidfile "${pidfile}"
|
||||
|
||||
einfo "Sleeping 3 seconds before pid-files checking"
|
||||
sleep 3
|
||||
|
||||
if [ ! -f "${pidfile}.oldbin" ]; then
|
||||
eerror "File with old pid not found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ ! -f "${pidfile}" ]; then
|
||||
eerror "New binary failed to start"
|
||||
return 1
|
||||
fi
|
||||
|
||||
einfo "Sleeping 3 seconds before WINCH"
|
||||
sleep 3
|
||||
# Cannot send "WINCH" using start-stop-daemon yet, https://bugs.gentoo.org/604986
|
||||
kill -WINCH $(cat "${pidfile}.oldbin")
|
||||
|
||||
einfo "Sending QUIT to old binary"
|
||||
start-stop-daemon --signal SIGQUIT --pidfile "${pidfile}.oldbin"
|
||||
|
||||
einfo "Upgrade completed"
|
||||
eend $? "Upgrade failed"
|
||||
}
|
||||
|
||||
configtest() {
|
||||
ebegin "Checking freenginx' configuration"
|
||||
${command} -c "${FREENGINX_CONFIGFILE}" -t -q
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
${command} -c "${FREENGINX_CONFIGFILE}" -t
|
||||
fi
|
||||
|
||||
eend $? "failed, please correct errors above"
|
||||
}
|
||||
2
freenginx/freenginx.run
Normal file
2
freenginx/freenginx.run
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec freenginx -g 'daemon off;'
|
||||
10
freenginx/logrotate
Normal file
10
freenginx/logrotate
Normal file
@@ -0,0 +1,10 @@
|
||||
/var/log/freenginx/*log {
|
||||
missingok
|
||||
notifempty
|
||||
create 640 http log
|
||||
sharedscripts
|
||||
compress
|
||||
postrotate
|
||||
test ! -r /run/freenginx.pid || kill -USR1 `cat /run/freenginx.pid`
|
||||
endscript
|
||||
}
|
||||
Reference in New Issue
Block a user