File nds2-client.spec of Package nds2-client

#
# spec file for package nds2-client
#
# Copyright (c) 2023 SUSE LLC
#
# 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/
#


%define shlib_client libndsclient1
%define shlib_cxx libndscxx1
Name:           nds2-client
Version:        0.16.8
Release:        0
Summary:        NDS (Network Data Server) client interface
License:        GPL-2.0-only
URL:            https://git.ligo.org/nds/nds2-client
Source:         https://software.igwn.org/lscsoft/source/%{name}-%{version}.tar.bz2
BuildRequires:  cmake
BuildRequires:  cyrus-sasl-devel
BuildRequires:  gcc-c++
BuildRequires:  libboost_filesystem-devel
BuildRequires:  libboost_headers-devel
BuildRequires:  libboost_system-devel
BuildRequires:  python3-devel

%description
This package provides the NDS (Network Data Server) client interface in C and
C++. NDS is a TCP/IP protocol for retrieving online or archived data from
thousands of instrument channels at LIGO (Laser Interferometer
Gravitational-Wave Observatory) sites and data analysis clusters.

%package -n %{shlib_client}
Summary:        Shared library for ndsclient

%description -n %{shlib_client}
This package provides the shared library for ndsclient.

%package -n %{shlib_cxx}
Summary:        Shared library for ndsclient's c++ bindings

%description -n %{shlib_cxx}
This package provides the shared library for the c++ bindings for ndsclient.

%package devel
Summary:        Headers and sources to develop programs against nds2-client
Requires:       %{shlib_client} = %{version}
Requires:       %{shlib_cxx} = %{version}

%description devel
This package provides the headers and sources needed to develop codes against
nds2-client.

%prep
%autosetup -p1

%build
%cmake
%cmake_build

%install
%cmake_install
find %{buildroot}%{_libdir}/ -name *.a -delete -print
sed -Ei "1{s@%{_bindir}/env python@%{_bindir}/python3@}" %{buildroot}%{_libexecdir}/%{name}/*.py

# Config files unnecessary for installation to std dirs as in this pkg
rm -fr %{buildroot}%{_sysconfdir}/*

chmod +x %{buildroot}%{_libexecdir}/nds2-client/test-scripts/llodts0-cmd.sh

%check
%ctest

%post   -n %{shlib_client} -p /sbin/ldconfig
%postun -n %{shlib_client} -p /sbin/ldconfig
%post   -n %{shlib_cxx}    -p /sbin/ldconfig
%postun -n %{shlib_cxx}    -p /sbin/ldconfig

%files
%license COPYING
%doc ChangeLog.md
%{_bindir}/*
%{_mandir}/man1/*.1%{?ext_man}

%files -n %{shlib_client}
%{_libdir}/libndsclient.so.*

%files -n %{shlib_cxx}
%{_libdir}/libndscxx.so.*

%files devel
%license COPYING
%doc ChangeLog.md
%{_includedir}/%{name}/
%{_libdir}/*.so
%{_libdir}/cmake/%{name}/
%{_libdir}/%{name}/
%{_libdir}/pkgconfig/*.pc
%{_libexecdir}/%{name}/

%changelog
openSUSE Build Service is sponsored by