File libindi.spec of Package libindi

#
# spec file for package libindi
#
# Copyright (c) 2018 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 so_ver 1
%define _udevdir %(pkg-config --variable udevdir udev)

Name:           libindi
Version:        1.7.1
Release:        0
Summary:        Instrument Neutral Distributed Interface
License:        GPL-2.0+ and LGPL-2.1+
Group:          Productivity/Scientific/Astronomy
Url:            http://www.indilib.org/
Source0:        https://github.com/indilib/indi/releases/download/v%{version}/%{name}_%{version}.tar.gz
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  gsl-devel
BuildRequires:  libcfitsio-devel
BuildRequires:  libcurl-devel
BuildRequires:  libfli-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libnova-devel
BuildRequires:  zlib-devel
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(libusb-1.0)
BuildRequires:  pkgconfig(udev)
Requires:       libindi-plugins = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
INDI is an Instrument Neutral Distributed Interface control protocol
for astronomical devices, which provides a framework that decouples low
level hardware drivers from high level front end clients. Clients that
use the device drivers are completely unaware of the device
capabilities and communicate with the device drivers and build a
completely dynamic GUI based on the services provided by the device.

%package devel
Summary:        Development files for libindi
Group:          Development/Libraries/C and C++
Requires:       glibc-devel
Requires:       libindiAlignmentDriver%{so_ver} = %{version}
Requires:       libindidriver%{so_ver} = %{version}

%description devel
This package contains development files for libindi.

%package plugins
Summary:        Plugins for libindi
Group:          Productivity/Scientific/Astronomy
# libindi1 was last used at version 1.3.1
Obsoletes:      libindi1 < %{version}

%description plugins
This package contains plugins for libindi.

%package -n libindiAlignmentDriver%{so_ver}
Summary:        Instrument Neutral Distributed Interface
Group:          System/Libraries

%description -n libindiAlignmentDriver%{so_ver}
INDI is an Instrument Neutral Distributed Interface control protocol
for astronomical devices, which provides a framework that decouples low
level hardware drivers from high level front end clients. Clients that
use the device drivers are completely unaware of the device
capabilities and communicate with the device drivers and build a
completely dynamic GUI based on the services provided by the device.

%package -n libindidriver%{so_ver}
Summary:        Instrument Neutral Distributed Interface
Group:          System/Libraries

%description -n libindidriver%{so_ver}
INDI is an Instrument Neutral Distributed Interface control protocol
for astronomical devices, which provides a framework that decouples low
level hardware drivers from high level front end clients. Clients that
use the device drivers are completely unaware of the device
capabilities and communicate with the device drivers and build a
completely dynamic GUI based on the services provided by the device.

%prep
%setup -q -n %{name}

%build
mkdir build
cd build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags} -fvisibility-inlines-hidden"
_libsuffix=$(echo %_lib | cut -b4-)
cmake \
 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
 -DLIB_SUFFIX="$_libsuffix" \
 -DUDEVRULES_INSTALL_DIR=%{_udevdir}/rules.d \
 ..
make %{?_smp_mflags} VERBOSE=1
cd ..

%install
%cmake_install

%post -n libindiAlignmentDriver%{so_ver} -p /sbin/ldconfig

%postun -n libindiAlignmentDriver%{so_ver} -p /sbin/ldconfig

%post -n libindidriver%{so_ver} -p /sbin/ldconfig

%postun -n libindidriver%{so_ver} -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%license COPYING.* COPYRIGHT LICENSE
%doc AUTHORS ChangeLog NEWS README TODO
%{_datadir}/indi/
%{_bindir}/indi*
%{_udevdir}/rules.d/*.rules

%files devel
%defattr(-,root,root,-)
%license COPYING.GPL COPYING.LGPL LICENSE
%{_includedir}/libindi/
%{_libdir}/pkgconfig/libindi.pc
%{_libdir}/libindi*.so
%{_libdir}/libindi*.a

%files plugins
%defattr(-,root,root,-)
%license COPYING.GPL COPYING.LGPL LICENSE
%{_libdir}/indi/

%files -n libindiAlignmentDriver%{so_ver}
%defattr(-,root,root,-)
%{_libdir}/libindiAlignmentDriver.so.%{so_ver}*

%files -n libindidriver%{so_ver}
%defattr(-,root,root,-)
%{_libdir}/libindidriver.so.%{so_ver}*

%changelog
openSUSE Build Service is sponsored by