add pkg_setup to webbump

This commit is contained in:
fabolous005 2025-12-29 04:19:00 +01:00
parent 0d359c9665
commit 90342fd0c3

View File

@ -24,3 +24,18 @@ src_install() {
find "${ED}/etc/webbump/" -type f -exec chmod 0755 {} + find "${ED}/etc/webbump/" -type f -exec chmod 0755 {} +
} }
pkg_setup() {
local venv_dir="/var/lib/webbump/venv"
if [[ ! -d "$venv_dir" ]]; then
einfo "Creating Python virtualenv at $venv_dir"
python3 -m venv "$venv_dir"
einfo "Installing dependencies into venv"
"$venv_dir/bin/pip" install --upgrade pip
"$venv_dir/bin/pip" install flask
else
einfo "Virtualenv already exists at $venv_dir"
fi
}