Files
imajviewer/dist/rebuild-deb.sh

39 lines
1.2 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
set -euo pipefail
APP=imajviewer
VERSION=1.0.0
DIST_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_DIR="$(dirname "$DIST_DIR")"
RELEASE_DIR="${PROJECT_DIR}/build/linux/x64/release/bundle"
DEB="${DIST_DIR}/${APP}_${VERSION}_amd64.deb"
# ── Geçici çalışma dizini ──
TMPDIR=$(mktemp -d)
trap "rm -rf $TMPDIR" EXIT
echo "• Eski .deb çıkartılıyor…"
dpkg-deb -x "$DEB" "$TMPDIR/pkg"
dpkg-deb -e "$DEB" "$TMPDIR/pkg/DEBIAN"
echo "• Yeni release binary ve kütüphaneler kopyalanıyor…"
cp -r "$RELEASE_DIR"/* "$TMPDIR/pkg/usr/lib/${APP}/"
echo "• Symlink güncelleniyor…"
ln -sf "/usr/lib/${APP}/${APP}" "$TMPDIR/pkg/usr/bin/${APP}"
echo "• .desktop dosyası kaynaktan kopyalanıyor…"
DESKTOP_FILE="$TMPDIR/pkg/usr/share/applications/${APP}.desktop"
cp "${PROJECT_DIR}/deb/usr/share/applications/${APP}.desktop" "$DESKTOP_FILE"
echo "• İkonlar ve hicolor tema indeksi kopyalanıyor…"
mkdir -p "$TMPDIR/pkg/usr/share/icons/hicolor"
cp -r "${PROJECT_DIR}/deb/usr/share/icons/hicolor/." "$TMPDIR/pkg/usr/share/icons/hicolor/"
echo "• Yeni .deb paketi oluşturuluyor…"
fakeroot dpkg-deb --build "$TMPDIR/pkg" "${DEB}.tmp" >/dev/null
mv "${DEB}.tmp" "$DEB"
echo "${DEB} güncellendi ($(du -h "$DEB" | cut -f1))"