rules 1.9 KB

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