File libtd.spec of Package libtd
#
# spec file for package libtd
#
# Copyright (c) 2022 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 __builder ninja
%define _lto_cflags %{nil}
Name: libtd
Version: 1.8.13
Release: 0
Summary: Cross-platform library for building Telegram clients
# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses
License: BSL-1.0
URL: https://github.com/tdlib/td
Source: %{url}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: gperf
BuildRequires: ninja
BuildRequires: gperftools-devel
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(zlib)
%description
TDLib (Telegram Database library) is a cross-platform library for building Telegram clients.
It can be easily used from almost any programming language.
%package devel
Summary: Development files for %{name}
%description devel
%{summary}.
%package static
Summary: Static libraries for %{name}
Requires: %{name} = %{version}
Requires: %{name}-devel = %{version}
%description static
%{summary}.
%prep
%autosetup
%build
%cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_LIBDIR=%{_lib} \
-DTD_ENABLE_JNI:BOOL=OFF \
-DTD_ENABLE_DOTNET:BOOL=OFF
%cmake_build
%install
%cmake_install
%post -n %{name} -p /sbin/ldconfig
%postun -n %{name} -p /sbin/ldconfig
%files
%license LICENSE_1_0.txt
%doc README.md CHANGELOG.md
%{_libdir}/libtd*.so.%{version}
%files static
%{_libdir}/libtd*.a
%files devel
%{_includedir}/td
%{_libdir}/libtd*.so
%{_libdir}/cmake/Td
%{_libdir}/pkgconfig/td*.pc
%changelog