1
0
Эх сурвалжийг харах

Fix CMake file for build RPM

Kandrashin Denis 13 жил өмнө
parent
commit
2ba8d4d3d2

+ 5 - 1
CMakeLists.txt

@@ -78,8 +78,12 @@ endif (LIBXML2_FOUND)
 if( UNIX AND NOT APPLE )
     install( TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
     install( FILES desktop/fb2edit.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications )
-    install( FILES desktop/fb2edit048.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps RENAME fb2edit.png )
+    install( FILES desktop/fb2edit048.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps RENAME fb2edit.png )
     install( FILES desktop/fb2edit128.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/128x128/apps RENAME fb2edit.png )
     install( FILES desktop/fb2edit256.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/256x256/apps RENAME fb2edit.png )
     install( FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/fb2edit/translations )
+    install( CODE "FILE(MAKE_DIRECTORY WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/share/pixmaps/)" )
+    install( CODE "EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E create_symlink ../icons/hicolor/48x48/apps/fb2edit.png fb2edit.png WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/share/pixmaps)" )
 endif()
+
+

+ 1 - 1
desktop/fb2edit.desktop

@@ -5,4 +5,4 @@ Icon=fb2edit
 Type=Application
 Comment=FB2 file editor
 Categories=Office;FileTools;Qt;Viewer;TextTools;TextEditor;Utility;
-MimeType=application/x-fb2;
+MimeType=application/x-fictionbook+xml;

+ 21 - 12
rpmbuild/fb2edit.spec

@@ -7,30 +7,26 @@
 #
 
 Name:           fb2edit
-Version:        0.0.1
+Version:        0.0.3
 Release:        0
 License:        GPL-3.0
 Summary:        FB2 Files Editor
-Url:            http://fb2edit.lintest.ru
+URL:            http://fb2edit.lintest.ru
 Group:          Productivity/Text/Editors
-Source0:        fb2edit-0.0.1.tar.bz2
+Source0:        http://www.lintest.ru/pub/%{name}-%{version}.tar.bz2
 BuildRequires:  cmake
 BuildRequires:  desktop-file-utils
 BuildRequires:  gcc-c++
+BuildRequires:  hicolor-icon-theme
+BuildRequires:  pkgconfig(QtCore) >= 4.7.0
+BuildRequires:  pkgconfig(QtGui) >= 4.7.0
+BuildRequires:  pkgconfig(QtNetwork) >= 4.7.0
 BuildRequires:  pkgconfig(QtWebKit) >= 4.7.0
+BuildRequires:  pkgconfig(QtXml) >= 4.7.0
 BuildRequires:  pkgconfig(libxml-2.0)
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
-%if 0%{?fedora_version}
-BuildRequires:  qscintilla-devel
-%endif
-
-%if 0%{?mandriva_version}
-BuildRequires:  qscintilla-qt4-devel
-%endif
-
 %if 0%{?suse_version}
-BuildRequires:  libqscintilla-devel
 BuildRequires:  update-desktop-files
 %endif
 
@@ -68,33 +64,46 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
 %if 0%{?fedora_version}
 %post
 /usr/bin/update-desktop-database &> /dev/null || :
+/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
 
 %postun
 /usr/bin/update-desktop-database &> /dev/null || :
+if [ $1 -eq 0 ] ; then
+    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
+    /usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || :
+fi
+
+%posttrans
+/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || :
 %endif
 
 %if 0%{?mandriva_version}
 %post
 %update_desktop_database
+%update_icon_cache hicolor
 %update_menus
 
 %postun
 %clean_desktop_database
+%update_icon_cache hicolor
 %clean_menus
 %endif
 
 %if 0%{?suse_version}
 %post
 %desktop_database_post
+%icon_theme_cache_post
 
 %postun
 %desktop_database_postun
+%icon_theme_cache_postun
 %endif
 
 %files
 %defattr(-,root,root,-)
 %{_bindir}/%{name}
 %{_datadir}/applications/%{name}.desktop
+%{_datadir}/icons/hicolor/*/*/%{name}.png
 %{_datadir}/pixmaps/%{name}.png
 
 %changelog