File rnxcmp.spec of Package rnxcmp

#
# spec file for package rnxcmp
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2015-2020 Dirk Stoecker <opensuse@dstoecker.de>.
#
# 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 https://bugs.opensuse.org/
#


Name:           rnxcmp
Version:        4.1.0
Release:        0
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  gcc
URL:            https://terras.gsi.go.jp/ja/crx2rnx.html
Summary:        Compressed RINEX tools by Yuki Hatanaka
License:        SUSE-Public-Domain
Group:          Hardware/Other
%define fpath   RNXCMP_%{version}_src
%define spath   source
# blocks wget and download tools!
#Source0:        http://terras.gsi.go.jp/ja/crx2rnx/...
Source0:        %{fpath}.tar.gz
Source1:        c2rfx241.c
Source2:        gpscal
Patch1:         gpscal_shebang.patch
Patch2:         c2rfx241_warnings.patch

%description
RNX2CRX is a program to compress RINEX version 2 observation files into Compact
RINEX format. CRX2RNX is the uncompression program to retrieve original RINEX
files from Compact RINEX files. (See crinex.doc for details of the Compact
RINEX format.)

Since Compact RINEX is ASCII text format, the high compression rate is achieved 
by combining the Compact RINEX file generation with an additional standard
data compression program such as UNIX "compress" command.

For convenience, front-end tools RNX2CRZ and CRZ2CRX are also
provided to do these two steps by one command. We recommend to use these
tools for the compression/decompression of all RINEX files (i.e., for
navigation message files and met files, too): They will automatically
skip the Compact RINEX step for non-observation files.

Additionally supplied are following tools:
 - gpscal    - a calender tool for GPS
 - c2rfx241  - a tool to fix files generated by rnx2crx version 2.4.1

%prep
%setup -q -n %{fpath}
cp %{SOURCE1} %{SOURCE2} .
%patch -P1 -p0
%patch -P2 -p0

%build
gcc -Wall c2rfx241.c -o c2rfx241
cd %{spath}
gcc -Wall rnx2crx.c -o RNX2CRX
gcc -Wall crx2rnx.c -o CRX2RNX

%install
%{__rm} -rf %{buildroot}
mkdir -p %{buildroot}/%{_bindir}
cp gpscal c2rfx241 %{buildroot}/%{_bindir}
cp front-end-tools/unix/* %{buildroot}/%{_bindir}
cp %{spath}/RNX2CRX %{spath}/CRX2RNX %{buildroot}/%{_bindir}
# also add lower case versions
ln -s CRX2RNX %{buildroot}/%{_bindir}/crx2rnx
ln -s CRZ2RNX %{buildroot}/%{_bindir}/crz2rnx
ln -s RNX2CRX %{buildroot}/%{_bindir}/rnx2crx
ln -s RNX2CRZ %{buildroot}/%{_bindir}/rnx2crz

%check

%files
%defattr(755, root, root, 0755)
%{_bindir}/CRX2RNX
%{_bindir}/RNX2CRX
%{_bindir}/CRZ2RNX
%{_bindir}/RNX2CRZ
%{_bindir}/gpscal
%{_bindir}/crx2rnx
%{_bindir}/crz2rnx
%{_bindir}/rnx2crx
%{_bindir}/rnx2crz
%{_bindir}/c2rfx241
%defattr(644, root, root, 0755)
%doc docs/*

%changelog
openSUSE Build Service is sponsored by