-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild_deb.sh
More file actions
executable file
·102 lines (81 loc) · 2.21 KB
/
Copy pathbuild_deb.sh
File metadata and controls
executable file
·102 lines (81 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
# Pekka Kana 2 by Janne Kivilahti (2003–2007) and the Piste Gamez community.
# https://pistegamez.net/game_pk2.html
#
# This script builds a Debian package (.deb) from the PK2 source tree
# for redistribution and installation using APT.
set -e
ARCH=$(dpkg --print-architecture)
APP=Pekka-Kana-2
VER=1.5.2
PKG="pkg/${APP}_${VER}_Linux_${ARCH}"
PKGDIR=$PKG
BIN_DIR=$PKGDIR/usr/games
LIB_DIR=$PKGDIR/usr/lib/games/$APP
SHARE_DIR=$PKGDIR/usr/share/games/$APP
DESKTOP_DIR=$PKGDIR/usr/share/applications
ICON_DIR=$PKGDIR/usr/share/icons/hicolor/64x64/apps
echo "== Build =="
make clean
make -j$(nproc)
echo "== Clean =="
rm -rf "$PKGDIR"
echo "== Create dirs =="
mkdir -p "$BIN_DIR"
mkdir -p "$LIB_DIR"
mkdir -p "$SHARE_DIR"
mkdir -p "$DESKTOP_DIR"
mkdir -p "$ICON_DIR"
mkdir -p "$PKGDIR/DEBIAN"
echo "== Launcher =="
install -m 755 misc/linux/dist-launcher.lua \
"$BIN_DIR/$APP"
echo "== Binary =="
install -m 755 bin/pekka-kana-2 \
"$LIB_DIR/pk2_greta_${VER}"
echo "== Bundle libs =="
LIBARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH)
cp -d /usr/lib/$LIBARCH/libzip.so.* "$LIB_DIR/"
cp -d /usr/lib/$LIBARCH/libz.so.* "$LIB_DIR/"
echo "== Assets =="
rsync -a \
--exclude='data' \
--chmod=F644,D755 \
res/ \
"$SHARE_DIR/"
echo "== Desktop =="
cat > "$DESKTOP_DIR/$APP.desktop" <<EOF
[Desktop Entry]
Type=Application
Version=1.0
Name=Pekka Kana 2
Comment=Platformer in which you play as a rooster
Exec=/usr/games/${APP}
Icon=pekka-kana-2
Terminal=false
Categories=Game;
StartupNotify=true
Keywords=game;platformer;pekka;
EOF
echo "== Icon =="
install -m 644 misc/icon_64x64.png \
"$ICON_DIR/$APP.png"
echo "== Control =="
cat > "$PKGDIR/DEBIAN/control" <<EOF
Package: pekka-kana-2
Version: ${VER}
Section: games
Priority: optional
Architecture: ${ARCH}
Maintainer: SaturninTheAlien <alienufobomber@gmail.com>
Depends: libstdc++6, libsdl2-2.0-0, libsdl2-image-2.0-0, libsdl2-mixer-2.0-0, liblua5.4-0, lua5.4
Conflicts: pekka-kana-2-data
Replaces: pekka-kana-2-data
Homepage: https://pistegamez.net/game_pk2.html
Description: Pekka Kana 2 is a classic platformer in which you play as a rooster.
EOF
echo "== Build deb =="
dpkg-deb --build --root-owner-group "$PKGDIR"
echo "== Cleaning == "
make clean
echo "== Done =="