diff --git a/gpsd-3.16.tar.gz b/gpsd-3.16.tar.gz deleted file mode 100644 index f48b0e7..0000000 --- a/gpsd-3.16.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:03579af13a4d3fe0c5b79fa44b5f75c9f3cac6749357f1d99ce5d38c09bc2029 -size 8587490 diff --git a/gpsd-3.16.tar.gz.sig b/gpsd-3.16.tar.gz.sig deleted file mode 100644 index b0c1c78..0000000 Binary files a/gpsd-3.16.tar.gz.sig and /dev/null differ diff --git a/gpsd-3.17.tar.gz b/gpsd-3.17.tar.gz new file mode 100644 index 0000000..dbcd669 --- /dev/null +++ b/gpsd-3.17.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68e0dbecfb5831997f8b3d6ba48aed812eb465d8c0089420ab68f9ce4d85e77a +size 8755304 diff --git a/gpsd-3.17.tar.gz.sig b/gpsd-3.17.tar.gz.sig new file mode 100644 index 0000000..d20409e Binary files /dev/null and b/gpsd-3.17.tar.gz.sig differ diff --git a/gpsd-fix-shebang.patch b/gpsd-fix-shebang.patch deleted file mode 100644 index c850097..0000000 --- a/gpsd-fix-shebang.patch +++ /dev/null @@ -1,10 +0,0 @@ -Index: gpsd-3.13/gps/gps.py -=================================================================== ---- gpsd-3.13.orig/gps/gps.py -+++ gpsd-3.13/gps/gps.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/python - # -*- coding: utf-8 -*- - # - # This file is Copyright (c) 2010 by the GPSD project diff --git a/gpsd-python3.patch b/gpsd-python3.patch new file mode 100644 index 0000000..630419d --- /dev/null +++ b/gpsd-python3.patch @@ -0,0 +1,150 @@ +Index: gpsd-3.17/SConstruct +=================================================================== +--- gpsd-3.17.orig/SConstruct ++++ gpsd-3.17/SConstruct +@@ -23,6 +23,14 @@ + # * Out-of-directory builds: see http://www.scons.org/wiki/UsingBuildDir + # * Coveraging mode: gcc "-coverage" flag requires a hack + # for building the python bindings ++# * Python 3 compatibility in this recipe ++ ++# Since SCons 3.0.0 forces print_function on us, it needs to be unconditional. ++# This is recognized to be a bug in SCons, but we need to live with it for now, ++# and we'll need this for eventual Python 3 compatibility, anyway. ++# Python requires this to precede any non-comment code. ++from __future__ import print_function ++from functools import reduce + + # Release identification begins here + gpsd_version = "3.17" +@@ -354,7 +362,7 @@ for flag in ["LDFLAGS", "SHLINKFLAGS", " + + + # Keep scan-build options in the environment +-for key, value in os.environ.iteritems(): ++for key, value in os.environ.items(): + if key.startswith('CCC_'): + env.Append(ENV={key: value}) + +@@ -375,7 +383,7 @@ if env.GetOption("silent"): + + def announce(msg): + if not env.GetOption("silent"): +- print msg ++ print(msg) + + # DESTDIR environment variable means user prefix the installation root. + DESTDIR = os.environ.get('DESTDIR', '') +@@ -460,6 +468,8 @@ if env['sysroot']: + env.MergeFlags({"LINKFLAGS": ["--sysroot=%s" % env['sysroot']]}) + + # Build help ++def cmp(a, b): ++ return (a > b) - (a < b) + + Help("""Arguments may be a mixture of switches and targets in any order. + Switches apply to the entire build regardless of where they are in the order. +@@ -843,9 +853,9 @@ else: + "dbus_export": ["libdbus-1"], + } + +- keys = map(lambda x: (x[0], x[2]), boolopts) \ +- + map(lambda x: (x[0], x[2]), nonboolopts) \ +- + map(lambda x: (x[0], x[2]), pathopts) ++ keys = list(map(lambda x: (x[0], x[2]), boolopts)) \ ++ + list(map(lambda x: (x[0], x[2]), nonboolopts)) \ ++ + list(map(lambda x: (x[0], x[2]), pathopts)) + keys.sort() + for (key, help) in keys: + value = env[key] +@@ -946,7 +956,7 @@ if helping: + + # If helping just get usable config info from the local Python + target_python_path = '' +- py_config_text = str(eval(PYTHON_CONFIG_CALL)) ++ Py_config_text = str(eval(PYTHON_CONFIG_CALL)) + python_libdir = str(eval(PYTHON_LIBDIR_CALL)) + + else: +@@ -982,7 +992,7 @@ else: + if env['python']: # May have been turned off by error + env['PYTHON'] = target_python_path + env['ENV']['PYTHON'] = target_python_path # For regress-driver +- py_config_vars = ast.literal_eval(py_config_text) ++ py_config_vars = ast.literal_eval(py_config_text.decode()) + py_config_vars = [[] if x is None else x for x in py_config_vars] + python_config = dict(zip(PYTHON_CONFIG_NAMES, py_config_vars)) + +@@ -1371,7 +1381,7 @@ else: + + python_objects = {} + python_compiled_libs = {} +- for ext, sources in python_extensions.iteritems(): ++ for ext, sources in python_extensions.items(): + python_objects[ext] = [] + for src in sources: + python_objects[ext].append( +@@ -1401,7 +1411,7 @@ Platform: UNKNOWN + python_egg_info = python_env.Textfile(target="gps-%s.egg-info" + % (gpsd_version, ), + source=python_egg_info_source) +- python_built_extensions = python_compiled_libs.values() ++ python_built_extensions = list(python_compiled_libs.values()) + python_targets = python_built_extensions + [python_egg_info] + + env.Command(target="packet_names.h", source="packet_states.h", action=""" +@@ -1546,8 +1556,8 @@ def substituter(target, source, env): + content = content.replace(s, t) + m = re.search("@[A-Z]+@", content) + if m and m.group(0) not in map(lambda x: x[0], substmap): +- print >>sys.stderr, "Unknown subst token %s in %s." \ +- % (m.group(0), sfp.name) ++ print("Unknown subst token %s in %s." % (m.group(0), sfp.name), ++ file=sys.stderr) + tfp = open(str(target[0]), "w") + tfp.write(content) + tfp.close() +@@ -1604,14 +1614,14 @@ if env['xgps']: + "xgpsspeed.1": "gps.xml", + "xgps.1": "gps.xml", + }) +-all_manpages = base_manpages.keys() + python_manpages.keys() ++all_manpages = list(base_manpages.keys()) + list(python_manpages.keys()) + + man_env = env.Clone() + if man_env.GetOption('silent'): + man_env['SPAWN'] = filtered_spawn # Suppress stderr chatter + manpage_targets = [] + if manbuilder: +- for (man, xml) in base_manpages.items() + python_manpages.items(): ++ for (man, xml) in list(base_manpages.items()) + list(python_manpages.items()): + manpage_targets.append(man_env.Man(source=xml, target=man)) + + # Where it all comes together +@@ -1692,7 +1702,7 @@ if qt_env: + + + maninstall = [] +-for manpage in base_manpages.keys() + python_manpages.keys(): ++for manpage in list(base_manpages.keys()) + list(python_manpages.keys()): + if not manbuilder and not os.path.exists(manpage): + continue + section = manpage.split(".")[1] +@@ -2177,7 +2187,7 @@ htmlpages = Split(''' + www/writing-a-driver.html + ''') + +-webpages = htmlpages + asciidocs + map(lambda f: f[:-3], glob.glob("www/*.in")) ++webpages = htmlpages + asciidocs + list(map(lambda f: f[:-3], glob.glob("www/*.in"))) + + www = env.Alias('www', webpages) + +@@ -2190,7 +2200,7 @@ def validation_list(target, source, env) + if '-head' not in page: + fp = open(page) + if "Valid HTML" in fp.read(): +- print os.path.join(website, os.path.basename(page)) ++ print(os.path.join(website, os.path.basename(page))) + fp.close() + Utility("validation-list", [www], validation_list) + diff --git a/gpsd.changes b/gpsd.changes index 8d0e2b0..c937a1e 100644 --- a/gpsd.changes +++ b/gpsd.changes @@ -1,3 +1,35 @@ +------------------------------------------------------------------- +Tue Nov 28 10:40:51 UTC 2017 - mimi.vx@gmail.com + +- removed gpsd-fix-shebang.patch +- reworked gpsd-python3.patch +- build python3 subpackage + +------------------------------------------------------------------- +Thu Nov 23 13:50:05 UTC 2017 - rbrown@suse.com + +- Replace references to /var/adm/fillup-templates with new + %_fillupdir macro (boo#1069468) + +------------------------------------------------------------------- +Mon Nov 20 13:48:01 UTC 2017 - mpluskal@suse.com + +- Update to version 3.17: + * Repair support for non-NMEA devices requring active probing + (e.g. Garmin USB GPSes). + * Fix a SiRF driver bug that occasionally confused NTP. + * Support for Spectratime iSync GRClok and LNRClok oscillators. + * gpxlogger can reconnect when the GPS loses the fix. + * xgps and xgpsspeed moved to python-gi, + getting shut of the deprecated pygtk2 bindings. + * Default mode for xgpsspeed is now the more interesting nautical + display. + * 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 + ------------------------------------------------------------------- Mon Nov 13 13:12:40 UTC 2017 - mpluskal@suse.com diff --git a/gpsd.spec b/gpsd.spec index b7a60b1..a79bfdb 100644 --- a/gpsd.spec +++ b/gpsd.spec @@ -16,11 +16,16 @@ # -%define libgps libgps22 -%define libQgps libQgpsmm22 +%define sover 23 +%define libgps libgps%{sover} +%define libQgps libQgpsmm%{sover} %define _udevdir %(pkg-config --variable udevdir udev) +#Compat macro for new _fillupdir macro introduced in Nov 2017 +%if ! %{defined _fillupdir} + %define _fillupdir %{_localstatedir}/adm/fillup-templates +%endif Name: gpsd -Version: 3.16 +Version: 3.17 Release: 0 Summary: Service daemon for mediating access to a GPS License: BSD-3-Clause @@ -32,7 +37,7 @@ Source2: udev.gpsd Source3: sysconfig.gpsd Source98: http://download-mirror.savannah.gnu.org/releases/gpsd/%{name}-%{version}.tar.gz.sig Source99: %{name}.keyring -Patch0: gpsd-fix-shebang.patch +Source100: gpsd-python3.patch BuildRequires: chrpath BuildRequires: fdupes BuildRequires: gcc-c++ @@ -40,7 +45,7 @@ BuildRequires: hicolor-icon-theme BuildRequires: libcap-devel BuildRequires: ncurses-devel BuildRequires: pkgconfig -BuildRequires: scons >= 2.0.1 +BuildRequires: scons >= 2.3.0 BuildRequires: systemd-rpm-macros BuildRequires: update-desktop-files BuildRequires: xmlto @@ -50,6 +55,7 @@ BuildRequires: pkgconfig(bluez) BuildRequires: pkgconfig(dbus-1) BuildRequires: pkgconfig(libusb-1.0) BuildRequires: pkgconfig(python2) +BuildRequires: pkgconfig(python3) BuildRequires: pkgconfig(udev) Requires: udev Requires(pre): %fillup_prereq @@ -111,14 +117,23 @@ applications. %package -n python2-gpsd Summary: Client libraries in C and Python for talking to a running gpsd or GPS Group: Development/Libraries/Python +Requires: %{name} = %{version} Provides: python-gpsd = %{version}-%{release} Obsoletes: python-gpsd < %{version}-%{release} -Requires: %{name} = %{version} %description -n python2-gpsd This package provides python modules and tools for the gpsd shared libraries. You will need to have gpsd installed for it to work. +%package -n python3-gpsd +Summary: Client libraries in C and Python3 for talking to a running gpsd or GPS +Group: Development/Libraries/Python +Requires: %{name} = %{version} + +%description -n python3-gpsd +This package provides python3 modules and tools for the gpsd shared libraries. +You will need to have gpsd installed for it to work. + %package clients Summary: Clients for gpsd with an X interface Group: Hardware/Other @@ -139,34 +154,91 @@ cgps resembles xgps, but without the pictorial satellite display. It can run on a serial terminal or terminal emulator. %prep -%setup -q -%patch0 -p1 +mkdir -p %{name}-%{version}/python2 +mkdir -p %{name}-%{version}/python3 +tar -xf %{SOURCE0} -C %{name}-%{version}/python2 +tar -xf %{SOURCE0} -C %{name}-%{version}/python3 +pushd %{name}-%{version}/python2/%{name}-%{version} +patch -p1 < %{SOURCE100} +popd +pushd %{name}-%{version}/python3/%{name}-%{version} +patch -p1 < %{SOURCE100} +popd +cd %{name}-%{version} + +# fix systemd path + sed -i 's|systemd_dir =.*|systemd_dir = '\'%{_unitdir}\''|' python*/%{name}-%{version}/SConstruct + +# don't try reloading systemd when installing in the build root +sed -i 's|systemctl daemon-reload|true|' python*/%{name}-%{version}/SConstruct # don't set RPATH -sed -i 's|env.Prepend.*RPATH.*|pass #\0|' SConstruct +sed -i 's|env.Prepend.*RPATH.*|pass #\0|' python*/%{name}-%{version}/SConstruct %build # The SCons description does not handle CXXFLAGS correctly, pass C++ flags also in CFLAGS export CFLAGS="%{optflags} -fvisibility-inlines-hidden -std=gnu++98" export CXXFLAGS="%{optflags} -fvisibility-inlines-hidden -std=gnu++98" -scons prefix=%{_prefix} libdir=%{_libdir} nostrip=True %{?_smp_mflags} + +pyversions=( python2 python3 ) +pylibdir=( %{python2_sitearch} %{python3_sitearch} ) + +for i in 0 1 +do + pushd %{name}-%{version}/${pyversions[i]}/%{name}-%{version} + + # breaks with %{?_smp_mflags} + scons \ + dbus_export=yes \ + systemd=yes \ + libQgpsmm=yes \ + debug=yes \ + leapfetch=no \ + prefix="" \ + sysconfdif=%{_sysconfdir} \ + bindir=%{_bindir} \ + includedir=%{_includedir} \ + libdir=%{_libdir} \ + sbindir=%{_sbindir} \ + mandir=%{_mandir} \ + docdir=%{_docdir} \ + pkgconfigdir=%{_libdir}/pkgconfig \ + udevdir=$(dirname %{_udevrulesdir}) \ + target_python=${pyversions[i]} \ + python_libdir=${pylibdir[i]} \ + build + + # Fix python interpreter path. + sed -e "s,#!/usr/bin/\(python[23]\?\|env \+python[23]\?\),#!%{_bindir}/${pyversions[i]},g" -i \ + gegps gpscat gpsfake xgps xgpsspeed gpsprof gps/*.py + + popd +done %install # The SCons description does not handle CXXFLAGS correctly, pass C++ flags also in CFLAGS export CFLAGS="%{optflags} -fvisibility-inlines-hidden -std=gnu++98" export CXXFLAGS="%{optflags} -fvisibility-inlines-hidden -std=gnu++98" -DESTDIR=%{buildroot} scons prefix=%{_prefix} libdir=%{_libdir} strip=False install +# Install python2 first +pushd %{name}-%{version}/python2/%{name}-%{version} + +DESTDIR=%{buildroot} scons strip=False install + +# Now delete all the installed files except the python2 files +find %{buildroot} \( -not -type d -a -not -path "*/python2.*/*" \) -delete + +popd +pushd %{name}-%{version}/python3/%{name}-%{version} + +DESTDIR=%{buildroot} scons strip=False install + install -d -m 755 %{buildroot}%{_udevdir} install -d -m 755 %{buildroot}%{_udevdir}/rules.d -install -d -m 755 %{buildroot}%{_localstatedir}/adm/fillup-templates +install -d -m 755 %{buildroot}%{_fillupdir} install -d -m 755 %{buildroot}%{_datadir}/applications 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 -if [ -f %{buildroot}%{python_sitearch}/*.egg-info ] ; then - rm -f %{buildroot}%{python_sitearch}/*.egg-info -fi -chmod 755 %{buildroot}%{python_sitearch}/gps/gps.py +install -m 644 %{SOURCE3} %{buildroot}%{_fillupdir} # install desktop entries install -D -m 644 -t %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/ packaging/X11/gpsd-logo.png install -D -m 644 -t %{buildroot}%{_datadir}/applications/ packaging/X11/xgps.desktop @@ -176,28 +248,31 @@ 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|python2|g" %{buildroot}%{_bindir}/* + +%fdupes -s %{buildroot}%{_mandir} + # 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 %suse_update_desktop_file -r xgps System Monitor -# save some space, create symlinks -%fdupes -s %{buildroot} %pre -%service_add_pre gpsd.service gpsdctl@.service +%service_add_pre gpsd.service gpsdctl@.service gpsd.socket %post /sbin/ldconfig %fillup_only -n gpsd -%service_add_post gpsd.service gpsdctl@.service +%service_add_post gpsd.service gpsdctl@.service gpsd.socket %udev_rules_update %preun -%service_del_preun gpsd.service gpsdctl@.service +%service_del_preun gpsd.service gpsdctl@.service gpsd.socket %postun /sbin/ldconfig -%service_del_postun gpsd.service gpsdctl@.service +%service_del_postun gpsd.service gpsdctl@.service gpsd.socket %post -n %{libgps} -p /sbin/ldconfig %postun -n %{libgps} -p /sbin/ldconfig @@ -205,8 +280,7 @@ sed -i -e 's#Icon=.*/\([^/]\+\)\(\..\+\)#Icon=\1#' %{buildroot}%{_datadir}/appli %postun -n %{libQgps} -p /sbin/ldconfig %files -%defattr(-,root,root) -%doc README COPYING gpsd.php +%doc %{name}-%{version}/python3/%{name}-%{version}/README %{name}-%{version}/python3/%{name}-%{version}/COPYING %{_mandir}/man?/gpsd.* %{_mandir}/man?/gpsdctl.* %{_mandir}/man?/gpsctl.* @@ -220,24 +294,22 @@ sed -i -e 's#Icon=.*/\([^/]\+\)\(\..\+\)#Icon=\1#' %{buildroot}%{_datadir}/appli %{_sbindir}/gpsd %{_sbindir}/gpsdctl %{_bindir}/gpsctl -%{_localstatedir}/adm/fillup-templates/sysconfig.gpsd +%{_fillupdir}/sysconfig.gpsd %files -n %{libgps} -%defattr(-,root,root) %{_libdir}/libgps.so.* %files -n %{libQgps} -%defattr(-,root,root) %{_libdir}/libQgpsmm.so.* %files devel -%defattr(-,root,root) -%doc README COPYING TODO +%doc %{name}-%{version}/python3/%{name}-%{version}/TODO %{_mandir}/man?/gpsfake.* %{_mandir}/man?/gpscat.* -%{_mandir}/man?/libQgps*.* -%{_mandir}/man?/libgps*.* -%{_mandir}/man?/srec.* +%{_mandir}/man?/libQgps* +%{_mandir}/man?/libgps.* +%{_mandir}/man?/libgpsmm.* +%{_mandir}/man?/srec* %{_mandir}/man?/gpsdecode.* %{_mandir}/man?/gpsd_json.* %{_mandir}/man?/gpsprof.* @@ -254,11 +326,14 @@ sed -i -e 's#Icon=.*/\([^/]\+\)\(\..\+\)#Icon=\1#' %{buildroot}%{_datadir}/appli %{_libdir}/pkgconfig/Qgpsmm.pc %files -n python2-gpsd -%defattr(-,root,root) %{python_sitearch}/gps/ +%{python_sitearch}/gps-%{version}.* + +%files -n python3-gpsd +%{python3_sitearch}/gps/ +%{python3_sitearch}/gps-%{version}.* %files clients -%defattr(-,root,root) %{_mandir}/man?/gps.* %{_mandir}/man?/gegps.* %{_mandir}/man?/cgps.* @@ -269,6 +344,8 @@ sed -i -e 's#Icon=.*/\([^/]\+\)\(\..\+\)#Icon=\1#' %{buildroot}%{_datadir}/appli %{_mandir}/man?/gpsmon.* %{_mandir}/man?/gps2udp.* %{_mandir}/man?/ntpshmmon.* +%{_mandir}/man?/ppscheck.* +%{_mandir}/man?/gpxlogger.* %{_bindir}/gegps %{_bindir}/xgps %{_bindir}/xgpsspeed @@ -279,6 +356,7 @@ sed -i -e 's#Icon=.*/\([^/]\+\)\(\..\+\)#Icon=\1#' %{buildroot}%{_datadir}/appli %{_bindir}/gps2udp %{_bindir}/gpxlogger %{_bindir}/ntpshmmon +%{_bindir}/ppscheck %{_datadir}/applications/*.desktop %{_datadir}/icons/hicolor/*/apps/*