blob: b1869a4d8f9d773399adf5605c597bf76d83b0b6 (
plain)
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
|
#!/bin/sh
base_dir="$(dirname $(readlink -f "$0") )"
version="2.3.2-1"
pkg_name="unityhub"
pkg_folder="$base_dir/$pkg_name-package"
# Downloading package files
pkg_url="https://public-cdn.cloud.unity3d.com/hub/prod/UnityHub.AppImage"
echo "Downloading sources..."
wget "$pkg_url" -O "$base_dir/unityhub-${version}.AppImage"
echo "Extracting files..."
chmod +x "unityhub-${version}.AppImage"
"./unityhub-${version}.AppImage" --appimage-extract
chmod 775 "$base_dir/squashfs-root"
echo "Preparing package config..."
mkdir -p "$pkg_folder/opt"
mkdir -p "$pkg_folder/usr/share/pixmaps"
mkdir -p "$pkg_folder/usr/share/applications"
cp -r "$base_dir/DEBIAN" "$pkg_folder"
echo "Copying package files..."
cp "$base_dir/squashfs-root/unityhub.png" "$pkg_folder/usr/share/pixmaps"
cp "$base_dir/squashfs-root/unityhub.desktop" "$pkg_folder/usr/share/applications"
mv "$base_dir/squashfs-root" "$pkg_folder/opt/unityhub"
sed -i "s/Version:.*/Version: $version-1/g" "$pkg_folder/DEBIAN/control"
sed -i "s/version=\".*\"/version=\"$version\"/g" "$pkg_folder/DEBIAN/postinst"
sed -i "s/Exec=AppRun/Exec=unityhub \%u/g" "$pkg_folder/usr/share/applications/unityhub.desktop"
sed -i "s/^SCRIPT_DIR.*$/SCRIPT_DIR=\"\/opt\/unityhub\"/g" "$pkg_folder/opt/unityhub/unityhub"
chmod 755 -R "$pkg_folder/opt/unityhub/resources"
rm -r "$pkg_folder/opt/unityhub/AppRun" \
"$pkg_folder/opt/unityhub/unityhub.desktop" \
"$pkg_folder/opt/unityhub/usr/share" \
"$pkg_folder"/opt/unityhub/LICENSE*
# Building .deb file
echo "Building package..."
cd "$base_dir"
fakeroot dpkg-deb --build "$pkg_folder"
echo "done."
|