sigil-vl.spec 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. %define pkgname Sigil
  2. %define _qt4_qmake %{_libdir}/qt4/bin/qmake
  3. Name: sigil
  4. Version: 0.3.4
  5. Release: 2%{?_dist_release}
  6. Summary: A WYSIWYG ebook editor
  7. Summary(ja): WYSIWYG 電子書籍エディタ
  8. License: GPLv3
  9. Group: Applications/Publishing
  10. Url: http://sigil.googlecode.com/
  11. Source0: http://sigil.googlecode.com/files/%{pkgname}-%{version}-Code.zip
  12. ## Vine
  13. Source10: sigil.desktop
  14. Patch0: sigil-0.2.2-fix-format-string.patch
  15. # from Anssi: this makes it use system libs instead of bundled ones. Except for
  16. # libtidy which has some local hacks not present in system-provided libtidy.
  17. Patch1: sigil-0.3.4-use-system-libs-vine.patch
  18. Patch2: sigil-0.3.4-add-msse2-only-on-x86-archs.patch
  19. BuildRequires: desktop-file-utils
  20. BuildRequires: unzip
  21. BuildRequires: zlib-devel
  22. BuildRequires: bzip2-devel
  23. BuildRequires: cmake >= 2.6.0
  24. BuildRequires: qt4-devel >= 4.7.0
  25. BuildRequires: libboost-devel
  26. BuildRequires: libboost-thread
  27. BuildRequires: libboost-date-time
  28. BuildRequires: libboost-filesystem
  29. BuildRequires: libboost-regex
  30. #BuildRequires: xerces-c-devel
  31. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  32. Distribution: Vine
  33. Vendor: Project Vine
  34. Packager: munepi
  35. %description
  36. Sigil is a free, open source WYSIWYG ebook editor.
  37. It is designed to edit books in ePub format.
  38. %description -l ja
  39. Sigil はオープンソース WYSIWYG 電子書籍エディタです。
  40. ePub 形式の電子書籍を編集するように設計されています。
  41. %prep
  42. %setup -q -n %{pkgname}-%{version}-Code
  43. %patch0 -p0 -b .format-string
  44. %patch1 -p1 -b .system-libs
  45. %patch2 -p1 -b .x86-archs-only
  46. #%__rm -fr src/BoostParts
  47. # fix end of line encoding for the docs:
  48. %__sed -i 's/\r//' ChangeLog.txt README.txt COPYING.txt
  49. %build
  50. unset QTDIR || : ; . /etc/profile.d/qt4.sh
  51. ## from sigil-0.3.4-1mdv2011.0
  52. # there are only internal helper libs, and they need to be static as build
  53. # fails otherwise (they contain undefined symbols), and making them shared
  54. # libs wouldn't make sense anyway (they are not shared by anything else)
  55. # - Anssi 06/2010
  56. %__cmake -G "Unix Makefiles" \
  57. -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_STATIC_LIBS:BOOL=ON \
  58. -DCMAKE_BUILD_TYPE=Release \
  59. -DCMAKE_INSTALL_PREFIX=%{_prefix} \
  60. -DLIB_INSTALL_DIR:PATH=%{_libdir} \
  61. -DQT_QMAKE_EXECUTABLE=%_qt4_qmake \
  62. ;
  63. %__make %{?_smp_mflags}
  64. %install
  65. %__rm -rf %{buildroot}
  66. %__make install DESTDIR=%{buildroot}
  67. # remove unused files
  68. %__rm %{buildroot}%{_datadir}/pixmaps/sigil.png || exit 1
  69. %__rm %{buildroot}%{_datadir}/applications/sigil.desktop || exit 1
  70. # install icons for the .desktop file
  71. for i in 16 32 48 128 256 512; do
  72. [ -f src/Sigil/Resource_Files/icon/app_icon_${i}.png ] || exit 1
  73. %__install -m644 -D src/Sigil/Resource_Files/icon/app_icon_${i}.png \
  74. %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/sigil.png || exit 1
  75. done
  76. # create a .desktop file:
  77. %__mkdir_p %{buildroot}%{_datadir}/applications
  78. desktop-file-install --vendor="vine" \
  79. --dir=%{buildroot}%{_datadir}/applications \
  80. %{SOURCE10}
  81. %clean
  82. %__rm -rf %buildroot
  83. %post
  84. touch --no-create %{_datadir}/icons/hicolor
  85. if [ -x %{_bindir}/gtk-update-icon-cache ]; then
  86. %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
  87. fi
  88. update-desktop-database &> /dev/null || :
  89. %postun
  90. touch --no-create %{_datadir}/icons/hicolor
  91. if [ -x %{_bindir}/gtk-update-icon-cache ]; then
  92. %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
  93. fi
  94. update-desktop-database &> /dev/null || :
  95. %files
  96. %defattr(-,root,root)
  97. %doc ChangeLog.txt README.txt COPYING.txt INSTALL.txt
  98. %{_bindir}/%{name}
  99. %{_datadir}/applications/*-%{name}.desktop
  100. %{_datadir}/icons/hicolor/*/apps/*.png
  101. %changelog
  102. * Sat Jun 11 2011 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.3.4-2
  103. - add Patch2 to fix build failure on ppc
  104. * Sun Feb 20 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.3.4-1
  105. - new upstream release
  106. - added BuildRequires: libboost-filesystem, libboost-regex
  107. * Fri Jan 21 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.2.4-2
  108. - rebuilt with current libboost
  109. * Sat Aug 21 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.2.4-1
  110. - initial build