mirror of
https://github.com/km4ack/73Linux
synced 2026-08-13 17:51:54 -04:00
53 lines
No EOL
1.3 KiB
Text
53 lines
No EOL
1.3 KiB
Text
BAPP=4.0
|
|
ID=GPS
|
|
Name=gps
|
|
Comment='GPS Software'
|
|
Ver=REPO
|
|
localVer=REPO
|
|
|
|
INSTALL(){
|
|
cd ${BUILDDIR} || return
|
|
|
|
sudo apt install -y python3-gps gpsd-tools gpsd-clients gpsd chrony python3-gi-cairo libgps-dev
|
|
sudo mv /etc/default/gpsd /etc/default/gpsd.org
|
|
sudo wget https://raw.githubusercontent.com/km4ack/pi-scripts/master/gpsd -P /etc/default/
|
|
CHRONYCHK=$(grep "refclock SHM 0 offset 0.5 delay 0.2 refid NMEA" /etc/chrony/chrony.conf)
|
|
if [ -z "$CHRONYCHK" ]; then
|
|
echo "refclock SHM 0 offset 0.5 delay 0.2 refid NMEA" | sudo tee -a /etc/chrony/chrony.conf
|
|
fi
|
|
#line below added per this issue - https://github.com/km4ack/pi-build/issues/146 24SEPT2020
|
|
sudo ln -s /lib/systemd/system/gpsd.service /etc/systemd/system/multi-user.target.wants/
|
|
GPS=$(grep "GPS=" ${BAPDIR}/cache/config.txt | sed 's/GPS=//')
|
|
sudo sed -i "s|^DEVICES.*|DEVICES=\"${GPS}\"|" /etc/default/gpsd
|
|
}
|
|
|
|
MENU(){
|
|
cat >xgps.desktop <<EOF
|
|
[Desktop Entry]
|
|
Name=XGPS
|
|
GenericName=XGPS
|
|
Comment=GPS Date Viewer
|
|
Exec=/usr/bin/xgps
|
|
Icon=${BAPDIR}/data/ico/gps.png
|
|
Terminal=false
|
|
Type=Application
|
|
Categories=Utility
|
|
EOF
|
|
|
|
sudo mv xgps.desktop /usr/share/applications/
|
|
}
|
|
|
|
VERSION(){
|
|
if ! hash gpsd 2>/dev/null; then
|
|
CURRENT=0
|
|
NEWVER=REPO
|
|
else
|
|
CURRENT=REPO
|
|
NEWVER=REPO
|
|
|
|
fi
|
|
}
|
|
|
|
REMOVE(){
|
|
sudo apt purge -y python3-gps gpsd-tools gpsd-clients gpsd chrony python3-gi-cairo libgps-dev
|
|
} |