Name: 		kiran-cc-daemon
Version:	2.3.1
Release:	1
Summary:	DBus daemon for Kiran Desktop

License:	Mulan PSL v2
Source0:	%{name}-%{version}.tar.gz


BuildRequires:	cmake >= 3.2
BuildRequires:	pkgconfig(glibmm-2.4)
BuildRequires:	pkgconfig(giomm-2.4)
BuildRequires:	pkgconfig(gmodule-2.0)
BuildRequires:	pkgconfig(gio-unix-2.0)
BuildRequires:	pkgconfig(gtkmm-3.0)
BuildRequires:	pkgconfig(libxml++-2.6)
BuildRequires:	systemd-devel
BuildRequires:  libselinux-devel
BuildRequires:  gettext
BuildRequires:	gcc-c++
BuildRequires:	intltool
BuildRequires:	libX11-devel
BuildRequires:	xerces-c-devel
BuildRequires:	xsd
BuildRequires:	fontconfig-devel
BuildRequires:	jsoncpp-devel
BuildRequires:	cairomm-devel
BuildRequires:  kiran-log-gtk3-devel
BuildRequires:	fmt-devel >= 6.2.1
BuildRequires:  python%{python3_pkgversion}-jinja2
BuildRequires:	gdbus-codegen-glibmm
BuildRequires:  gtest-devel
BuildRequires:  libnotify-devel
BuildRequires:  pulseaudio-libs-devel


%description
DBus daemon for Kiran Desktop


%package -n kiran-system-daemon
Summary:    System DBus daemon for Kiran Desktop
Requires:   systemd
Requires:   dbus-daemon
Requires:   polkit
Requires:   kiran-cc-daemon-common
Requires:   util-linux
Requires:   pciutils

%if 0%{?openEuler}
Requires:   openeuler-lsb
%else
Requires:   kylin-lsb
%endif

%description -n kiran-system-daemon
System DBus daemon for Kiran Desktop

%package -n kiran-session-daemon
Summary:    Session DBus daemon for Kiran Desktop
Requires:   dbus-daemon
Requires:   kiran-session-manager
Requires:   xorg-x11-server-utils
Requires:   kiran-cc-daemon-common
Requires:   upower
Requires:   pulseaudio

%description -n kiran-session-daemon
Session DBus daemon for Kiran Desktop

%package common
Summary:    Common files for kiran-session-daemon and kiran-system-daemon

%description common
Common files for kiran-session-daemon and kiran-system-daemon

%package devel
Summary:    Development files for communicating with control center daemon

%description devel
Development files for communicating with control center daemon

%prep
%autosetup -p1

%build
%cmake
make %{?_smp_mflags}

%install
%make_install

%post -n kiran-system-daemon
%systemd_post kiran-system-daemon.service
systemctl enable kiran-system-daemon.service

%preun -n kiran-system-daemon
%systemd_preun kiran-system-daemon.service

%post -n kiran-session-daemon
glib-compile-schemas /usr/share/glib-2.0/schemas &> /dev/nulls || :

%files -n kiran-system-daemon
%{_sysconfdir}/dbus-1/system.d/*.conf
%{_sysconfdir}/lightdm/kiran-greeter.conf
%config(noreplace) %{_sysconfdir}/kiran-cc-daemon/system/timedate/timedate.conf
%{_bindir}/kiran-system-daemon
%{_usr}/lib/systemd/system/*.service
%{_libdir}/kiran-cc-daemon/system/*.so
%{_libdir}/kiran-cc-daemon/system/plugin_options
%{_datadir}/dbus-1/system-services/*.service
%{_datadir}/locale/zh_CN/LC_MESSAGES/kiran-cc-daemon-timezones.mo
%{_datadir}/polkit-1/actions/com.kylinsec.Kiran.SystemDaemon*.policy
%{_datadir}/lightdm/lightdm.conf.d/99-kiran-greeter-login.conf

%files -n kiran-session-daemon
%{_sysconfdir}/xdg/autostart/kiran-session-daemon.desktop
%{_sysconfdir}/xdg/autostart/kiran-power-status-icon.desktop
%{_bindir}/kiran-session-daemon
%{_bindir}/kiran-power-backlight-helper
%{_bindir}/kiran-power-status-icon
%{_libdir}/kiran-cc-daemon/session/*.so
%{_libdir}/kiran-cc-daemon/session/plugin_options
%{_datadir}/glib-2.0/schemas/*.xml
%{_datadir}/dbus-1/services/*.service
%{_datadir}/icons/hicolor/scalable/apps/*.svg
%{_datadir}/locale/zh_CN/LC_MESSAGES/kiran-power-status-icon.mo
%{_datadir}/polkit-1/actions/com.kylinsec.Kiran.SessionDaemon*.policy
%dir %{_datadir}/kiran-cc-daemon/keybindings
%{_datadir}/kiran-cc-daemon/keybindings/*.xml

%files common
%{_includedir}/kiran-cc-daemon/error-i.h
%{_datadir}/locale/zh_CN/LC_MESSAGES/kiran-cc-daemon.mo

%files devel
%dir %{_includedir}/kiran-cc-daemon
%dir %{_includedir}/kiran-cc-daemon/kiran-system-daemon
%dir %{_includedir}/kiran-cc-daemon/kiran-session-daemon
%{_includedir}/kiran-cc-daemon/kiran-system-daemon/*_i.h
%{_includedir}/kiran-cc-daemon/kiran-system-daemon/*-i.h
%{_includedir}/kiran-cc-daemon/kiran-session-daemon/*_i.h
%{_includedir}/kiran-cc-daemon/kiran-session-daemon/*-i.h
%{_libdir}/pkgconfig/kiran-cc-daemon.pc

%changelog
* Thu Jul 28 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.1-1
- KYOS-B: Fix the problem that system version shows empty content in comunity version. (#I5H4D6)
- KYOS-B: Fix the problem that system and sound classes in keybindings aren't shown.(#I5I6OU)
 
* Tue Jul 12 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.0-2
- KYOS-B: Try reconnection if failed to connect pulseaudio service firstly.
- KYOS-F: Fix the coredump as failed to connect pulaseaudio service.

* Fri Jul 08 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.0-1
- KYOS-F: Enable network and audio plugins defaultly.

* Wed Mar 02 2022 longcheng <longcheng@kylinos.com.cn> - 2.2.4-3
- KYOS-F: Do not output the alarm information to the screen

* Thu Feb 24 2022 chendingjian <chendingjian@kylinos.com.cn> - 2.2.4-2
- rebuild for KY3.4-MATE-modules-dev

* Tue Feb 22 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.4-1.kb2
- KYOS-F: Fix the com.kylinsec.Kiran.SessionDaemon.Power.policy file generation error caused by the logic error of CMakeLists.

* Sat Feb 19 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.4-1.kb1
- KYOS-F: Fix compile error on KLOG_PROFILE.

* Fri Feb 18 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.3-2.kb6
- KYOS-B: Fix the function invalid problem when set the action of power button pressed.(#50020)
- KYOS-B: Show remaining electrictiy in power tray icon.(#48516)

* Thu Feb 17 2022 longcheng <longcheng@kylinsec.com.cn> - 2.2.3-2.kb5
- KYOS-B: Change the Requires mate-session-manager to kiran-session-manager for kiran-session-daemon (#49934)

* Wed Feb 16 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.3-2.kb4
- KYOS-F: Register client to session manager after the plugins is inited.
- KYOS-F: Modify the default gtk theme to kiran-dark.

* Wed Jan 19 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.3-2.kb3
- KYOS-B: Fix the disappear problem for power tray icon on laptop.(#48516)

* Tue Jan 18 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.3-2.kb2
- KYOS-F: Add audio-i.h header file to install directory.
- KYOS-B: Add reset dbus api for keybinding.(#48466)
- KYOS-B: Set cursor theme name to org.mate.peripherals-mouse.cursor-them for making marco to update cursor them.(#48458)
- KYOS-F: Append the configure_file command to generate com.kylinsec.Kiran.SessionDaemon.Power.policy file.
- KYOS-B: Forbit deleting logined user.(#49244)
- KYOS-F:  Modify the log output level in DeleteUser when exception is throwed.

* Wed Dec 29 2021 kpkg <kpkg@kylinos.com.cn> - 2.2.3-2.kb1
- rebuild for KY3.4-MATE-modules-dev

* Wed Dec 29 2021 caoyuanji<caoyuanji@kylinos.com.cn> - 2.2.3-2
- Upgrade version number for easy upgrade

* Mon Dec 20 2021 caoyuanji <caoyuanji@kylinos.com.cn> - 2.2.3-1.kb1
- rebuild for KY3.4-4-KiranUI-2.2

* Wed Dec 15 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.3-1.ky3
- KYOS-F: Add more additional error information for accounts plugins
- KYOS-F: Doesn't reboot caja, kiran-panel and marco when the window scale is inited firstly.

* Tue Dec 07 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.2-1.ky3
- KYOS-F: Modify the default switch value of plugins.
- KYOS-B: Ignore the 'disabled' keycomb when look shotcut by keycomb.
- KYOS-B: The color of power status icon is changed with gtk theme.

* Mon Nov 22 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.1-4.ky3
- KYOS-B: Delete translation file in kiran-session-daemon.

* Mon Nov 22 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.1-3.ky3
- KYOS-B: Only allow to load kiran-session-daemon in KIRAN desktop environment.
- KYOS-B: Fix coredump when the program is exited.

* Wed Nov 17 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.1-2.ky3
- KYOS-B: Modify libinputdevices-common to static library.

* Mon Nov 15 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.1-1.ky3
- KYOS-B: Stop the conflicted plugins of mate-settings-daemon with kiran-session-daemon when the kiran-session-daemon is started and start the conflicted plugins when the kiran-session-daemon is stopped.

* Fri Nov 05 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.0-1.ky3
- KYOS-B: Enable Display, Keybinding, keyboard, mouse, power, touchpad, xsettigns plugins.

* Fri Sep 10 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.1.0-3.ky3
- KYOS-B: Fix the compile error in KY3.3-9.

* Thu Sep 09 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.1.0-2.ky3
- KYOS-F: Rebuild for 2.1.0-1

* Wed Sep 08 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.1.0-1.ky3
- KYOS-B: Accounts plugin doesn't create cached file default when a user is added. (#43305)
- KYOS-F: Modify the display.xml saved directory.
- KYOS-F: Modify the default value for gtk-font-name in gsettings.
- KYOS-F: Change license to MulanPSL2.

* Mon Aug 09 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.7-1.ky3
- KYOS-F: Add account password expiration policy.
- KYOS-F: Delete upower library dependency.

* Thu Jun 24 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.6-3.ky3
- KYOS-B: Add -f option in userdel command to fix the problem that user cannot be deleted when the user login and then logout.

* Wed Jun 16 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.6-2.ky3
- KYOS-F: Add translation for dbus authoriation failed.

* Wed Jun 09 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.6-1.ky3
- KYOS-F: Add cmake variables for enable/disable plugins.

* Fri Jun 04 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.5-1.ky3
- KYOS-B: Fix the name error in greeter service file.

* Thu May 27 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.4-1.ky3
- KYOS-B: Fix the compile error in KY3.3-6.
- KYOS-F: Rename these header files which suffix is _i.h to xxx-i.h

* Thu May 13 2021 tangjei02 <tangjie02@kylinos.com.cn> 2.0.3-1.ky3 
- KYOS-F: The first parameter of function SetAutologinUser is changed to user name instead of user uid.
- KYOS-F: Rename dbus, file, class and variable and provide kiran-greeter.conf.
- KYOS-F: Cache user infomation for root.

* Wed Apr 14 2021 yangxiaoqing <yangxiaoqing@kylinos.com.cn> 2.0.2+alpha2-2.ky3.kb1
- KYOS-C: Set plugin of greeter-settings available. 
- KYOS-B: Fix the segment error of GreeterSettingsManager::get_background_file().

* Thu Apr 01 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.2+alpha2-2.ky3
- Delete third party and replace by pkg_search_module.

* Sat Mar 27 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.2+alpha2-1.ky3
- KYOS-B: Fix the display errors of disks and eths in ft machine.

* Thu Mar 25 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.2+alpha1-2.ky3.kb3
- KYOS-B: Fix the display error of the hardware info in sw machine.

* Tue Mar 23 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.2+alpha1-2.ky3.kb2
- KYOS-B: Fix the problem that disk info cannot be displayed in KY3.3-9.

* Mon Mar 22 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.2+alpha1-2.ky3.kb1
- KYOS-F: The hostname set by SetHostName function is restored when system reboot.

* Fri Mar 19 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.2+alpha1-2.ky3
- KYOS-B: Fix the UnicodeEncodeError when generate source files by gdbus-codegen-glibmm. 

* Thu Mar 18 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.2+alpha1-1.ky3
- KYOS-B: Fix the compile error in KY3.3-9.
- KYOS-F: Add authentication manager for fingerprint and face datas.

* Wed Mar 17 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha6-1.ky3.kb2
- KYOS-F: Disable greeter and display plugins.

* Mon Mar 15 2021 yangxiaoqing <yangxiaoqing@kylinos.com.cn> 2.0.1+alpha6-1.ky3.kb1
- KYOS-C: Remove unused dependent library.
- KYOS-P: Modify the file name of dbus xml.

* Thu Mar 04 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha6-1.ky3
- KYOS-F: Add systeminfo and greeter-settings plugins.
- KYOS-F: Add timedate display format settings.

* Mon Feb 01 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha5-2.ky3
- KYOS-F: Replace the logs output function with zlog.
- KYOS-F: Enable account and display setting plugins.

* Mon Dec 07 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha5-1.ky3.kb1
- KYOS-B: Disable account setting plugin.

* Mon Nov 30 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha5-1.ky3
- KYOS-B: Add kiran-session-daemon which contain display setting plugin.

* Tue Nov 17 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha4-3.ky3
- KYOS-B: Fix the return value error when create user failed.
- KYOS-F: Remove -f option when delete user.
- KYOS-B: Modify /usr/bin/usermod to /usr/sbin/usermod

* Tue Nov 03 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha4-2.ky3
- KYOS-F: Update icon path when icon path is not found.
- KYOS-F: Don't need to verify to change self account password.
- KYOS-F: Separate header file to development package.
- KYOS-F: Add translation for dbus return value.
- KYOS-F: Modify unikylin to kylinsec.

* Mon Oct 12 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha4-1.ky3
- KYOS-F: Support to set user uid when create user.

* Tue Sep 29 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alhpa3-3.ky3
- KYOS-F: Move to tag KY3.4-MATE-modules-dev.

* Tue Sep 29 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alhpa3-2.ky3
- KYOS-B: Fix the compile error that cannot find macro ADJ_SETOFFSET in KY3.3-9
- KYOS-F: Add files monitor for /etc/adjtime, /etc/localtime and ntp service path

* Sun Sep 27 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alhpa3-1.ky3.kb2
- KYOS-F: Apply the Patch1001 file.

* Sun Sep 27 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alhpa3-1.ky3.kb1
- KYOS-B: Fix the installing path error.

* Tue Sep 22 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha3-1.ky3
- KYOS-B: Fix plugins loading error due to KCC_PLUGIN_DIR variable no found.

* Fri Sep 18 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.0.1~alpha2-1.ky3
- New upstream source 2.0.1~alpha2

* Thu Sep 17 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.0.1~alpha1-3.ky3
- KYOS-F: Fix build error for lack of dependencies

* Thu Sep 17 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.0.1~alpha1-2.ky3
- KYOS-F: Enable system daemon in post section
- KYOS-F: Stop system daemon service before uninstall

* Thu Sep 17 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.0.1~alpha1-1.ky3
- New upstream source

