Name: kchmviewer
Version: 6.0
Release: 2%{?dist}
Summary: CHM viewer
Group: Applications/Publishing
License: GPLv3+
URL: http://www.kchmviewer.net/
Source0: http://downloads.sourceforge.net/kchmviewer/kchmviewer-%{version}.tar.gz
BuildRequires: chmlib-devel
BuildRequires: desktop-file-utils
BuildRequires: gettext
BuildRequires: kdelibs4-devel
Requires: %{name}-common = %{version}-%{release}
%description
KchmViewer is a chm (MS HTML help file format) viewer.
This package contains the version for KDE4.
%package qt
Summary: Qt4-based CHM viewer
Requires: %{name}-common = %{version}-%{release}
%description qt
KchmViewer is a chm (MS HTML help file format) viewer.
This package contains the Qt-only version.
%package common
Summary: Common data files for KchmViewer.
BuildArch: noarch
Requires: hicolor-icon-theme
%description common
Common data files for KchmViewer.
%prep
%setup -q
%build
# make the Qt-only version
%_qt4_qmake
make
mv bin/%{name}{,-qt}
make clean
# make the KDE version
mkdir -p %{_target_platform}
pushd %{_target_platform}
%{cmake_kde4} ..
popd
make %{?_smp_mflags} -C %{_target_platform}
%install
rm -rf $RPM_BUILD_ROOT
# install the KDE version
make install/fast DESTDIR=$RPM_BUILD_ROOT -C %{_target_platform}
# install the Qt-only version
cp -p bin/%{name}-qt $RPM_BUILD_ROOT%{_bindir}
pushd $RPM_BUILD_ROOT%{_datadir}/applications/
cp -p kde4/%{name}.desktop %{name}-qt.desktop
sed -i -e 's/^\(Exec=kchmviewer\) \(.*\)$/\1-qt \2/' \
-e 's/^\(Name.*\)$/\1 \(Qt-only\)/' \
-e 's/KDE;//' %{name}-qt.desktop
popd
install -Dpm 644 packages/%{name}.png $RPM_BUILD_ROOT%{_kde4_iconsdir}/hicolor/128x128/apps/%{name}.png
%find_lang kchmviewer --with-kde
%check
desktop-file-validate $RPM_BUILD_ROOT%{_kde4_datadir}/applications/kde4/kchmviewer.desktop
desktop-file-validate $RPM_BUILD_ROOT%{_kde4_datadir}/applications/%{name}-qt.desktop
%clean
rm -rf $RPM_BUILD_ROOT
%post
update-desktop-database -q &> /dev/null ||:
%postun
update-desktop-database -q &> /dev/null ||:
%post qt
update-desktop-database -q &> /dev/null ||:
%postun qt
update-desktop-database -q &> /dev/null ||:
%post common
touch --no-create %{_kde4_iconsdir}/hicolor &> /dev/null || :
%posttrans common
gtk-update-icon-cache %{_kde4_iconsdir}/hicolor &> /dev/null || :
%postun common
if [ $1 -eq 0 ] ; then
touch --no-create %{_kde4_iconsdir}/hicolor &> /dev/null || :
gtk-update-icon-cache %{_kde4_iconsdir}/hicolor &> /dev/null || :
fi
%files -f kchmviewer.lang
%defattr(-,root,root,-)
%{_kde4_bindir}/kchmviewer
%{_kde4_datadir}/applications/kde4/*.desktop
%files qt
%defattr(-,root,root,-)
%{_bindir}/%{name}-qt
%{_datadir}/applications/%{name}-qt.desktop
%files common
%defattr(-,root,root,-)
%doc README COPYING ChangeLog FAQ
%{_kde4_iconsdir}/hicolor/*/apps/kchmviewer.*
%changelog
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Mon Dec 19 2011 Robin Lee <cheeselee@fedoraproject.org> - 6.0-1
- Update to 6.0
- Remove Requires kio_msits and kchmviewer-5.1-no_msits.patch
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Sat Jan 15 2011 Robin Lee <cheeselee@fedoraproject.org> - 5.3-1
- Update to 5.3
- Remove kchmviewer-5.2-missed-src.patch
* Tue Oct 12 2010 Robin Lee <cheeselee@fedoraproject.org> - 5.2-5
- _smp_mflags will break compilation of the Qt version, remove it
* Mon Oct 11 2010 Robin Lee <cheeselee@fedoraproject.org> - 5.2-4
- Make a subpackage for the Qt-only version
- Make a subpackage owning the common data files
* Fri Jun 4 2010 Robin Lee <robinlee.sysu@gmail.com> - 5.2-3
- fix tag
* Fri Jun 4 2010 Robin Lee <robinlee.sysu@gmail.com> - 5.2-2
- Tar ball updated
* Wed Apr 28 2010 Robin Lee <robinlee.sysu@gmail.com> - 5.2-1
- update to 5.2
* Sat Apr 17 2010 LI Rui Bin <cheeseli@hotmail.com> - 5.1-1
- correct License tag
- remove BuildRoot tag
* Fri Mar 19 2010 Emilio Scalise <emisca@rocketmail.com> - 5.1-0
- update to 5.1
- provides new translations
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Mon Apr 27 2009 Rex Dieter <rdieter@fedoraproject.org> - 4.0-4
- fix conflicts with kdegraphics (#484861)
- optimize scriptlets
- ship only hicolor icons
- cleanup, use kde4-macros
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Mon Dec 8 2008 Patrice Dumas <pertusus@free.fr> 4.0-2
- reenable kde support
* Thu Dec 4 2008 Patrice Dumas <pertusus@free.fr> 4.0-1
- update to 4.0
* Wed Aug 13 2008 Patrice Dumas <pertusus@free.fr> 4.0-0.4.beta3
- update to 4.0beta3
* Thu Feb 14 2008 Patrice Dumas <pertusus@free.fr> 4.0-0.2.beta2
- update to 4.0beta2
* Thu Aug 2 2007 Patrice Dumas <pertusus@free.fr> 3.1-1.5
- update to 3.1
* Sun Apr 1 2007 Patrice Dumas <pertusus@free.fr> 3.0-2
- update to 3.0
* Fri Feb 16 2007 Patrice Dumas <pertusus@free.fr> 2.7-2
- fixes in desktop file. Fix #229070
* Mon Jan 29 2007 Patrice Dumas <pertusus@free.fr> 2.7-1
- update to 2.7
* Tue Sep 12 2006 Patrice Dumas <pertusus@free.fr> 2.6-2
- rebuild for FC6
* Sat Jul 22 2006 Patrice Dumas <pertusus@free.fr> 2.6-1
- update to 2.6
- remove upstreamed patch kchmviewer-2.5-iconstorage.h.patch
* Thu May 18 2006 Patrice Dumas <pertusus@free.fr> 2.5-1
- update to 2.5
- patch from Jose Pedro Oliveira (jpo)
* Tue May 16 2006 Patrice Dumas <pertusus@free.fr> 2.0-4
- remove the old menu entry file from /usr/share/applnk/
* Mon Mar 13 2006 Patrice Dumas <pertusus@free.fr> 2.0-3
- use update-desktop-database
* Mon Mar 13 2006 Patrice Dumas <pertusus@free.fr> 2.0-2
- enable kde support
* Sun Mar 12 2006 Patrice Dumas <pertusus@free.fr> 2.0-1
- Fedora Extras submission