Name:          kylin-user-guide
Version:       1.0.5
Release:       2
Summary:       Smanual for UKUI desktop environment
License:       CC-BY-SA-4.0 and GPL-3.0-or-later
URL:           http://www.ukui.org
Source0:       %{name}-%{version}.tar.gz
Source1:       atril.tar.gz
Patch02:       0002-Fix-kylin-user-guide-version-is-empty.patch  
Patch03:       0003-Fix-no-response-of-interface.patch

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


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


%description
Kylin User Guide is a simple and lightweight guide written by Qt5/js/md,
It has the characteristics of easy maintenance and simple interface.
.
A simple and lightweight guide written by Qt5/js/md.

%package common
summary: Smanual for UKUI desktop environment (common files)


%description common 
A simple and lightweight guide written by Qt5/js/md (common files).


%prep
%autosetup -n %{name}-%{version} -p1
%setup -T -D -q -b 1

%build
mkdir build && cd build
%cmake ..
%{make_build}

%install
rm -rf $RPM_BUILD_ROOT
cd 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
* Fri Mar 03 2023 peijiankang <peijiankang@kylinos.cn> - 1.0.5-2
- add the user guide of atril

* Thu Mar 02 2023 peijiankang <peijiankang@kylinos.cn> - 1.0.5-1
- update version to 1.0.5

* Tue Feb 07 2023 peijiankang <peijiankang@kylinos.cn> - 1.0.4-7
- add build debuginfo and debugsource

* Wed Sep 21 2022 lvfei <lvfei@kylinos.cn> - 1.0.4-6
- add patch:0001-kylin-user-guide-add-bo-desktop-translate.patch
- kylin user guide add desktop zangwen support

* Fri Sep 9 2022 lvfei <lvfei@kylinos.cn> - 1.0.4-5
- add patch:0001-kylin-user-guide-add-bo-translate.patch
- kylin user guide add zangwen support

* Thu Jun 9 2022 peijiankang <peijiankang@kylinos.cn> - 1.0.4-4
- Fix no response of interface

* Thu Jun 9 2022 peijiankang <peijiankang@kylinos.cn> - 1.0.4-3
- Fix kylin-user-guide version is empty

* 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

