Name:           dde-network-core
Version:        1.1.28.1
Release:        1%{?dist}
Summary:        Deepin desktop-environment - network core files
License:        GPLv3
URL:            https://github.com/linuxdeepin/dde-network-core
Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz

Patch0001:      0001-feat-add-missing-include.patch

BuildRequires:  gcc-c++
BuildRequires:  cmake
BuildRequires:  pkgconfig(dframeworkdbus) >= 2.0

BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  qt5-qtbase-devel
BuildRequires:  qt5-qtbase-private-devel
BuildRequires:  qt5-linguist
BuildRequires:  pkgconfig(gsettings-qt)
BuildRequires:  qt5-qttools-devel
BuildRequires:  qt5-qtsvg-devel

BuildRequires:  kf5-networkmanager-qt-devel

BuildRequires:  dtkwidget-devel
BuildRequires:  dde-control-center
BuildRequires:  dde-control-center-devel
BuildRequires:  dde-dock-devel
BuildRequires:  dde-qt-dbus-factory-devel
BuildRequires:  dde-session-shell-devel
BuildRequires:  systemd-devel


BuildRequires:  gtest-devel
BuildRequires:  gmock

Obsoletes:      dde-network-utils <= 5.4.15

%description
Deepin desktop-environment - network core files.

%package devel
Summary:        Development package for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}
Obsoletes:      dde-network-utils-devel <= 5.4.15

%description devel
Header files and libraries for %{name}.

%prep
%autosetup -p1

sed -i 's|lib/|%{_lib}/|' dock-network-plugin/CMakeLists.txt

%build
export PATH=%{_qt5_bindir}:$PATH
mkdir build && cd build
%cmake ..
%make_build

%install
cd build
%make_install INSTALL_ROOT=%{buildroot}

%files
%doc README.md
%{_prefix}/lib/dde-control-center/
%{_libdir}/dde-dock/
%{_prefix}/lib/dde-session-shell/
%{_libdir}/libdde-network-core.so*
%{_datadir}/dsg/
%{_datadir}/dcc-network-plugin/
%{_datadir}/dock-network-plugin/
%{_datadir}/dss-network-plugin/
%{_datadir}/dde-network-core/translations/*.qm
/var/lib/polkit-1/localauthority/10-vendor.d/10-network-manager.pkla

%files devel
%{_includedir}/libddenetworkcore/
%{_libdir}/pkgconfig/*.pc

%changelog
* Mon Oct 09 2023 liweigang <liweiganga@uniontech.com> - 1.1.28.1-1
- update: update to version 1.1.28.1

* Mon Sep 18 2023 liuzhilin <liuzhilin@uniontech.com> - 1.1.18.4-1.01
- spec: add buildrequires gmock

* Wed Aug 16 2023 liuzhilin <liuzhilin@uniontech.com> - 1.1.18.4-1
- update: update to 1.1.18.4

* Fri Mar 31 2023 mahailiang <mahailiang@uniontech.com> - 1.0.74-5
- rebuild

* Fri Feb 03 2023 liweiganga <liweiganga@uniontech.com> - 1.0.74-4
- spec: del provided
- spec: fix plugins path

* Fri Feb 03 2023 liweiganga <liweiganga@uniontech.com> - 1.0.74-3
- spec: temporarily provided to support compilation

* Fri Feb 03 2023 liweiganga <liweiganga@uniontech.com> - 1.0.74-2
- spec: fix error Obsoletes version

* Thu Feb 02 2023 liweiganga <liweiganga@uniontech.com> - 1.0.74-1.01
- spec: fix plugins path

* Fri Jan 06 2023 liweiganga <liweiganga@uniontech.com> - 1.0.74-1
- init: init package
