%define debug_package %{nil}
Name:          kylin-user-guide
Version:       1.0.4
Release:       2
Summary:       A component of the ukui desktop environment that provides convenient text
License:       CC-BY-SA-4.0 and GPL-3.0-or-later
URL:           http://www.ukui.org
Source0:       %{name}-%{version}.tar.gz
Patch01:       0001-modify-compile-error-of-None.patch

BuildRequires: cmake
BuildRequires: qt5-qtbase-devel
BuildRequires: gsettings-qt-devel
BuildRequires: qt5-qtx11extras-devel
BuildRequires: kf5-kwindowsystem-devel
BuildRequires: qt5-qttools-devel
BuildRequires: qt5-qtwebkit-devel
BuildRequires: pkgconf
BuildRequires: libX11-devel
BuildRequires: ukui-interface


Requires:      js-jquery 
Requires:      nodejs-requirejs
Requires:      js-marked
Requires:      kylin-user-guide-common


%description
A component of the ukui desktop environment that provides convenient text recording and flexible interface display

%package common
summary: common picture file


%description common 
this packages contains the picture of application


%prep
%setup -q
%patch01 -p1

%build
mkdir build && cd build
cmake ..
make

%install
rm -rf $RPM_BUILD_ROOT
cd %{_builddir}/%{name}-%{version}/build

make install DESTDIR=%{buildroot} 
mkdir -p %{buildroot}/usr/share/kylin-user-guide/web
cp -r %{_builddir}/%{name}-%{version}/src/web/* %{buildroot}/usr/share/kylin-user-guide/web

mkdir -p %{buildroot}/etc/xdg/autostart/
cp -r %{_builddir}/%{name}-%{version}/src/data/kylin-user-guide-daemon.desktop %{buildroot}/etc/xdg/autostart/

mkdir -p %{buildroot}/usr/share/applications
cp -r %{_builddir}/%{name}-%{version}/src/data/kylin-user-guide.desktop %{buildroot}/usr/share/applications

mkdir -p %{buildroot}/usr/share/kylin-user-guide/data
cp -r %{_builddir}/%{name}-%{version}/data/  %{buildroot}/usr/share/kylin-user-guide/
%clean
rm -rf $RPM_BUILD_ROOT

%files
%{_bindir}/kylin-user-guide
%{_bindir}/user-guide-daemon
%{_datadir}/icons/hicolor/22x22/apps/kylin-user-guide.png
%{_datadir}/icons/hicolor/32x32/apps/kylin-user-guide.png
%{_datadir}/icons/hicolor/56x56/apps/kylin-user-guide.png
%{_datadir}/kylin-user-guide/web/*
%{_datadir}/applications/kylin-user-guide.desktop
%{_sysconfdir}/xdg/autostart/kylin-user-guide-daemon.desktop

%files common
%{_datadir}/kylin-user-guide/translations/*.qm
%{_datadir}/kylin-user-guide/data/*

%changelog
* Wed Jun 8 2022 peijiankang <peijiankang@kylinos.cn> - 1.0.4-2
- add js-marked requires

* Wed Jun 1 2022 peijiankang <peijiankang@kylinos.cn> - 1.0.4-1
- update version to 1.0.4

* Wed May 18 2022 tanyulong<tanyulong@kylinos.cn> - 1.0.0-3
- Improve the project according to the requirements of compliance improvement

* Tue Mar 29 2022 tanyulong <tanyulong@kylinos.cn> - 1.0.0-2
- remove %if macros

* Tue Mar 15 2022 tanyulong <tanyulong@kylinos.cn> - 1.0.0-1
- init for openEuler

