Skip to content

Debian packaging: strip CRLF in maintainer scripts and relax libsagui dependency#17

Merged
Al-Muhandis merged 3 commits intomainfrom
codex/fix-post-installation-script-for-tgadmin
Mar 26, 2026
Merged

Debian packaging: strip CRLF in maintainer scripts and relax libsagui dependency#17
Al-Muhandis merged 3 commits intomainfrom
codex/fix-post-installation-script-for-tgadmin

Conversation

@Al-Muhandis
Copy link
Copy Markdown
Owner

Motivation

  • Prevent maintainer scripts from failing due to Windows CRLF line endings when copied into the Debian staging tree.
  • Make libsagui an optional recommended package instead of a hard dependency while still ensuring it is present at post-install configuration time.
  • Add package metadata Origin to the control file.

Description

  • Added normalize_maintainer_scripts() to build-deb.sh to strip \r line endings from DEBIAN/postinst and DEBIAN/postrm and call it after copying the debian directory into the staging tree.
  • Updated debian/DEBIAN/control to remove libsagui from Depends, add it under Recommends as libsagui2 | libsagui, and include an Origin field.
  • Enhanced debian/DEBIAN/postinst with a libsagui_available() check that uses ldconfig -p and added a pre-configuration validation that exits with an instructive error if the shared library is not found.

Testing

  • Ran the packaging script ./build-deb.sh to recreate the staging tree and confirm the maintainer scripts were normalized and staged files were created (succeeded).
  • Performed a shell syntax check with bash -n on the modified build-deb.sh and debian/DEBIAN/postinst scripts (succeeded).

Codex Task

@Al-Muhandis Al-Muhandis merged commit 620e1fb into main Mar 26, 2026
2 checks passed
@Al-Muhandis Al-Muhandis deleted the codex/fix-post-installation-script-for-tgadmin branch March 27, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant