Hello community, here is the log from the commit of package gpsd for openSUSE:Factory checked in at 2020-03-19 19:46:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gpsd (Old) and /work/SRC/openSUSE:Factory/.gpsd.new.3160 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gpsd" Thu Mar 19 19:46:23 2020 rev:51 rq:785632 version:3.19 Changes: -------- --- /work/SRC/openSUSE:Factory/gpsd/gpsd.changes 2019-10-07 13:38:10.136816707 +0200 +++ /work/SRC/openSUSE:Factory/.gpsd.new.3160/gpsd.changes 2020-03-19 19:49:50.840168457 +0100 @@ -1,0 +2,5 @@ +Mon Mar 16 12:19:41 UTC 2020 - Tomáš Chvátal <tchva...@suse.com> + +- Allow building without python2 available + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gpsd.spec ++++++ --- /var/tmp/diff_new_pack.zXvNYJ/_old 2020-03-19 19:49:51.516168847 +0100 +++ /var/tmp/diff_new_pack.zXvNYJ/_new 2020-03-19 19:49:51.528168855 +0100 @@ -1,7 +1,7 @@ # # spec file for package gpsd # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,6 +20,7 @@ %define libgps libgps%{sover} %define libQgps libQgpsmm%{sover} %define _udevdir %(pkg-config --variable udevdir udev) +%bcond_without python2 Name: gpsd Version: 3.19 Release: 0 @@ -55,7 +56,9 @@ BuildRequires: pkgconfig(bluez) BuildRequires: pkgconfig(dbus-1) BuildRequires: pkgconfig(libusb-1.0) +%if %{with python2} BuildRequires: pkgconfig(python2) +%endif BuildRequires: pkgconfig(python3) BuildRequires: pkgconfig(udev) Requires: udev @@ -187,13 +190,15 @@ export CFLAGS="%{optflags}" export CXXFLAGS="%{optflags}" export CPPFLAGS="%{optflags}" - -pyversions=( python2 python3 ) -pylibdir=( %{python2_sitearch} %{python3_sitearch} ) - -for i in 0 1 -do - pushd %{name}-%{version}/${pyversions[i]}/%{name}-%{version} +pyversions=( "python3" ) +pylibdir=( "%{python3_sitearch}" ) +%if %{with python2} +pyversions+=( "python2" ) +pylibdir+=( "%{python2_sitearch}") +%endif +cnt=0 +for i in "${pyversions[@]}"; do + pushd %{name}-%{version}/${i}/%{name}-%{version} # breaks with %{?_smp_mflags} scons \ @@ -213,15 +218,16 @@ docdir=%{_docdir} \ pkgconfigdir=%{_libdir}/pkgconfig \ udevdir=$(dirname %{_udevrulesdir}) \ - target_python=${pyversions[i]} \ - python_libdir=${pylibdir[i]} \ + target_python=${i} \ + python_libdir=${pylibdir[$cnt]} \ build # Fix python interpreter path. - sed -e "s,#!%{_bindir}/\(python[23]\?\|env \+python[23]\?\),#!%{_bindir}/${pyversions[i]},g" -i \ + sed -e "s,#!%{_bindir}/\(python[23]\?\|env \+python[23]\?\),#!%{_bindir}/${i},g" -i \ gegps gpscat gpsfake xgps xgpsspeed gpsprof ubxtool zerk gps/*.py popd + cnt=`expr $cnt + 1` done %install @@ -230,6 +236,7 @@ export CXXFLAGS="%{optflags}" export CPPFLAGS="%{optflags}" # Install python2 first +%if %{with python2} pushd %{name}-%{version}/python2/%{name}-%{version} DESTDIR=%{buildroot} scons nostrip=True install @@ -238,6 +245,7 @@ find %{buildroot} \( -not -type d -a -not -path "*/python2.*/*" \) -delete popd +%endif pushd %{name}-%{version}/python3/%{name}-%{version} DESTDIR=%{buildroot} scons nostrip=True install @@ -333,9 +341,11 @@ %{_libdir}/pkgconfig/Qgpsmm.pc %{_mandir}/man?/libQgps* +%if %{with python2} %files -n python2-gpsd %{python_sitearch}/gps/ %{python_sitearch}/gps-%{version}.* +%endif %files -n python3-gpsd %{python3_sitearch}/gps/