drop python2 subpackage (#1633793)

This commit is contained in:
Miroslav Lichvar 2018-10-03 17:57:21 +02:00
parent 884e3ea210
commit f1df8688aa

111
gpsd.spec
View File

@ -14,7 +14,7 @@ URL: http://catb.org/gpsd/
Source0: http://download.savannah.gnu.org/releases/gpsd/%{name}-%{version}.tar.gz Source0: http://download.savannah.gnu.org/releases/gpsd/%{name}-%{version}.tar.gz
Source11: gpsd.sysconfig Source11: gpsd.sysconfig
BuildRequires: dbus-devel dbus-glib-devel ncurses-devel xmlto python2-devel python3-devel BuildRequires: dbus-devel dbus-glib-devel ncurses-devel xmlto python3-devel
BuildRequires: scons desktop-file-utils bluez-libs-devel pps-tools-devel /usr/bin/c++ BuildRequires: scons desktop-file-utils bluez-libs-devel pps-tools-devel /usr/bin/c++
BuildRequires: systemd BuildRequires: systemd
%if %{with_qt} %if %{with_qt}
@ -46,16 +46,6 @@ Group: System Environment/Libraries
This package contains the gpsd libraries that manage access This package contains the gpsd libraries that manage access
to a GPS for applications. to a GPS for applications.
%package -n python2-%{srcname}
Summary: Python libraries and modules for use with gpsd
Group: System Environment/Libraries
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%{?python_provide:%python_provide python2-%{srcname}}
%description -n python2-%{srcname}
This package contains the python2 modules that manage access to a GPS for
applications, and commonly useful python applications for use with gpsd.
%package -n python3-%{srcname} %package -n python3-%{srcname}
Summary: Python libraries and modules for use with gpsd Summary: Python libraries and modules for use with gpsd
Group: System Environment/Libraries Group: System Environment/Libraries
@ -120,87 +110,60 @@ different gps devices.
%prep %prep
rm -fr %{srcname}-%{version} %setup -q
mkdir -p %{srcname}-%{version}/python2
mkdir -p %{srcname}-%{version}/python3
tar -xf %{SOURCE0} -C %{srcname}-%{version}/python2
tar -xf %{SOURCE0} -C %{srcname}-%{version}/python3
cd %{srcname}-%{version}
# set gpsd revision string to include package revision # set gpsd revision string to include package revision
sed -i 's|^revision=.*REVISION.*$|revision='\'\ sed -i 's|^revision=.*REVISION.*$|revision='\'\
'#define REVISION "%{version}-%{release}'\"\'\| python*/%{srcname}-%{version}/SConstruct '#define REVISION "%{version}-%{release}'\"\'\| SConstruct
# fix systemd path # fix systemd path
sed -i 's|systemd_dir =.*|systemd_dir = '\'%{_unitdir}\''|' python*/%{srcname}-%{version}/SConstruct sed -i 's|systemd_dir =.*|systemd_dir = '\'%{_unitdir}\''|' SConstruct
# don't try reloading systemd when installing in the build root # don't try reloading systemd when installing in the build root
sed -i 's|systemctl daemon-reload|true|' python*/%{srcname}-%{version}/SConstruct sed -i 's|systemctl daemon-reload|true|' SConstruct
# don't set RPATH # don't set RPATH
sed -i 's|env.Prepend.*RPATH.*|pass #\0|' python*/%{srcname}-%{version}/SConstruct sed -i 's|env.Prepend.*RPATH.*|pass #\0|' SConstruct
%build %build
export CCFLAGS="%{optflags}" export CCFLAGS="%{optflags}"
export LINKFLAGS="%{__global_ldflags}" export LINKFLAGS="%{__global_ldflags}"
pyversions=( python2 python3 ) # breaks with %{_smp_mflags}
pylibdir=( %{python2_sitearch} %{python3_sitearch} ) scons \
dbus_export=yes \
systemd=yes \
%if %{with_qt}
libQgpsmm=yes \
%else
libQgpsmm=no \
%endif
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=python3 \
python_libdir=%{python3_sitearch} \
build
for i in 0 1 # Fix python interpreter path.
do sed -e "s,#!/usr/bin/\(python[23]\?\|env \+python[23]\?\),#!/usr/bin/python3,g" -i \
pushd %{srcname}-%{version}/${pyversions[i]}/%{srcname}-%{version} gegps gpscat gpsfake xgps xgpsspeed gpsprof gps/*.py
# breaks with %{_smp_mflags}
scons \
dbus_export=yes \
systemd=yes \
%if %{with_qt}
libQgpsmm=yes \
%else
libQgpsmm=no \
%endif
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]\?\),#!/usr/bin/${pyversions[i]},g" -i \
gegps gpscat gpsfake xgps xgpsspeed gpsprof gps/*.py
popd
done
%install %install
# avoid rebuilding # avoid rebuilding
export CCFLAGS="%{optflags}" export CCFLAGS="%{optflags}"
export LINKFLAGS="%{__global_ldflags}" export LINKFLAGS="%{__global_ldflags}"
# Install python2 first
pushd %{srcname}-%{version}/python2/%{srcname}-%{version}
DESTDIR=%{buildroot} scons install systemd_install udev-install
# Now delete all the installed files except the python2 files
find %{buildroot} \( -not -type d -a -not -path "*/python2.*/*" \) -delete
popd
pushd %{srcname}-%{version}/python3/%{srcname}-%{version}
DESTDIR=%{buildroot} scons install systemd_install udev-install DESTDIR=%{buildroot} scons install systemd_install udev-install
# use the old name for udev rules # use the old name for udev rules
@ -250,7 +213,7 @@ desktop-file-install \
%endif %endif
%files %files
%doc %{name}-%{version}/python3/%{name}-%{version}/README %{name}-%{version}/python3/%{name}-%{version}/COPYING %doc README COPYING
%config(noreplace) %{_sysconfdir}/sysconfig/%{name} %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%{_sbindir}/gpsd %{_sbindir}/gpsd
%{_sbindir}/gpsdctl %{_sbindir}/gpsdctl
@ -274,10 +237,6 @@ desktop-file-install \
%files libs %files libs
%{_libdir}/libgps.so.23* %{_libdir}/libgps.so.23*
%files -n python2-%{srcname}
%{python2_sitearch}/gps*
%exclude %{python_sitearch}/gps/fake*
%files -n python3-%{srcname} %files -n python3-%{srcname}
%{_bindir}/gpsprof %{_bindir}/gpsprof
%{_mandir}/man1/gpsprof.1* %{_mandir}/man1/gpsprof.1*
@ -286,7 +245,7 @@ desktop-file-install \
%exclude %{python3_sitearch}/gps/__pycache__/fake* %exclude %{python3_sitearch}/gps/__pycache__/fake*
%files devel %files devel
%doc %{name}-%{version}/python3/%{name}-%{version}/TODO %doc TODO
%{_libdir}/libgps.so %{_libdir}/libgps.so
%{_libdir}/pkgconfig/libgps.pc %{_libdir}/pkgconfig/libgps.pc
%{_includedir}/gps.h %{_includedir}/gps.h