-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
23 lines (23 loc) · 1.29 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
# building nginx unit php7.4 module in nginx/unit:1.27.0-minimal
# based on: Packaging Custom Modules - https://unit.nginx.org/howto/modules/
# Piotr Pazola <piotr@webtrip.pl>
export UNITTMP=$(mktemp -d -p /tmp -t unit.XXXXXX)
mkdir -p $UNITTMP/unit-php7.4/DEBIAN
cd $UNITTMP
curl -O https://unit.nginx.org/download/unit-1.27.0.tar.gz
tar xzf unit-1.27.0.tar.gz
cd unit-1.27.0
./configure --prefix=/usr --state=/var/lib/unit --control=unix:/var/run/control.unit.sock --pid=/var/run/unit.pid --log=/var/log/unit.log --tmp=/var/tmp --user=unit --group=unit --openssl --libdir=/usr/lib/x86_64-linux-gnu --cc-opt='-g -O2 -fdebug-prefix-map=/unit=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --modules=/usr/lib/unit/modules
./configure php --module=php7.4 --config=php-config
make php7.4
mkdir -p $UNITTMP/unit-php7.4/usr/lib/unit/modules
mv build/php7.4.unit.so $UNITTMP/unit-php7.4/usr/lib/unit/modules
echo 'Package: unit-php7.4
Version: 1.27.0
Architecture: amd64
Depends: php7.4-common, libphp7.4-embed
Maintainer: Piotr Pazola <piotr@webtrip.pl>
Description: PHP 7.4 language module for NGINX Unit 1.27.0' > $UNITTMP/unit-php7.4/DEBIAN/control
dpkg-deb -b $UNITTMP/unit-php7.4
cp $UNITTMP/unit-php7.4.deb /unit-php7.4.deb