From 5d8ca0932432330bf0c2e6866980b4e115526b3e1cb6a32c86203eb8f5965453 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Mon, 20 Nov 2017 15:37:18 +0000 Subject: [PATCH] - Fix shebangs of python script (currently still python2) OBS-URL: https://build.opensuse.org/package/show/Application:Geo/gpsd?expand=0&rev=109 --- gpsd.changes | 1 + gpsd.spec | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gpsd.changes b/gpsd.changes index b08e9a1..61f4bb2 100644 --- a/gpsd.changes +++ b/gpsd.changes @@ -14,6 +14,7 @@ Mon Nov 20 13:48:01 UTC 2017 - mpluskal@suse.com * gpsmon includes the hostname with the device display. * gpsprof now has centimeter precision. - Add gpsd-python3.patch to fix building with python3 +- Fix shebangs of python script (currently still python2) - Refresh gpsd-fix-shebang.patch ------------------------------------------------------------------- diff --git a/gpsd.spec b/gpsd.spec index 8c0cf83..7ed8b47 100644 --- a/gpsd.spec +++ b/gpsd.spec @@ -167,7 +167,9 @@ install -d -m 755 %{buildroot}%{python_sitearch} install -m 644 %{SOURCE1} %{buildroot}%{_udevdir}/rules.d/51-gpsd.rules install -m 755 %{SOURCE2} %{buildroot}%{_udevdir}/gpsd.sh install -m 644 %{SOURCE3} %{buildroot}%{_localstatedir}/adm/fillup-templates -mv -f %{buildroot}%{python_sitelib}/* %{buildroot}%{python_sitearch} +if [ %{buildroot}%{python_sitelib} != %{buildroot}%{python_sitearch} ] ; then + mv -f %{buildroot}%{python_sitelib}/* %{buildroot}%{python_sitearch} +fi if [ -f %{buildroot}%{python_sitearch}/*.egg-info ] ; then rm -f %{buildroot}%{python_sitearch}/*.egg-info fi @@ -181,6 +183,9 @@ install -D -m 644 systemd/gpsd.socket %{buildroot}/%{_unitdir}/gpsd.socket install -D -m 644 systemd/gpsdctl@.service %{buildroot}/%{_unitdir}/gpsdctl@.service ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcgpsd +# Use correct python2 paths +sed -i "s|env python|python|g" %{buildroot}%{_bindir}/* + # strip absolute path and suffix sed -i -e 's#Icon=.*/\([^/]\+\)\(\..\+\)#Icon=\1#' %{buildroot}%{_datadir}/applications/xgps{,speed}.desktop %suse_update_desktop_file -r xgpsspeed System Monitor