55
66# Ensure required tools are installed
77if ! command -v rpmbuild & > /dev/null; then
8- echo " Error: rpm-build is required to create RPM packages."
9- echo " Install it with: sudo dnf install rpm-build"
10- exit 1
8+ echo " Error: rpm-build is required to create RPM packages."
9+ echo " Install it with: sudo dnf install rpm-build"
10+ exit 1
1111fi
1212
1313if ! command -v ruby & > /dev/null; then
14- echo " Error: Ruby is required by FPM."
15- echo " Install it with: sudo dnf install ruby"
16- exit 1
14+ echo " Error: Ruby is required by FPM."
15+ echo " Install it with: sudo dnf install ruby"
16+ exit 1
1717fi
1818
1919if ! command -v fpm & > /dev/null; then
20- echo " Error: FPM (rubygem-fpm) is required to create RPM packages."
21- echo " Install it with: sudo gem install fpm"
22- exit 1
20+ echo " Error: FPM (rubygem-fpm) is required to create RPM packages."
21+ echo " Install it with: sudo gem install fpm"
22+ exit 1
2323fi
2424
2525arch=" $( uname -m) "
2626os=" $( uname -s | tr ' [:upper:]' ' [:lower:]' ) "
2727bin=" frankenphp-${os} -${arch} "
2828
2929if [ ! -f " dist/$bin " ]; then
30- echo " Error: $bin not found. Run './build-static.sh' first"
31- exit 1
30+ echo " Error: $bin not found. Run './build-static.sh' first"
31+ exit 1
3232fi
3333
3434if [[ ! " ${FRANKENPHP_VERSION} " =~ ^[0-9]+\. [0-9]+\. [0-9]+$ ]]; then
35- echo " Error: FRANKENPHP_VERSION must be set to X.Y.Z (e.g. 1.5.1), got '${FRANKENPHP_VERSION} '"
36- exit 1
35+ echo " Error: FRANKENPHP_VERSION must be set to X.Y.Z (e.g. 1.5.1), got '${FRANKENPHP_VERSION} '"
36+ exit 1
3737fi
3838
3939cat << EOF > dist/frankenphp.service
@@ -66,16 +66,16 @@ cat <<EOF > dist/Caddyfile
6666# https://caddyserver.com/docs/caddyfile
6767# https://frankenphp.dev/docs/config
6868{
69- # enable the frankenphp module, otherwise "php_server" and "php" directives do not work
70- frankenphp {
71- # optionally set max_threads, num_threads and create workers here
72- }
69+ # enable the frankenphp module, otherwise "php_server" and "php" directives do not work
70+ frankenphp {
71+ # optionally set max_threads, num_threads and create workers here
72+ }
7373}
7474
7575http:// {
76- root * /usr/share/caddy
77- php_server
78- file_server
76+ root * /usr/share/caddy
77+ php_server
78+ file_server
7979}
8080
8181# As an alternative to editing the above site block, you can add your own site
@@ -89,10 +89,10 @@ iteration="1"
8989cd dist
9090
9191fpm -s dir -t rpm -n frankenphp -v " ${FRANKENPHP_VERSION} " \
92- --config-files /etc/frankenphp/Caddyfile \
93- " $bin =/usr/bin/frankenphp" \
94- " ./frankenphp.service=/usr/lib/systemd/system/frankenphp.service" \
95- " ./Caddyfile=/etc/frankenphp/Caddyfile"
92+ --config-files /etc/frankenphp/Caddyfile \
93+ " $bin =/usr/bin/frankenphp" \
94+ " ./frankenphp.service=/usr/lib/systemd/system/frankenphp.service" \
95+ " ./Caddyfile=/etc/frankenphp/Caddyfile"
9696
9797rpm_file=" frankenphp-${FRANKENPHP_VERSION} -${iteration} .${arch} .rpm"
9898
0 commit comments