Accepting request 546209 from home:pluskalm:python3
- removed gpsd-fix-shebang.patch - reworked gpsd-python3.patch - build python3 subpackage OBS-URL: https://build.opensuse.org/request/show/546209 OBS-URL: https://build.opensuse.org/package/show/Application:Geo/gpsd?expand=0&rev=112
This commit is contained in:
committed by
Git OBS Bridge
parent
bf1a342689
commit
3dfb313ec3
138
gpsd.spec
138
gpsd.spec
@@ -16,15 +16,14 @@
|
||||
#
|
||||
|
||||
|
||||
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
||||
%if ! %{defined _fillupdir}
|
||||
%define _fillupdir /var/adm/fillup-templates
|
||||
%endif
|
||||
|
||||
%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.17
|
||||
Release: 0
|
||||
@@ -38,8 +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
|
||||
Patch1: gpsd-python3.patch
|
||||
Source100: gpsd-python3.patch
|
||||
BuildRequires: chrpath
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: gcc-c++
|
||||
@@ -57,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
|
||||
@@ -118,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
|
||||
@@ -146,39 +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
|
||||
%patch1 -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}%{_fillupdir}
|
||||
install -d -m 755 %{buildroot}%{_datadir}/applications
|
||||
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}%{_fillupdir}
|
||||
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
|
||||
chmod 755 %{buildroot}%{python_sitearch}/gps/gps.py
|
||||
# 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
|
||||
@@ -191,28 +251,28 @@ 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
|
||||
@@ -220,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.*
|
||||
@@ -238,21 +297,19 @@ sed -i -e 's#Icon=.*/\([^/]\+\)\(\..\+\)#Icon=\1#' %{buildroot}%{_datadir}/appli
|
||||
%{_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.*
|
||||
@@ -269,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.*
|
||||
|
Reference in New Issue
Block a user