Name:     libpredict
Version:  2.0.0
Release:  alt1
Summary:  A satellite orbit prediction library
Summary(ru.UTF-8): Программная библиотека для аппроксимации орбит спутников Земли
Group:    Sciences/Astronomy
License:  GPLv2+
URL:      https://github.com/la1k/libpredict
Source0:  %name-%version.tar
Patch1:   alt-cmake-warnings-is-passed.patch
Packager: Alexander Lubyagin <dfpl@altlinux.org>

BuildRequires(pre): rpm-macros-cmake
BuildRequires: cmake gcc-common gcc-c++
BuildRequires: ctest

%description
libpredict allows to calculate satellite orbits based on their
position parameters at any given time. It supports any orbit
types used by satellites, for example geostationary, elliptical,
geosynchronous.

%description -l ru.UTF-8
Библиотека libpredict позволяет аппроксимировать орбиту спутников Земли
по времени на основе параметров орбиты. Поддерживаются геостационарная,
эллиптическая и геосинхронная орбиты.

%package devel
Summary: Development environment for libpredict
Summary(ru.UTF-8): Среда разработки для libpredict с динамической библиотекой
Group: Development/C++
Requires: %name = %version-%release

%description devel
libpredict allows to calculate satellite orbits based on their
position parameters at any given time. It supports any orbit
types used by satellites, for example geostationary, elliptical,
geosynchronous.
This package contains development files you can use to develop
applications using orbit predict computations.

%description devel -l ru.UTF-8
Библиотека libpredict позволяет аппроксимировать орбиту спутников Земли
по времени на основе параметров орбиты. Поддерживаются геостационарная,
эллиптическая и геосинхронная орбиты.
Этот пакет содержит файлы для разработки и динамической линковки
с libpredict.

%package examples
Summary: Source code examples for libpredict
Summary(ru.UTF-8): Примеры кода для libpredict
Group: Development/C++
Requires: %name = %version-%release

%description examples
libpredict allows to calculate satellite orbits based on their
position parameters at any given time. It supports any orbit
types used by satellites, for example geostationary, elliptical,
geosynchronous.
This package contains source code examples using orbit predict
computations.

%description examples -l ru.UTF-8
Библиотека libpredict позволяет аппроксимировать орбиту спутников Земли
по времени на основе параметров орбиты. Поддерживаются геостационарная,
эллиптическая и геосинхронная орбиты.
Этот пакет содержит примеры программ в исходных кодах, иллюстрирующие
различные функции libpredict.

%package devel-static
Summary: Static libpredict library
Summary(ru.UTF-8): Среда разработки для libpredict со статической библиотекой
Group: Development/C++
Requires: %name-devel = %version-%release
Requires: glibc-devel-static

%description devel-static
libpredict allows to calculate satellite orbits based on their
position parameters at any given time. It supports any orbit
types used by satellites, for example geostationary, elliptical,
geosynchronous.
This package contains development files you can use to develop
statically linked applications using orbit predict computations.

%description devel-static -l ru.UTF-8
Библиотека libpredict позволяет аппроксимировать орбиту спутников Земли
по времени на основе параметров орбиты. Поддерживаются геостационарная,
эллиптическая и геосинхронная орбиты.
Этот пакет содержит файлы для разработки и статической линковки
с libpredict.

%prep
%setup
%patch1 -p0

%build
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
cmake --build .

%install
cd build
make DESTDIR="%buildroot/" install
cd ..
install -d -m755 %buildroot%_docdir/%name
install -p -m644 README.md CONTRIBUTING.md COPYING CREDITS %buildroot%_docdir/%name/
cp -a examples %buildroot%_docdir/%name/

%check
cd build
make test

%files
%_docdir/%name/*
%exclude %_docdir/%name/examples
%_libdir/*.so.*

%files examples
%_docdir/%name/examples/

%files devel
%_libdir/*.so
%_includedir/predict/*.h
%_libdir/pkgconfig/*.pc

%files devel-static
%_libdir/*.a

%changelog
* Thu Aug 01 2024 Alexander Lubyagin <dfpl@altlinux.org> 2.0.0-alt1
- first build for ALT Linux
