comix-4.0.4-r1.ebuild 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python2_7 )
  5. PLOCALES="ca cs es fr hr hu id ja ko pl pt_BR ru sv zh_CN zh_TW"
  6. inherit eutils fdo-mime gnome2-utils l10n python-single-r1
  7. DESCRIPTION="A GTK image viewer specifically designed to handle comic books"
  8. HOMEPAGE="http://comix.sourceforge.net"
  9. SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
  10. LICENSE="GPL-2"
  11. SLOT="0"
  12. KEYWORDS="amd64 ppc x86 ~x86-fbsd"
  13. IUSE="rar"
  14. DEPEND="${PYTHON_DEPS}
  15. dev-python/pillow[${PYTHON_USEDEP}]
  16. >=dev-python/pygtk-2.12[${PYTHON_USEDEP}]"
  17. RDEPEND="${DEPEND}
  18. rar? ( || ( app-arch/unrar app-arch/rar ) )"
  19. pkg_setup() {
  20. python-single-r1_pkg_setup
  21. }
  22. src_prepare() {
  23. l10n_find_plocales_changes messages "" "/LC_MESSAGES/comix.po"
  24. epatch "${FILESDIR}/${P}-pillow.patch" #471522, https://sourceforge.net/p/comix/patches/50/
  25. # do not install .pyc into /usr/share
  26. local pythondir="$(python_get_sitedir)/comix"
  27. pythondir="${pythondir#${EPREFIX}/usr/}"
  28. sed -i -e "s:share/comix/src:${pythondir}:g" install.py || die
  29. python_fix_shebang mime/comicthumb src/comix.py
  30. }
  31. src_install() {
  32. dodir /usr
  33. "${PYTHON}" install.py install --no-mime --dir "${D}"usr || die
  34. insinto /usr/share/mime/packages
  35. doins mime/comix.xml
  36. insinto /etc/gconf/schemas
  37. doins mime/comicbook.schemas
  38. dobin mime/comicthumb
  39. dodoc ChangeLog README
  40. remove_locale() {
  41. rm -r "${ED}/usr/share/locale/"$1 || die
  42. }
  43. l10n_for_each_disabled_locale_do remove_locale
  44. }
  45. pkg_preinst() {
  46. gnome2_gconf_savelist
  47. gnome2_icon_savelist
  48. }
  49. pkg_postinst() {
  50. gnome2_gconf_install
  51. fdo-mime_desktop_database_update
  52. fdo-mime_mime_database_update
  53. gnome2_icon_cache_update
  54. }
  55. pkg_postrm() {
  56. fdo-mime_desktop_database_update
  57. fdo-mime_mime_database_update
  58. gnome2_icon_cache_update
  59. }