File deviceinfo.spec of Package deviceinfo
#
# spec file for package timekeeper
#
# 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/
#
Name: deviceinfo
Version: 0.1.0
Release: 0
Summary: Library to detect and configure devices
License: GPL-3.0-or-later
URL: https://github.com/droidian/timekeeper
Source0: %{name}-%{version}.tar.xz
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: gcc
BuildRequires: gmock
BuildRequires: make
%description
Library to detect and configure devices
%package devel
Summary: Common development headers for %{name}
Requires: %{name} = %{version}-%{release}
%description devel
%{summary}.
%package -n libdeviceinfo0
Summary: Device information library for Mobiles
Group: System/Libraries
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
Requires: %{name} = %{version}-%{release}
Provides: libdeviceinfo
%description -n libdeviceinfo0
%{summary}.
%prep
%setup -q
%build
%cmake \
-DDISABLE_TESTS=1 \
-DCMAKE_C_COMPILER=%{_bindir}/gcc \
-DCMAKE_CXX_COMPILER=%{_bindir}/g++ \
-DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir}
%install
%cmake_install
%post -n libdeviceinfo0 -p /sbin/ldconfig
%postun -n libdeviceinfo0 -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%{_bindir}/device-info
%dir %{_sysconfdir}/device-info
%{_sysconfdir}/device-info/alias.conf
%{_sysconfdir}/device-info/default.conf
%{_sysconfdir}/device-info/librem5.conf
%{_sysconfdir}/device-info/pinebook.conf
%{_sysconfdir}/device-info/pinephone.conf
%{_sysconfdir}/device-info/pinetab.conf
%dir %{_sysconfdir}/device-info/sensorfw/
%{_sysconfdir}/device-info/sensorfw/hybris.conf
%{_sysconfdir}/device-info/sensorfw/pinephone.conf
%files -n libdeviceinfo0
%defattr(-,root,root,-)
%{_libdir}/libdeviceinfo.so
%{_libdir}/libdeviceinfo.so.0
%{_libdir}/libdeviceinfo.so.0.1.0
%files devel
%defattr(-,root,root,-)
%{_libdir}/pkgconfig/deviceinfo.pc
%dir %{_includedir}/deviceinfo/
%{_includedir}/deviceinfo/deviceinfo.h