|
@@ -42,13 +42,40 @@ chown "$dnsmasq_user:root" /var/log/{pihole,pihole-FTL}.log
|
|
|
#=================================================
|
|
#=================================================
|
|
|
ynh_script_progression --message="Building PiHole-FTL..." --weight=30
|
|
ynh_script_progression --message="Building PiHole-FTL..." --weight=30
|
|
|
|
|
|
|
|
-# Instead of downloading a binary file, we're going to compile it
|
|
|
|
|
|
|
+# -------------------------------------------------
|
|
|
|
|
+# Build & install mbedTLS >= 3.x (required for FTL v6 on Debian 12)
|
|
|
|
|
+# -------------------------------------------------
|
|
|
|
|
+mbedtls_dir="$install_dir/mbedtls"
|
|
|
|
|
+ynh_setup_source --source_id="mbedtls" --dest_dir="$mbedtls_dir"
|
|
|
|
|
+
|
|
|
|
|
+# Enable pthread support (required by Pi-hole)
|
|
|
|
|
+sed -i '/#define MBEDTLS_THREADING_C/s@^//@@' "$mbedtls_dir/include/mbedtls/mbedtls_config.h"
|
|
|
|
|
+sed -i '/#define MBEDTLS_THREADING_PTHREAD/s@^//@@' "$mbedtls_dir/include/mbedtls/mbedtls_config.h"
|
|
|
|
|
+
|
|
|
|
|
+pushd "$mbedtls_dir"
|
|
|
|
|
+ ynh_exec_warn_less make -j"$(nproc)"
|
|
|
|
|
+ ynh_exec_warn_less make install
|
|
|
|
|
+popd
|
|
|
|
|
+
|
|
|
|
|
+ldconfig
|
|
|
|
|
+
|
|
|
|
|
+# -------------------------------------------------
|
|
|
|
|
+# Build Pi-hole FTL against /usr/local (mbedTLS 3.x)
|
|
|
|
|
+# -------------------------------------------------
|
|
|
|
|
+export CMAKE_PREFIX_PATH="/usr/local:${CMAKE_PREFIX_PATH:-}"
|
|
|
|
|
+export CPATH="/usr/local/include:${CPATH:-}"
|
|
|
|
|
+export LIBRARY_PATH="/usr/local/lib:${LIBRARY_PATH:-}"
|
|
|
|
|
+export LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH:-}"
|
|
|
|
|
+
|
|
|
pushd "$install_dir/ftl"
|
|
pushd "$install_dir/ftl"
|
|
|
ynh_exec_warn_less cmake .
|
|
ynh_exec_warn_less cmake .
|
|
|
- ynh_exec_warn_less make
|
|
|
|
|
|
|
+ ynh_exec_warn_less make -j"$(nproc)"
|
|
|
ynh_exec_warn_less make install
|
|
ynh_exec_warn_less make install
|
|
|
popd
|
|
popd
|
|
|
|
|
+
|
|
|
ynh_secure_remove --file="$install_dir/ftl"
|
|
ynh_secure_remove --file="$install_dir/ftl"
|
|
|
|
|
+ynh_secure_remove --file="$mbedtls_dir"
|
|
|
|
|
+
|
|
|
|
|
|
|
|
#=================================================
|
|
#=================================================
|
|
|
# INSTALL THE SCRIPTS
|
|
# INSTALL THE SCRIPTS
|