navpoint/build-linux.sh

48 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
arch=$(uname -m)
distDir=navpoint-linux-$arch
rm -rf dist/$distDir
mkdir -p dist/$distDir
pyinstaller -w -F --hidden-import tornado.web main.py
mv dist/main dist/$distDir/navpoint
cp icon.png dist/$distDir/navpoint.png
cp GPL-3.0.txt CC-BY-SA-4.0.txt dist/$distDir/
pandoc -s --metadata "title=Navpoint Desktop" README.md | grep -v 'h1 id="navpoint-desktop"' > dist/$distDir/README.html
cat > dist/$distDir/navpoint.desktop << HERE
[Desktop Entry]
Type=Application
Terminal=false
Name=Navpoint
Exec=/bin/sh -c "$HOME/.local/bin/navpoint"
Icon=navpoint
Categories=Application;Network
StartupWMClass=navpoint
HERE
cat > dist/$distDir/install.sh << HERE
#!/bin/sh
binary_target=~/.local/bin/
desktop_target=~/.local/share/applications/
icon_target=~/.local/share/icons/
mkdir -p \$binary_target \$desktop_target \$icon_target
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
chmod +x dist/$distDir/install.sh
cd dist
tar -czf $distDir.tar.gz $distDir