Name:           deepin-devicemanager
Version:        5.6.32
Release:        3
Summary:        Device Manager is a handy tool for viewing hardware information and managing the devices
License:        GPLv3+
URL:            https://github.com/linuxdeepin/deepin-devicemanager
Source0:        %{name}-%{version}.tar.gz
Patch0:         0001-fix-dmidecode17.patch

BuildRequires: gcc-c++
BuildRequires: cmake3
BuildRequires: dtkwidget-devel
BuildRequires: dtkgui-devel
BuildRequires: systemd-devel
BuildRequires: libicu-devel
BuildRequires: qt5-rpm-macros
BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-qttools-devel
BuildRequires: cups-devel
BuildRequires: pkgconfig(dframeworkdbus)
BuildRequires: zeromq-devel
BuildRequires: gtest-devel
BuildRequires: qt5-qtbase-private-devel

Requires: smartmontools
Requires: dmidecode
Requires: xorg-x11-server-utils
Requires: hwinfo
Requires: cups
Requires: upower
Requires: deepin-shortcut-viewer
Requires: lshw
Requires: util-linux

%description
%{summary}.

%prep
%autosetup -p1

%build
# help find (and prefer) qt5 utilities, e.g. qmake, lrelease
export PATH=%{_qt5_bindir}:$PATH
sed -i "s|^cmake_minimum_required.*|cmake_minimum_required(VERSION 3.0)|" $(find . -name "CMakeLists.txt")

mkdir build && pushd build
%cmake ../ -DCMAKE_BUILD_TYPE=Release -DAPP_VERSION=%{version} -DVERSION=%{version}
%make_build
popd

%install
%make_install -C build INSTALL_ROOT="%buildroot"

%post
systemctl enable deepin-devicemanager-server.service


%files
%doc README.md
%license LICENSE
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/%{name}/translations/*.qm
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
/lib/systemd/system/deepin-devicemanager-server.service
%{_bindir}/deepin-devicemanager-server
%{_datadir}/deepin-manual/manual-assets/application/deepin-devicemanager/device-manager/*
/etc/dbus-1/system.d/com.deepin.devicemanager.conf

%changelog
* Fri Mar 22 2024 liweigang <liweiganga@uniontech.com> - 5.6.32-3
- fix: Memory units in Device Manager do not match the memory rate units queried by typing dmidecode17 in the terminal

* Fri Nov 17 2023 hanshuang <hanshuang@uniontech.com> - 5.6.32-2
- modify version info

* Mon Jun 13 2022 uoser <uoser@uniontech.com> - 5.6.32-1.01
- update: update to 5.6.32-1.01
