rules 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/usr/bin/make -f
  2. # Uncomment to enable verbose debhelper output
  3. #export DH_VERBOSE = 1
  4. # This must match the binary package name in debian/control. Debian's
  5. # package staging directory is debian/<binary-package>, while the installed
  6. # application directory intentionally retains its existing capitalisation.
  7. PACKAGE = squidstats
  8. DESTDIR = $(CURDIR)/debian/$(PACKAGE)
  9. INSTALL_ROOT = /opt/SquidStats
  10. OPT_DIR = $(DESTDIR)$(INSTALL_ROOT)
  11. VENV_BUILD = $(CURDIR)/debian/.build-venv
  12. VENV_FINAL = $(INSTALL_ROOT)/venv
  13. VENV_DEST = $(OPT_DIR)/venv
  14. APP_DEST = $(OPT_DIR)/app
  15. %:
  16. dh $@
  17. override_dh_auto_build:
  18. @echo "=== No build step for SquidStats application package ==="
  19. override_dh_auto_install:
  20. # ── Application directories ───────────────────────────────────────────
  21. install -d $(APP_DEST)
  22. install -d $(DESTDIR)/etc/$(PACKAGE)
  23. install -d $(DESTDIR)/var/log/$(PACKAGE)
  24. install -d $(DESTDIR)/var/lib/$(PACKAGE)
  25. # ── Copy application source files ────────────────────────────────────
  26. cp app.py config.py manage_db.py alembic.ini babel.cfg $(APP_DEST)/
  27. cp requirements.txt $(APP_DEST)/
  28. cp -r alembic/ $(APP_DEST)/
  29. cp -r database/ $(APP_DEST)/
  30. cp -r parsers/ $(APP_DEST)/
  31. cp -r routes/ $(APP_DEST)/
  32. cp -r services/ $(APP_DEST)/
  33. cp -r static/ $(APP_DEST)/
  34. cp -r templates/ $(APP_DEST)/
  35. cp -r tools/ $(APP_DEST)/
  36. cp -r translations/ $(APP_DEST)/
  37. cp -r utils/ $(APP_DEST)/
  38. # ── Configuration template ───────────────────────────────────────────
  39. install -m 0640 example.env $(APP_DEST)/.env
  40. override_dh_auto_test:
  41. @echo "Tests are run in a separate CI stage; skipping here."
  42. # Prevent stripping of Python .so files (can break extensions)
  43. override_dh_strip:
  44. dh_strip --no-automatic-dbgsym
  45. override_dh_fixperms:
  46. dh_fixperms
  47. # Config file must not be world-readable (may contain secrets)
  48. chmod 0640 $(APP_DEST)/.env 2>/dev/null || true