Fixed build of module package
This commit is contained in:
@@ -84,7 +84,7 @@ prepare)
|
||||
--transform='s,^,nginx-mod-rewrite-'$pkg_ver'/modules/,'
|
||||
|
||||
tar -rf "tmpbuild/nginx-mod-rewrite-$pkg_ver.tar" \
|
||||
-C . LICENSE package_preparer.sh \
|
||||
-C . LICENSE package_preparer.sh extract_nginx_args.py \
|
||||
--transform='s,^,nginx-mod-rewrite-'$pkg_ver'/,'
|
||||
|
||||
gzip -f "tmpbuild/nginx-mod-rewrite-$pkg_ver.tar"
|
||||
@@ -176,14 +176,14 @@ installdeps)
|
||||
# Determine package manager and install nginx
|
||||
if command -v dnf >/dev/null 2>&1; then
|
||||
PKG_MGR="dnf"
|
||||
$PKG_MGR install -y nginx openssl-devel pcre-devel zlib-devel rpm-build gcc gcc-c++ make wget
|
||||
$PKG_MGR install -y nginx openssl-devel pcre-devel zlib-devel rpm-build gcc gcc-c++ make wget python3
|
||||
elif command -v yum >/dev/null 2>&1; then
|
||||
PKG_MGR="yum"
|
||||
$PKG_MGR install -y nginx openssl-devel pcre-devel zlib-devel rpm-build gcc gcc-c++ make wget
|
||||
$PKG_MGR install -y nginx openssl-devel pcre-devel zlib-devel rpm-build gcc gcc-c++ make wget python3
|
||||
elif command -v apt-get >/dev/null 2>&1; then
|
||||
PKG_MGR="apt-get"
|
||||
apt-get update
|
||||
$PKG_MGR install -y nginx debhelper-compat dh-autoreconf libssl-dev libpcre2-dev zlib1g-dev make gcc build-essential wget
|
||||
$PKG_MGR install -y nginx debhelper-compat dh-autoreconf libssl-dev libpcre2-dev zlib1g-dev make gcc build-essential wget python3
|
||||
else
|
||||
echo "Unsupported package manager."
|
||||
exit 1
|
||||
@@ -191,7 +191,7 @@ installdeps)
|
||||
;;
|
||||
installmod)
|
||||
if command -v dnf >/dev/null 2>&1 || command -v yum >/dev/null 2>&1; then
|
||||
mkdir -p /usr/share/nginx/modules /etc/nginx/modules
|
||||
mkdir -p /usr/share/nginx/modules /usr/lib64/nginx/modules/
|
||||
cp *.so /usr/lib64/nginx/modules/
|
||||
echo 'load_module "/usr/lib64/nginx/modules/ngx_http_apache_rewrite_module.so";' \
|
||||
> /usr/share/nginx/modules/ngx_http_apache_rewrite_module.conf
|
||||
@@ -209,14 +209,14 @@ packageprep)
|
||||
# Determine package manager and install nginx
|
||||
if command -v dnf >/dev/null 2>&1; then
|
||||
PKG_MGR="dnf"
|
||||
$PKG_MGR install -y nginx openssl-devel pcre-devel zlib-devel rpm-build gcc gcc-c++ make wget
|
||||
$PKG_MGR install -y nginx openssl-devel pcre-devel zlib-devel rpm-build gcc gcc-c++ make wget python3
|
||||
elif command -v yum >/dev/null 2>&1; then
|
||||
PKG_MGR="yum"
|
||||
$PKG_MGR install -y nginx openssl-devel pcre-devel zlib-devel rpm-build gcc gcc-c++ make wget
|
||||
$PKG_MGR install -y nginx openssl-devel pcre-devel zlib-devel rpm-build gcc gcc-c++ make wget python3
|
||||
elif command -v apt-get >/dev/null 2>&1; then
|
||||
PKG_MGR="apt-get"
|
||||
apt-get update
|
||||
$PKG_MGR install -y nginx debhelper-compat dh-autoreconf libssl-dev libpcre2-dev zlib1g-dev make gcc build-essential wget
|
||||
$PKG_MGR install -y nginx debhelper-compat dh-autoreconf libssl-dev libpcre2-dev zlib1g-dev make gcc build-essential wget python3
|
||||
else
|
||||
echo "Unsupported package manager."
|
||||
exit 1
|
||||
@@ -329,13 +329,6 @@ build)
|
||||
exit 1
|
||||
fi
|
||||
|
||||
NGINX_VER_OUTPUT=$(nginx -V 2>&1)
|
||||
CONFIG_ARGS=$(echo "$NGINX_VER_OUTPUT" | awk -F'configure arguments: ' '{print $2}')
|
||||
if [ -z "$CONFIG_ARGS" ]; then
|
||||
echo "Could not retrieve nginx configuration arguments."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Retrieved configure arguments: $CONFIG_ARGS"
|
||||
|
||||
# Change to nginx source directory
|
||||
@@ -346,9 +339,8 @@ build)
|
||||
fi
|
||||
cd "$SRC_DIR" || exit 1
|
||||
|
||||
# Run configure with saved arguments and add mod_rewrite
|
||||
read -ra CONFIG_ARRAY <<< "$CONFIG_ARGS"
|
||||
./configure "${CONFIG_ARRAY[@]}" --add-dynamic-module=../modules/mod_rewrite
|
||||
|
||||
python3 ../extract_nginx_args.py
|
||||
make modules
|
||||
cp objs/ngx_http_apache_rewrite_module.so ../
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user