1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-24 20:10:42 +01:00

Add nginx package

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-10-03 16:29:25 +02:00
parent f3861b9df1
commit 8d75cb83fd
8 changed files with 243 additions and 0 deletions

View file

@ -3,6 +3,8 @@ TARGET="i686-linux-musl"
GCC_CPU="i686"
MUSL_CPU="i386"
CPU_IS_64BIT="no"
GCC_EXTRACFG="--disable-libmpx --disable-libssp"
LINUXPKG="linux"

View file

@ -3,6 +3,8 @@ TARGET="x86_64-linux-musl"
GCC_CPU="x86-64"
MUSL_CPU="x86_64"
CPU_IS_64BIT="yes"
GCC_EXTRACFG=""
LINUXPKG="linux"

View file

@ -3,6 +3,8 @@ TARGET="arm-linux-musleabihf"
GCC_CPU="armv6"
MUSL_CPU="arm"
CPU_IS_64BIT="no"
GCC_EXTRACFG="--with-float=hard --with-fpu=neon-vfpv3"
LINUXPKG="linux-rpi3"

60
pkg/nginx/0001.patch Normal file
View file

@ -0,0 +1,60 @@
diff --git a/auto/feature.old b/auto/feature
index 3561f59..d2cf977 100644
--- a/auto/feature
+++ b/auto/feature
@@ -50,55 +50,6 @@ eval "/bin/sh -c \"$ngx_test\" >> $NGX_AUTOCONF_ERR 2>&1"
if [ -x $NGX_AUTOTEST ]; then
case "$ngx_feature_run" in
-
- yes)
- # /bin/sh is used to intercept "Killed" or "Abort trap" messages
- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
- echo " found"
- ngx_found=yes
-
- if test -n "$ngx_feature_name"; then
- have=$ngx_have_feature . auto/have
- fi
-
- else
- echo " found but is not working"
- fi
- ;;
-
- value)
- # /bin/sh is used to intercept "Killed" or "Abort trap" messages
- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
- echo " found"
- ngx_found=yes
-
- cat << END >> $NGX_AUTO_CONFIG_H
-
-#ifndef $ngx_feature_name
-#define $ngx_feature_name `$NGX_AUTOTEST`
-#endif
-
-END
- else
- echo " found but is not working"
- fi
- ;;
-
- bug)
- # /bin/sh is used to intercept "Killed" or "Abort trap" messages
- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
- echo " not found"
-
- else
- echo " found"
- ngx_found=yes
-
- if test -n "$ngx_feature_name"; then
- have=$ngx_have_feature . auto/have
- fi
- fi
- ;;
-
*)
echo " found"
ngx_found=yes

45
pkg/nginx/0002.patch Normal file
View file

@ -0,0 +1,45 @@
diff --git a/auto/unix.old b/auto/unix
index 43d3b25..0e5ae5b 100644
--- a/auto/unix
+++ b/auto/unix
@@ -615,13 +615,5 @@ ngx_feature_libs=
# C types
-ngx_type="int"; . auto/types/sizeof
-
-ngx_type="long"; . auto/types/sizeof
-
-ngx_type="long long"; . auto/types/sizeof
-
-ngx_type="void *"; . auto/types/sizeof; ngx_ptr_size=$ngx_size
-ngx_param=NGX_PTR_SIZE; ngx_value=$ngx_size; . auto/types/value
# POSIX types
@@ -633,8 +627,6 @@ ngx_type="uint32_t"; ngx_types="u_int32_t"; . auto/types/typedef
ngx_type="uint64_t"; ngx_types="u_int64_t"; . auto/types/typedef
ngx_type="sig_atomic_t"; ngx_types="int"; . auto/types/typedef
-. auto/types/sizeof
-ngx_param=NGX_SIG_ATOMIC_T_SIZE; ngx_value=$ngx_size; . auto/types/value
ngx_type="socklen_t"; ngx_types="int"; . auto/types/typedef
@@ -642,17 +642,5 @@ ngx_type="rlim_t"; ngx_types="int"; . auto/types/typedef
. auto/endianness
-ngx_type="size_t"; . auto/types/sizeof
-ngx_param=NGX_MAX_SIZE_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
-ngx_param=NGX_SIZE_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
-
-ngx_type="off_t"; . auto/types/sizeof
-ngx_param=NGX_MAX_OFF_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
-ngx_param=NGX_OFF_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
-
-ngx_type="time_t"; . auto/types/sizeof
-ngx_param=NGX_TIME_T_SIZE; ngx_value=$ngx_size; . auto/types/value
-ngx_param=NGX_TIME_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
-ngx_param=NGX_MAX_TIME_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
# syscalls, libc calls and some features

30
pkg/nginx/0003.patch Normal file
View file

@ -0,0 +1,30 @@
diff --git a/auto/endianness.old b/auto/endianness
index 1b552b6..70cb141 100644
--- a/auto/endianness
+++ b/auto/endianness
@@ -26,25 +26,8 @@ int main(void) {
END
-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
-eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
-if [ -x $NGX_AUTOTEST ]; then
- if $NGX_AUTOTEST >/dev/null 2>&1; then
echo " little endian"
have=NGX_HAVE_LITTLE_ENDIAN . auto/have
- else
- echo " big endian"
- fi
-
rm -rf $NGX_AUTOTEST*
-
-else
- rm -rf $NGX_AUTOTEST*
-
- echo
- echo "$0: error: cannot detect system byte ordering"
- exit 1
-fi

91
pkg/nginx/build Executable file
View file

@ -0,0 +1,91 @@
VERSION="1.15.5"
SRCDIR="nginx-${VERSION}"
TARBALL="${SRCDIR}.tar.gz"
URL="https://nginx.org/download"
SHA256SUM="1a3a889a8f14998286de3b14cc1dd5b2747178e012d6d480a18aa413985dae6f"
DEPENDS="zlib openssl pcre"
prepare() {
apply_patches
}
build() {
cp -r ${1}/* ${PKGBUILDDIR}
./configure --prefix="" --sbin-path=/bin/nginx \
--modules-path=/lib/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=stderr \
--http-log-path=/dev/null \
--pid-path=/run/nginx.pid \
--lock-path=/run/nginx.lock \
--user=nobody --group=nogroup \
--crossbuild=${TARGET} \
--with-cc=${TCDIR}/bin/${TARGET}-gcc \
--with-cpp=${TCDIR}/bin/${TARGET}-cpp \
--with-poll_module --without-select_module \
--with-threads --with-http_ssl_module \
--with-http_sub_module --with-http_gunzip_module \
--with-http_gzip_static_module --with-http_slice_module
if [ "x$CPU_IS_64BIT" == "xyes" ]; then
cat <<_EOF >> objs/ngx_auto_config.h
#define NGX_PTR_SIZE (8)
#define NGX_SIZE_T_SIZE (8)
#define NGX_SIZE_T_LEN (sizeof("-9223372036854775807") - 1)
#define NGX_MAX_SIZE_T_VALUE ULONG_MAX
_EOF
else
cat <<_EOF >> objs/ngx_auto_config.h
#define NGX_PTR_SIZE (4)
#define NGX_SIZE_T_SIZE (4)
#define NGX_SIZE_T_LEN (sizeof("-2147483647") - 1)
#define NGX_MAX_SIZE_T_VALUE UINT_MAX
_EOF
fi
cat <<_EOF >> objs/ngx_auto_config.h
#define NGX_SIG_ATOMIC_T_SIZE (4)
#define NGX_TIME_T_SIZE (8)
#define NGX_TIME_T_LEN (sizeof("-9223372036854775807") - 1)
#define NGX_MAX_TIME_T_VALUE LONG_MAX
#define NGX_OFF_T_LEN (sizeof("-9223372036854775807") - 1)
#define NGX_MAX_OFF_T_VALUE LONG_MAX
_EOF
make -j $NUMJOBS
}
deploy() {
local SOURCE="$1"
local DEPLOY="$2"
local wwwroot=$(file_path_override "wwwroot")
make DESTDIR="$DEPLOY" install
cp "$SCRIPTDIR/pkg/$PKGNAME/rootfs_files.txt" "$DEPLOY"
if [ ! -z "$wwwroot" ] && [ -d "$wwwroot" ]; then
mkdir -p "$DEPLOY/srv"
cp -r "$wwwroot" "$DEPLOY/srv/www"
echo "srv m 555 0 0" >> "$DEPLOY/rootfs_files.txt"
echo "srv/www m 555 0 0" >> "$DEPLOY/rootfs_files.txt"
find "$DEPLOY/srv/www" -exec stat {} \
--printf="%n m %a 0 0\\n" \; | tail -n +2 | \
sed "s#^$DEPLOY/##g" >> "$DEPLOY/rootfs_files.txt"
fi
cat_file_override "nginx.conf" > "$DEPLOY/etc/nginx/nginx.conf"
}
check_update() {
curl --silent -L "$URL" | grep -o ">nginx-[0-9.]*tar.gz<" | \
sed 's/>nginx-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -0,0 +1,11 @@
bin/nginx m 555 0 0
etc/nginx m 755 0 0
etc/nginx/fastcgi.conf m 644 0 0
etc/nginx/fastcgi_params m 644 0 0
etc/nginx/koi-utf m 644 0 0
etc/nginx/koi-win m 644 0 0
etc/nginx/mime.types m 644 0 0
etc/nginx/nginx.conf m 644 0 0
etc/nginx/scgi_params m 644 0 0
etc/nginx/uwsgi_params m 644 0 0
etc/nginx/win-utf m 644 0 0