Просмотр исходного кода

'scripts/install' ändern

change the ftl install
yuno admin 4 месяцев назад
Родитель
Сommit
773d45f98c
1 измененных файлов с 29 добавлено и 2 удалено
  1. 29 2
      scripts/install

+ 29 - 2
scripts/install

@@ -42,13 +42,40 @@ chown "$dnsmasq_user:root" /var/log/{pihole,pihole-FTL}.log
 #=================================================
 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"
     ynh_exec_warn_less cmake .
-    ynh_exec_warn_less make
+    ynh_exec_warn_less make -j"$(nproc)"
     ynh_exec_warn_less make install
 popd
+
 ynh_secure_remove --file="$install_dir/ftl"
+ynh_secure_remove --file="$mbedtls_dir"
+
 
 #=================================================
 # INSTALL THE SCRIPTS