diff --git a/Makefile.am b/Makefile.am index 64bfeb5f..88d74838 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,6 +6,7 @@ EXTRA_DIST = AUTHORS COPYING ChangeLog INFO INSTALL NEWS README THANKS compile.s documentation.html \ dos/readme.txt \ linux/testdisk.spec.in \ + linux/qphotorec.desktop \ src/icon_ph.rc src/icon_qph.rc src/icon_tst.rc \ src/photorec_64x64.png \ src/gnome/README \ @@ -26,9 +27,16 @@ AUTOMAKE_OPTIONS = gnits install-data-hook: $(mkinstalldirs) $(DESTDIR)$(docdir) $(INSTALL_DATA) $(top_srcdir)/AUTHORS $(top_srcdir)/ChangeLog $(top_srcdir)/NEWS $(top_srcdir)/README $(top_srcdir)/THANKS $(top_srcdir)/documentation.html $(DESTDIR)$(docdir) +if USEQT + $(mkinstalldirs) $(DESTDIR)$(datadir)/applications + $(INSTALL_DATA) $(top_srcdir)/linux/qphotorec.desktop $(DESTDIR)$(datadir)/applications +endif uninstall-hook: rm -rf $(DESTDIR)$(docdir) +if USEQT + rm -f $(DESTDIR)$(datadir)/applications/qphotorec.desktop +endif static: rm -f src/testdisk src/testdisk.exe src/photorec src/photorec.exe src/fidentify src/fidentify.exe src/qphotorec src/qphotorec.exe diff --git a/icons/48x48/apps/qphotorec.png b/icons/48x48/apps/qphotorec.png new file mode 100644 index 00000000..7ccce3b4 Binary files /dev/null and b/icons/48x48/apps/qphotorec.png differ diff --git a/icons/Makefile.am b/icons/Makefile.am index c260fa07..f6cfdd65 100644 --- a/icons/Makefile.am +++ b/icons/Makefile.am @@ -1 +1,23 @@ EXTRA_DIST = photorec.ico testdisk.ico + +iconsdir = $(datadir)/icons/hicolor + +nobase_dist_icons_DATA = 48x48/apps/qphotorec.png \ + scalable/apps/qphotorec.svg + +gtk_update_icon_cache = gtk-update-icon-cache -f -t $(iconsdir) +if USEQT + UPDATE_ICON_CACHE=update-icon-cache +endif + +install-data-hook: $(UPDATE_ICON_CACHE) +uninstall-hook: $(UPDATE_ICON_CACHE) + +update-icon-cache: + @-if test -z "$(DESTDIR)"; then \ + echo "Updating GTK icon cache."; \ + $(gtk_update_icon_cache) || : ; \ + else \ + echo "*** Icon cache not updated. After (un)install, run this:"; \ + echo "*** $(gtk_update_icon_cache)"; \ + fi diff --git a/icons/scalable/apps/qphotorec.svg b/icons/scalable/apps/qphotorec.svg new file mode 100644 index 00000000..f76140d9 --- /dev/null +++ b/icons/scalable/apps/qphotorec.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/linux/qphotorec.desktop b/linux/qphotorec.desktop new file mode 100644 index 00000000..003a33f9 --- /dev/null +++ b/linux/qphotorec.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Version=1.0 +Name=QPhotoRec +GenericName=Data Recovery Utility +Icon=qphotorec +TryExec=/usr/bin/qphotorec +Exec=/usr/bin/qphotorec %F +Terminal=false +Categories=System;Filesystem;Qt; diff --git a/linux/testdisk.spec.in b/linux/testdisk.spec.in index 09672a7c..b200b3a6 100644 --- a/linux/testdisk.spec.in +++ b/linux/testdisk.spec.in @@ -21,14 +21,12 @@ BuildRequires: libewf-devel BuildRequires: libjpeg-devel BuildRequires: libuuid-devel BuildRequires: ncurses-devel >= 5.2 -%ifnarch ppc ppc64 -#BuildRequires: ntfsprogs-devel BuildRequires: ntfs-3g-devel -%endif -BuildRequires: openssl-devel BuildRequires: zlib-devel +BuildRequires: qt-devel +BuildRequires: desktop-file-utils BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Obsoletes: testdisk-doc +Obsoletes: testdisk-doc < 6.12 %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} %description @@ -86,17 +84,38 @@ make DESTDIR="$RPM_BUILD_ROOT" install %clean rm -rf $RPM_BUILD_ROOT +%check +desktop-file-validate %{buildroot}/%{_datadir}/applications/qphotorec.desktop + +%post +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : + +%postun +if [ $1 -eq 0 ] ; then + /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null + /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : +fi + +%posttrans +/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : + %files %defattr(644,root,root,755) %doc AUTHORS COPYING ChangeLog NEWS README THANKS %{_mandir}/man8/fidentify.8* %{_mandir}/man8/photorec.8* +%{_mandir}/man8/qphotorec.8* %{_mandir}/man8/testdisk.8* %{_mandir}/zh_CN/man8/fidentify.8* %{_mandir}/zh_CN/man8/photorec.8* +%{_mandir}/zh_CN/man8/qphotorec.8* %{_mandir}/zh_CN/man8/testdisk.8* +%{_datadir}/applications/qphotorec.desktop +%{_datadir}/icons/hicolor/48x48/apps/qphotorec.png +%{_datadir}/icons/hicolor/scalable/apps/qphotorec.svg %attr(755,root,root) %{_bindir}/fidentify %attr(755,root,root) %{_bindir}/photorec +%attr(755,root,root) %{_bindir}/qphotorec %attr(755,root,root) %{_bindir}/testdisk %changelog