File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,6 +83,15 @@ validate_binary() {
8383 fi
8484}
8585
86+ normalize_maintainer_scripts () {
87+ local script
88+ for script in " ${STAGING_DIR} /DEBIAN/postinst" " ${STAGING_DIR} /DEBIAN/postrm" ; do
89+ if [ -f " ${script} " ]; then
90+ sed -i ' s/\r$//' " ${script} "
91+ fi
92+ done
93+ }
94+
8695# ---------------------------------------------------------------------------
8796# Main
8897# ---------------------------------------------------------------------------
@@ -99,6 +108,7 @@ mkdir -p "${BUILD_DIR}"
99108
100109# Copy staging from sources in /tmp — here chmod works correctly
101110cp -r " ${SCRIPT_DIR} /debian" " ${STAGING_DIR} "
111+ normalize_maintainer_scripts
102112
103113# Include db_schema.sql — used by postinst to initialize the database
104114mkdir -p " ${STAGING_DIR} /usr/share/${PACKAGE_NAME} "
Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ Priority: optional
33Maintainer: Renat Suleymanov <mail@Renat.Su>
44Architecture: amd64
55Section: utils
6- Depends: dash, libc6 (>= 2.2.5), libsagui2 | libsagui
6+ Depends: dash, libc6 (>= 2.2.5)
7+ Recommends: libsagui2 | libsagui
78Origin: https://github.com/al-Muhandis/AdminHelper
89Description: Telegram admin helper
910 Telegram bot service for groups' moderation
Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ mysql_available() {
1515 command -v mysql & > /dev/null && mysqladmin ping --silent 2> /dev/null
1616}
1717
18+ libsagui_available () {
19+ command -v ldconfig & > /dev/null && ldconfig -p 2> /dev/null | grep -q ' libsagui\.so'
20+ }
21+
1822# Read current value from JSON (return empty string if null or missing)
1923json_get () {
2024 jq -r " $1 // empty" " ${CONFIG_FILE} " 2> /dev/null || true
@@ -97,6 +101,12 @@ case "$1" in
97101 fi
98102 done
99103
104+ if ! libsagui_available; then
105+ echo " ERROR: libsagui shared library was not found in dynamic linker cache." >&2
106+ echo " Install libsagui (package or from source) and run: sudo ldconfig" >&2
107+ exit 1
108+ fi
109+
100110 if [ ! -f " ${CONFIG_FILE} " ]; then
101111 echo " ERROR: config file not found: ${CONFIG_FILE} " >&2
102112 echo " Place tgadmin.json into /etc/tgadmin/ before installing." >&2
You can’t perform that action at this time.
0 commit comments