File telegram-qt5.spec of Package telegram-qt

%define version_major 0
%define version_minor 2
%define version_patch 0

%define libname libTelegramQt5
%define	soversion %{version_major}_%{version_minor}


Name:		telegram-qt5
Summary:	Qt library for Telegram network
Version:	0.2.0
Release:	1
Group:		System/Libraries
License:	LGPL-2.1
URL:		https://github.com/Kaffeine/telegram-qt
Source0:	%{name}-%{version}.tar.gz
BuildRequires:	pkgconfig(Qt5Core)
BuildRequires:	pkgconfig(Qt5Network)
BuildRequires:	pkgconfig(Qt5Qml)
#FIXME disabled until ported to openssl 1.1.0
#BuildRequires:	pkgconfig(openssl)
BuildRequires:	libopenssl-1_0_0-devel
BuildRequires:	cmake >= 2.8

%description
%{summary}.


%package -n %{libname}-%{soversion}
Summary:	Qt library for Telegram network
Group:		Development/Libraries
Provides:	libtelegram-qt5-%{soversion} = %{version}

%description -n %{libname}-%{soversion}
%{summary}.


%package devel
Summary:	Development headers and pkg-config for TelegramQt library
Group:		Development/Libraries
Requires:	%{libname}-%{soversion} = %{version}

%description devel
%{summary}.


%prep
%setup -q


%build
%cmake -DENABLE_TESTAPP=FALSE

make %{?_smp_mflags}


%install
%cmake_install


%clean
rm -rf %{buildroot}


%post -n %{libname}-%{soversion}
/sbin/ldconfig

%postun -n %{libname}-%{soversion}
/sbin/ldconfig


%files -n %{libname}-%{soversion}
%defattr(-,root,root,-)
%{_libdir}/libTelegramQt5.so.%{version_major}.%{version_minor}
%{_libdir}/libTelegramQt5.so.%{version_major}.%{version_minor}.%{version_patch}
%dir %{_libdir}/qt5/qml/TelegramQt
%{_libdir}/qt5/qml/TelegramQt/qmldir
%{_libdir}/qt5/qml/TelegramQt/plugins.qmltypes
%{_libdir}/qt5/qml/TelegramQt/libTelegramQt5Qml.so


%files devel
%defattr(-,root,root,-)
%{_libdir}/libTelegramQt5.so
%{_includedir}/TelegramQt5
%{_libdir}/cmake/TelegramQt5
%{_libdir}/pkgconfig/TelegramQt5.pc


%changelog