Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f367bbe298 | ||
|
|
c61d8e9d3f |
@@ -25,7 +25,11 @@ jobs:
|
|||||||
run: pyinstaller --clean --noconfirm psp-preserve.spec
|
run: pyinstaller --clean --noconfirm psp-preserve.spec
|
||||||
|
|
||||||
- name: Package tarball
|
- name: Package tarball
|
||||||
run: tar -czf psp-preserve-linux-x86_64.tar.gz -C dist psp-preserve
|
run: |
|
||||||
|
cp packaging/install.sh dist/psp-preserve/
|
||||||
|
cp packaging/psp-preserve.desktop dist/psp-preserve/
|
||||||
|
cp img/app-icon.png dist/psp-preserve/
|
||||||
|
tar -czf psp-preserve-linux-x86_64.tar.gz -C dist psp-preserve
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
Executable
+81
@@ -0,0 +1,81 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Install the PSP Preservation Tool to a system prefix.
|
||||||
|
#
|
||||||
|
# FHS-friendly layout:
|
||||||
|
# $PREFIX/bin/psp-preserve symlink -> payload binary
|
||||||
|
# $PREFIX/lib/psp-preserve/ app payload (binary + lib/)
|
||||||
|
# $PREFIX/share/applications/ desktop entry
|
||||||
|
# $PREFIX/share/icons/hicolor/256x256/apps/ app icon
|
||||||
|
#
|
||||||
|
# The PyInstaller onedir build keeps the executable and its `lib/` contents
|
||||||
|
# directory side by side, so both live under $PREFIX/lib/psp-preserve/ and a
|
||||||
|
# symlink exposes the binary at $PREFIX/bin/psp-preserve.
|
||||||
|
#
|
||||||
|
# Usage (run from inside the extracted tarball):
|
||||||
|
# sudo ./install.sh # install to /usr/local (default)
|
||||||
|
# sudo ./install.sh --prefix=/usr # install to /usr
|
||||||
|
# sudo ./install.sh --uninstall # remove from the default prefix
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
PREFIX=/usr/local
|
||||||
|
MODE=install
|
||||||
|
|
||||||
|
for arg in "$@"; do
|
||||||
|
case "$arg" in
|
||||||
|
--prefix=*) PREFIX=${arg#--prefix=} ;;
|
||||||
|
--uninstall) MODE=uninstall ;;
|
||||||
|
*) echo "unknown argument: $arg" >&2; exit 2 ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
SRC_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||||
|
LIBDIR="$PREFIX/lib/psp-preserve"
|
||||||
|
BINDIR="$PREFIX/bin"
|
||||||
|
APPDIR="$PREFIX/share/applications"
|
||||||
|
ICONDIR="$PREFIX/share/icons/hicolor/256x256/apps"
|
||||||
|
APP_BIN="$LIBDIR/psp-preserve"
|
||||||
|
|
||||||
|
require_root() {
|
||||||
|
if [ "$(id -u)" -ne 0 ]; then
|
||||||
|
echo "run as root (e.g. sudo)" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
uninstall() {
|
||||||
|
rm -f "$BINDIR/psp-preserve"
|
||||||
|
rm -f "$APPDIR/psp-preserve.desktop"
|
||||||
|
rm -f "$ICONDIR/psp-preserve.png"
|
||||||
|
rm -rf "$LIBDIR"
|
||||||
|
echo "Uninstalled from $PREFIX"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$MODE" = uninstall ]; then
|
||||||
|
require_root
|
||||||
|
uninstall
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
require_root
|
||||||
|
|
||||||
|
# The tarball ships these next to this script.
|
||||||
|
for f in psp-preserve lib psp-preserve.desktop app-icon.png; do
|
||||||
|
if [ ! -e "$SRC_DIR/$f" ]; then
|
||||||
|
echo "missing $f (run install.sh from inside the extracted tarball)" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
mkdir -p "$LIBDIR" "$BINDIR" "$APPDIR" "$ICONDIR"
|
||||||
|
rm -rf "$LIBDIR"
|
||||||
|
mkdir -p "$LIBDIR"
|
||||||
|
cp -a "$SRC_DIR/psp-preserve" "$LIBDIR/psp-preserve"
|
||||||
|
cp -a "$SRC_DIR/lib" "$LIBDIR/lib"
|
||||||
|
install -m 0644 "$SRC_DIR/psp-preserve.desktop" "$APPDIR/psp-preserve.desktop"
|
||||||
|
install -m 0644 "$SRC_DIR/app-icon.png" "$ICONDIR/psp-preserve.png"
|
||||||
|
ln -sfn "$APP_BIN" "$BINDIR/psp-preserve"
|
||||||
|
|
||||||
|
echo "Installed to $PREFIX"
|
||||||
|
echo " binary: $BINDIR/psp-preserve -> $APP_BIN"
|
||||||
|
echo " payload: $LIBDIR"
|
||||||
|
echo " desktop: $APPDIR/psp-preserve.desktop"
|
||||||
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
"""PyInstaller spec: build the PSP Preservation Tool (onedir).
|
"""PyInstaller spec: build the PSP Preservation Tool (onedir).
|
||||||
|
|
||||||
Bundles the read-only resources (DATs, PS1 loader, offline cover bundles,
|
Bundles the read-only resources (DATs, PS1 loader, offline cover bundles,
|
||||||
icons) under ``_internal/`` next to the executable. User-writable data
|
icons) under ``lib/`` next to the executable. User-writable data
|
||||||
(credentials, manual covers, PS1 templates, NPS cache, library DB, cover
|
(credentials, manual covers, PS1 templates, NPS cache, library DB, cover
|
||||||
cache) lives in the OS state dir at runtime — see ``app/config.py``.
|
cache) lives in the OS state dir at runtime — see ``app/config.py``.
|
||||||
|
|
||||||
@@ -54,7 +54,6 @@ exe = EXE(
|
|||||||
upx=False,
|
upx=False,
|
||||||
console=False,
|
console=False,
|
||||||
disable_windowed_traceback=False,
|
disable_windowed_traceback=False,
|
||||||
contents_directory="psp-preserve",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
coll = COLLECT(
|
coll = COLLECT(
|
||||||
@@ -64,4 +63,5 @@ coll = COLLECT(
|
|||||||
strip=False,
|
strip=False,
|
||||||
upx=False,
|
upx=False,
|
||||||
name="psp-preserve",
|
name="psp-preserve",
|
||||||
|
contents_directory="lib",
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user