File ntrip.spec of Package ntrip

#
# spec file for package ntrip
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2007 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 http://bugs.opensuse.org/
#


Name:           ntrip
Version:        1.6
Release:        0
Summary:        Ntrip data access
License:        GPL
Group:          Applications/Engineering
Url:            http://software.rtcm-ntrip.org/
Source0:        LinuxRtcmDecoder.zip
Source1:        ntripclient.zip
Source2:        NtripPerlClient.zip
Source3:        NtripRTCMMC.zip
Source4:        NtripServerPerl.zip
Source5:        ntripserver.zip
Source6:        rtcm3torinex.zip
Patch1:         rtcmmc_fixcompilerbug.diff
Patch2:         rtcmmc_fixcompilerbug2.diff
Patch3:         rtcmmc_fixcompilerbug3.diff
Patch4:         rtcmmc-gcc46.patch
BuildRequires:  dos2unix
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  unzip
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Ntrip is the data access standard for geodetic data. This package contains
the tools to access Ntrip casters.

Included are following tools:
 - NtripPosixClient   1.52
 - NtripPosixServer   1.51
 - LinuxRTCMDecoder   1.1
 - NtripPerlClient    0.6
 - NtripPerlServer    0.2
 - rtcm3torinex       1.39
 - NtripRTCMMC        1.21

%prep
mkdir ntrip
cd ntrip
mkdir rtcm client perlclient rtcmmc perlserver server rtcm3
pushd rtcm && unzip %{SOURCE0} && tar -xf RTCMModule.tar; popd
pushd client && unzip %{SOURCE1}; popd
pushd perlclient && unzip %{SOURCE2}; popd
pushd rtcmmc && unzip %{SOURCE3} && tar -xf NtripRTCMMC.tar; popd
pushd perlserver && unzip %{SOURCE4}; popd
pushd server && unzip %{SOURCE5}; popd
pushd rtcm3 && unzip %{SOURCE6}; popd
dos2unix rtcm3/rtcm3torinex.txt
dos2unix rtcm/ReadmeRTCMModule.txt
dos2unix perlclient/ReadmePerlClient.txt
dos2unix perlserver/NtripServerPerl.conf
dos2unix perlserver/ReadmeServerPerl.txt
dos2unix server/README
dos2unix client/README
dos2unix rtcm/ReadmeRTCMModule.txt
dos2unix rtcmmc/ReadmeNtripRTCMMC.txt
mv client/README client/README.client
mv server/README server/README.server

%build
cd ntrip
pushd client && make; popd
pushd server && make; popd
pushd rtcm3 && make; popd
pushd rtcm/RTCMModule
  patch -p1 <%{PATCH1}
  patch -p0 <%{PATCH4}
  make
popd
pushd rtcmmc/NtripRTCMMC
  patch -p1 <%{PATCH2}
  patch -p1 <%{PATCH3}
  make
popd

%install
mkdir -p %{buildroot}/%{_bindir}
cp ntrip/rtcmmc/NtripRTCMMC/Release/NtripRTCMMC %{buildroot}/%{_bindir}/ntriprtcmmc
cp ntrip/server/ntripserver %{buildroot}/%{_bindir}
cp ntrip/client/ntripclient %{buildroot}/%{_bindir}
cp ntrip/rtcm3/rtcm3torinex %{buildroot}/%{_bindir}
cp ntrip/rtcm/RTCMModule/rtcm %{buildroot}/%{_bindir}
cp ntrip/perlclient/NtripPerlClient.pl %{buildroot}/%{_bindir}/ntripclientperl
cp ntrip/perlserver/NtripServerPerl %{buildroot}/%{_bindir}/ntripserverperl

%files
%defattr(755, root, root, 0755)
%{_bindir}/*
%defattr(644, root, root, 0755)
%doc ntrip/rtcmmc/NtripRTCMMC/NtripRTCMMC.cfg
%doc ntrip/rtcmmc/ReadmeNtripRTCMMC.txt
%doc ntrip/server/README.server
%doc ntrip/client/README.client
%doc ntrip/rtcm3/rtcm3torinex.txt
%doc ntrip/rtcm/ReadmeRTCMModule.txt
%doc ntrip/perlclient/NtripPerlClient.conf
%doc ntrip/perlclient/ReadmePerlClient.txt
%doc ntrip/perlserver/NtripServerPerl.conf
%doc ntrip/perlserver/ReadmeServerPerl.txt
%doc ntrip/perlserver/StartNtripServerPerl

%changelog
openSUSE Build Service is sponsored by