diff --git a/debian/install b/debian/install index 3df76d3..1032039 100644 --- a/debian/install +++ b/debian/install @@ -1,6 +1,7 @@ src/sensorpajen/*.py opt/sensorpajen/src/sensorpajen/ scripts/approve-sensors.sh opt/sensorpajen/scripts/ pyproject.toml opt/sensorpajen/ +requirements.txt opt/sensorpajen/ readme.md usr/share/doc/sensorpajen/ INSTALL.md usr/share/doc/sensorpajen/ ROADMAP.md usr/share/doc/sensorpajen/ diff --git a/debian/postinst b/debian/postinst index bf90997..42c5b1c 100755 --- a/debian/postinst +++ b/debian/postinst @@ -42,11 +42,19 @@ case "$1" in venv/bin/pip install --upgrade pip setuptools wheel fi - # Install Python dependencies from pyproject.toml + # Install Python dependencies from requirements.txt echo "Installing Python dependencies..." - venv/bin/pip install -e . || { - echo "Warning: pip install failed. You may need to install dependencies manually." - } + if [ -f "/opt/sensorpajen/requirements.txt" ]; then + venv/bin/pip install -r /opt/sensorpajen/requirements.txt + else + echo "Warning: requirements.txt not found, installing bluepy and paho-mqtt directly" + venv/bin/pip install bluepy paho-mqtt + fi + + if [ $? -ne 0 ]; then + echo "Error: Failed to install dependencies" + exit 1 + fi # Set Bluetooth capabilities on Python executable PYTHON_PATH=$(readlink -f /opt/sensorpajen/venv/bin/python3)