drop python2 subpackage (#1633793)
This commit is contained in:
parent
884e3ea210
commit
f1df8688aa
69
gpsd.spec
69
gpsd.spec
@ -14,7 +14,7 @@ URL: http://catb.org/gpsd/
|
||||
Source0: http://download.savannah.gnu.org/releases/gpsd/%{name}-%{version}.tar.gz
|
||||
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: systemd
|
||||
%if %{with_qt}
|
||||
@ -46,16 +46,6 @@ Group: System Environment/Libraries
|
||||
This package contains the gpsd libraries that manage access
|
||||
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}
|
||||
Summary: Python libraries and modules for use with gpsd
|
||||
Group: System Environment/Libraries
|
||||
@ -120,41 +110,27 @@ different gps devices.
|
||||
|
||||
|
||||
%prep
|
||||
rm -fr %{srcname}-%{version}
|
||||
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}
|
||||
%setup -q
|
||||
|
||||
# set gpsd revision string to include package revision
|
||||
sed -i 's|^revision=.*REVISION.*$|revision='\'\
|
||||
'#define REVISION "%{version}-%{release}'\"\'\| python*/%{srcname}-%{version}/SConstruct
|
||||
'#define REVISION "%{version}-%{release}'\"\'\| SConstruct
|
||||
|
||||
# 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
|
||||
sed -i 's|systemctl daemon-reload|true|' python*/%{srcname}-%{version}/SConstruct
|
||||
sed -i 's|systemctl daemon-reload|true|' SConstruct
|
||||
|
||||
# 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
|
||||
export CCFLAGS="%{optflags}"
|
||||
export LINKFLAGS="%{__global_ldflags}"
|
||||
|
||||
pyversions=( python2 python3 )
|
||||
pylibdir=( %{python2_sitearch} %{python3_sitearch} )
|
||||
|
||||
for i in 0 1
|
||||
do
|
||||
pushd %{srcname}-%{version}/${pyversions[i]}/%{srcname}-%{version}
|
||||
|
||||
# breaks with %{_smp_mflags}
|
||||
scons \
|
||||
# breaks with %{_smp_mflags}
|
||||
scons \
|
||||
dbus_export=yes \
|
||||
systemd=yes \
|
||||
%if %{with_qt}
|
||||
@ -174,33 +150,20 @@ do
|
||||
docdir=%{_docdir} \
|
||||
pkgconfigdir=%{_libdir}/pkgconfig \
|
||||
udevdir=$(dirname %{_udevrulesdir}) \
|
||||
target_python=${pyversions[i]} \
|
||||
python_libdir=${pylibdir[i]} \
|
||||
target_python=python3 \
|
||||
python_libdir=%{python3_sitearch} \
|
||||
build
|
||||
|
||||
# Fix python interpreter path.
|
||||
sed -e "s,#!/usr/bin/\(python[23]\?\|env \+python[23]\?\),#!/usr/bin/${pyversions[i]},g" -i \
|
||||
# Fix python interpreter path.
|
||||
sed -e "s,#!/usr/bin/\(python[23]\?\|env \+python[23]\?\),#!/usr/bin/python3,g" -i \
|
||||
gegps gpscat gpsfake xgps xgpsspeed gpsprof gps/*.py
|
||||
|
||||
popd
|
||||
done
|
||||
|
||||
%install
|
||||
# avoid rebuilding
|
||||
export CCFLAGS="%{optflags}"
|
||||
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
|
||||
|
||||
# use the old name for udev rules
|
||||
@ -250,7 +213,7 @@ desktop-file-install \
|
||||
%endif
|
||||
|
||||
%files
|
||||
%doc %{name}-%{version}/python3/%{name}-%{version}/README %{name}-%{version}/python3/%{name}-%{version}/COPYING
|
||||
%doc README COPYING
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
|
||||
%{_sbindir}/gpsd
|
||||
%{_sbindir}/gpsdctl
|
||||
@ -274,10 +237,6 @@ desktop-file-install \
|
||||
%files libs
|
||||
%{_libdir}/libgps.so.23*
|
||||
|
||||
%files -n python2-%{srcname}
|
||||
%{python2_sitearch}/gps*
|
||||
%exclude %{python_sitearch}/gps/fake*
|
||||
|
||||
%files -n python3-%{srcname}
|
||||
%{_bindir}/gpsprof
|
||||
%{_mandir}/man1/gpsprof.1*
|
||||
@ -286,7 +245,7 @@ desktop-file-install \
|
||||
%exclude %{python3_sitearch}/gps/__pycache__/fake*
|
||||
|
||||
%files devel
|
||||
%doc %{name}-%{version}/python3/%{name}-%{version}/TODO
|
||||
%doc TODO
|
||||
%{_libdir}/libgps.so
|
||||
%{_libdir}/pkgconfig/libgps.pc
|
||||
%{_includedir}/gps.h
|
||||
|
Loading…
Reference in New Issue
Block a user