Skip to content

Commit 6593c5d

Browse files
authored
Update deb.sh
Signed-off-by: Hasan ÇALIŞIR <hasan.calisir@psauxit.com>
1 parent 992d878 commit 6593c5d

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

safexec/helpers/deb.sh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ ok() { printf '%s✓%s %s\n' "$c_grn" "$c_rst" "$*"; }
2121
warn() { printf '%s!%s %s\n' "$c_ylw" "$c_rst" "$*"; }
2222
die() { printf '%s✗ ERROR:%s %s\n' "$c_red" "$c_rst" "$*" >&2; exit 1; }
2323

24+
# policy knobs
25+
SUITE="${SUITE:-unstable}"
26+
STDVER="${STDVER:-4.6.2}"
27+
2428
# ---------- parse args ----------
2529
ARCH=""; VERSION=""
2630
while [[ $# -gt 0 ]]; do
@@ -116,7 +120,7 @@ Section: utils
116120
Priority: optional
117121
Maintainer: $MAINT
118122
Build-Depends: debhelper-compat (= 13)
119-
Standards-Version: 4.7.0
123+
Standards-Version: ${STDVER}
120124
Homepage: $HOMEPAGE
121125
Rules-Requires-Root: no
122126
@@ -141,7 +145,7 @@ EOF
141145
# changelog
142146
DATE_RFC2822="$(LC_ALL=C date -R)"
143147
cat > debian/changelog <<EOF
144-
safexec (${VERSION}) unstable; urgency=medium
148+
safexec (${VERSION}) ${SUITE}; urgency=medium
145149
146150
* Binary-only release for Debian/Ubuntu (glibc shim only).
147151
- Installs safexec to /usr/bin/safexec (static musl).
@@ -175,9 +179,8 @@ override_dh_auto_install:
175179
> install -m 0644 -D "$(SHIM_GLIBC)" "debian/safexec/usr/lib/$(TRIPLET_GLIBC)/npp/libnpp_norm.so"; \
176180
> install -d -m 0755 debian/safexec/usr/lib/npp
177181
178-
override_dh_fixperms:
179-
> dh_fixperms
180-
> # SUID handled via dpkg-statoverride in postinst
182+
override_dh_missing:
183+
> dh_missing --fail-missing
181184
MAKE
182185
sed -i "s|#SAFEEXEC_BIN#|$SAFEEXEC_BIN|g" debian/rules
183186
sed -i "s|#SHIM_GLIBC#|$SHIM_GLIBC|g" debian/rules
@@ -225,12 +228,12 @@ EOF
225228
sed -i "s|#TRIPLET_GLIBC#|$CPU_TRIPLET_GLIBC|g" debian/safexec.postinst
226229
chmod +x debian/safexec.postinst
227230

228-
# prerm: tidy statoverride
229-
cat > debian/safexec.prerm <<'EOF'
231+
# postrm: tidy statoverride on remove
232+
cat > debian/safexec.postrm <<'EOF'
230233
#!/bin/sh
231234
set -e
232235
case "$1" in
233-
remove|deconfigure)
236+
remove)
234237
if dpkg-statoverride --list /usr/bin/safexec >/dev/null 2>&1; then
235238
dpkg-statoverride --remove /usr/bin/safexec || true
236239
fi
@@ -239,7 +242,7 @@ esac
239242
#DEBHELPER#
240243
exit 0
241244
EOF
242-
chmod +x debian/safexec.prerm
245+
chmod +x debian/safexec.postrm
243246

244247
# manpage + list
245248
mkdir -p debian/man

0 commit comments

Comments
 (0)