File rtklib-ex.spec of Package rtklib-ex
#
# spec file for package rtklib
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define win32 1
%define useqt 1
%define winname RTKLIB_EX
%define libname libRTKLib
%define sovers 1
%define _libname %{libname}%{sovers}
Name: rtklib-ex
Version: 2.5.0
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Url: https://rtklibexplorer.wordpress.com/
Summary: Program Package for GNSS Positioning
License: BSD-2-Clause
Group: Productivity/Networking/System
Source: https://github.com/rtklibexplorer/RTKLIB/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
%if %{win32}
Source1: https://github.com/rtklibexplorer/RTKLIB/releases/download/v%{version}/%{winname}_%{version}.zip#/%{name}-bin-%{version}.zip
%endif
# PATCH-FIX-UPSTREAM don't include RPATH
Patch1: rtklib-2.4.3.b34k-rpath.patch
BuildRequires: c_compiler
BuildRequires: gcc-fortran
%if %{useqt}
BuildRequires: pkgconfig(Qt6Concurrent)
BuildRequires: pkgconfig(Qt6Gui)
BuildRequires: pkgconfig(Qt6Platform)
BuildRequires: pkgconfig(Qt6SerialPort)
BuildRequires: pkgconfig(Qt6Widgets)
BuildRequires: pkgconfig(Qt6Xml)
%endif
BuildRequires: lapack-devel
BuildRequires: unzip
Provides: rtklib = %{version}
Obsoletes: rtklib < 2.4.4
%description
RTKLIB is an open source program package for standard and precise
positioning with GNSS (global navigation satellite system). RTKLIB
consists of a portable program library and several APs (application
programs) utilizing the library.
%if %{win32}
%package win32
Summary: Program Package for GNSS Positioning - Windows binaries
Group: Productivity/Networking/System
Requires: %{name}
Requires: gzip
Requires: rnxcmp
Requires: tar
Requires: wget
Requires: wine
Provides: rtklib-win32 = %{version}
Obsoletes: rtklib-win32 < 2.4.4
%description win32
RTKLIB is an open source program package for standard and precise
positioning with GNSS (global navigation satellite system). RTKLIB
consists of a portable program library and several APs (application
programs) utilizing the library.
This package contains the windows executables and wrappers to call them.
%endif
%if %{useqt}
%package qt
Summary: Program Package for GNSS Positioning - GUI
Group: Productivity/Networking/System
Requires: %{name}
Requires: gzip
Requires: rnxcmp
Requires: tar
Requires: wget
Provides: rtklib-qt = %{version}
Obsoletes: rtklib-qt < 2.4.4
%description qt
RTKLIB is an open source program package for standard and precise
positioning with GNSS (global navigation satellite system). RTKLIB
consists of a portable program library and several APs (application
programs) utilizing the library.
This package contains the GUI tools.
%package -n %{_libname}
Summary: Library for RTKLib
Group: Development/Libraries/C and C++
%description -n %{_libname}
Library for RTKLib tools
%post -n %{_libname} -p /sbin/ldconfig
%postun -n %{_libname} -p /sbin/ldconfig
%endif
%prep
%if %{win32}
%setup -b1 -n RTKLIB-%{version}
%else
%setup -n RTKLIB-%{version}
%endif
%patch -P1 -p1
%build
# Next release: Switch to cmake
pushd lib/iers/gcc/
make
popd
pushd app/consapp
make
popd
%if %{useqt}
pushd app/qtapp
qmake6
make
sh install_qtapp
popd
%endif
%install
mkdir -p %{buildroot}/%{_bindir}
mkdir -p %{buildroot}/%{_libdir}
mkdir -p %{buildroot}/%{_datadir}/rtklib
install -m 755 ../RTKLIB_bin/* %{buildroot}/%{_bindir}
install -m 755 lib/%{libname}.so.* %{buildroot}/%{_libdir}
install -m 755 app/consapp/convbin/gcc/convbin %{buildroot}/%{_bindir}
install -m 755 app/consapp/pos2kml/gcc/pos2kml %{buildroot}/%{_bindir}
install -m 755 app/consapp/str2str/gcc/str2str %{buildroot}/%{_bindir}
install -m 755 app/consapp/rnx2rtkp/gcc/rnx2rtkp %{buildroot}/%{_bindir}
install -m 755 app/consapp/rtkrcv/gcc/rtkrcv %{buildroot}/%{_bindir}
install -m 755 app/consapp/rtkrcv/gcc/rtk*.sh %{buildroot}/%{_bindir}
install -m 644 data/ant/*.atx %{buildroot}/%{_datadir}/rtklib
%if %{win32}
mkdir -p %{buildroot}/%{_datadir}/rtklib/win
pushd ../%{winname}_%{version}/
for file in *.exe; do
name=`echo "%{buildroot}/%{_bindir}/$file" | sed s/\.exe//`
if [ ! -f $name ]; then
echo -e '#!/bin/bash\nwine' "%{_datadir}/rtklib/win/$file" '$@' >$name
chmod 755 $name
install -m 644 $file %{buildroot}/%{_datadir}/rtklib/win/
fi
done
popd
%endif
%check
%files
%defattr(755, root, root, 0755)
%{_bindir}/convbin
%{_bindir}/pos2kml
%{_bindir}/str2str
%{_bindir}/rnx2rtkp
%{_bindir}/rtkrcv
%{_bindir}/rtkstart.sh
%{_bindir}/rtkshut.sh
%dir %{_datadir}/rtklib
%defattr(644, root, root, 0755)
%{_datadir}/rtklib/*.atx
%doc readme.txt app/consapp/rtkrcv/*/*.conf
%license license.txt
%if %{useqt}
%files qt
%defattr(-, root, root)
%{_bindir}/*_qt
%license license.txt
%files -n %{_libname}
%{_libdir}/%{libname}.so.%{sovers}*
%endif
%if %{win32}
%files win32
%defattr(-, root, root)
%dir %{_datadir}/rtklib/win
%license license.txt
%doc readme.txt
%exclude %{_datadir}/rtklib/win/crx2rnx.exe
%{_datadir}/rtklib/win/rtkconv.exe
%{_datadir}/rtklib/win/rtkget.exe
%{_datadir}/rtklib/win/rtklaunch.exe
%{_datadir}/rtklib/win/rtknavi.exe
%{_datadir}/rtklib/win/rtkplot.exe
%{_datadir}/rtklib/win/rtkpost.exe
%{_datadir}/rtklib/win/srctblbrows.exe
%{_datadir}/rtklib/win/strsvr.exe
%exclude %{_datadir}/rtklib/win/wget.exe
%exclude %{_bindir}/crx2rnx
%{_bindir}/rtkconv
%{_bindir}/rtkget
%{_bindir}/rtklaunch
%{_bindir}/rtknavi
%{_bindir}/rtkplot
%{_bindir}/rtkpost
%{_bindir}/srctblbrows
%{_bindir}/strsvr
%exclude %{_bindir}/wget
%endif
%changelog