sidequest.sh 1.04 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/sh

TAR="$1"
RETURNTARNAME="$2"

. $(dirname $0)/common.sh


# SideQuest-0.10.39.tar.xz
BASENAME=$(basename $TAR .tar.xz)
VERSION=$(echo $BASENAME | sed -e 's|SideQuest-||' | sed -e 's|.tar.xz||')
[ -n "$VERSION" ] || fatal "Can't get package version"

14
erc unpack $TAR || fatal
15 16

mkdir -p opt
17
mv $BASENAME* opt/sidequest || fatal
18 19

for res in 16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512 1024x1024; do
20 21
    install -dm755 "usr/share/icons/hicolor/${res}/apps/"
    install -m644 opt/sidequest/resources/app.asar.unpacked/build/icons/${res}.png usr/share/icons/hicolor/${res}/apps/sidequest.png
22 23 24
done

# create desktop file
25
cat <<EOF | create_file usr/share/applications/$PRODUCT.desktop
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
[Desktop Entry]
Version=1.0
Type=Application
Name=SideQuest
Comment=The SideQuest desktop application
Exec=$PRODUCT %U
Icon=$PRODUCT
Terminal=false
StartupNotify=true
Categories=Development;Game;HardwareSettings
StartupWMClass=SideQuest
MimeType=x-scheme-handler/sidequest;
EOF

PKGNAME=$PRODUCT-$VERSION

erc pack $PKGNAME.tar opt usr || fatal

return_tar $PKGNAME.tar