navpoint/build-linux.sh

58 lines
1.4 KiB
Bash
Raw Normal View History

2024-07-21 12:44:14 -07:00
#!/bin/sh
2024-07-28 15:09:13 -07:00
arch=$(uname -m)
version=$(head -n 1 README.md | awk '{print $4}')
distName=navpoint-$version-linux-$arch
2024-07-21 12:44:14 -07:00
rm -rf dist/$distName-*
2024-07-28 16:13:50 -07:00
mkdir -p dist/$distName-bundle
2024-07-21 12:44:14 -07:00
2024-07-29 08:32:31 -07:00
pyinstaller --windowed --onefile \
--hidden-import tornado.web \
--add-data README.md:files \
--add-data GPL-3.0.txt:files \
--add-data CC-BY-SA-4.0.txt:files \
main.py
2024-07-21 12:44:14 -07:00
2024-07-28 16:13:50 -07:00
cp dist/main dist/$distName-standalone
mv dist/main dist/$distName-bundle/navpoint
cp icon.png dist/$distName-bundle/navpoint.png
2024-07-29 08:32:31 -07:00
2024-07-28 16:13:50 -07:00
cp GPL-3.0.txt CC-BY-SA-4.0.txt dist/$distName-bundle/
2024-07-29 08:32:31 -07:00
pandoc -s --metadata "title=Navpoint Desktop" README.md |
grep -v 'h1 id="navpoint-desktop"' \
> dist/$distName-bundle/README.html
2024-07-21 12:44:14 -07:00
2024-07-28 16:13:50 -07:00
cat > dist/$distName-bundle/navpoint.desktop << HERE
2024-07-21 12:44:14 -07:00
[Desktop Entry]
Type=Application
Terminal=false
Name=Navpoint
Exec=/bin/sh -c "$HOME/.local/bin/navpoint"
Icon=navpoint
2024-07-28 15:14:28 -07:00
Categories=Application;Network
2024-07-21 12:44:14 -07:00
StartupWMClass=navpoint
HERE
2024-07-28 16:13:50 -07:00
cat > dist/$distName-bundle/install.sh << HERE
2024-07-21 12:44:14 -07:00
#!/bin/sh
binary_target=~/.local/bin/
desktop_target=~/.local/share/applications/
icon_target=~/.local/share/icons/
mkdir -p \$binary_target \$desktop_target \$icon_target
2024-07-21 12:44:14 -07:00
cp navpoint \$binary_target/navpoint
chmod +x \$binary_target/navpoint
cp navpoint.desktop \$desktop_target/navpoint.desktop
cp navpoint.png \$icon_target/navpoint.png
HERE
2024-07-28 16:13:50 -07:00
chmod +x dist/$distName-bundle/install.sh
2024-07-28 15:19:12 -07:00
cd dist
2024-07-21 12:44:14 -07:00
2024-07-28 16:13:50 -07:00
tar -czf $distName-bundle.tar.gz $distName-bundle