alot-0.3.6.ebuild 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit distutils-r1 vcs-snapshot
  6. DESCRIPTION="Experimental terminal UI for net-mail/notmuch written in Python"
  7. HOMEPAGE="https://github.com/pazz/alot"
  8. SRC_URI="${HOMEPAGE}/tarball/${PV} -> ${P}.tar.gz"
  9. LICENSE="GPL-3"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~x86"
  12. IUSE="doc"
  13. DEPEND="
  14. doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
  15. "
  16. RDEPEND="
  17. >=dev-python/configobj-4.6.0[${PYTHON_USEDEP}]
  18. dev-python/pygpgme[${PYTHON_USEDEP}]
  19. >=dev-python/twisted-core-10.2.0
  20. >=dev-python/urwid-1.1.0[${PYTHON_USEDEP}]
  21. net-mail/mailbase
  22. >=net-mail/notmuch-0.13[crypt,python]
  23. sys-apps/file[python]
  24. "
  25. ALOT_UPDATE=""
  26. pkg_setup() {
  27. if has_version "<${CATEGORY}/${PN}-0.3.2"; then
  28. ALOT_UPDATE="yes"
  29. fi
  30. }
  31. src_prepare() {
  32. find "${S}" -name '*.py' -print0 | xargs -0 -- sed \
  33. -e '1i# -*- coding: utf-8 -*-' -i || die
  34. distutils-r1_src_prepare
  35. local md
  36. for md in *.md; do
  37. mv "${md}" "${md%.md}"
  38. done
  39. }
  40. src_compile() {
  41. distutils-r1_src_compile
  42. if use doc; then
  43. pushd docs || die
  44. emake html
  45. popd || die
  46. fi
  47. }
  48. src_install() {
  49. distutils-r1_src_install
  50. dodir /usr/share/alot
  51. insinto /usr/share/alot
  52. doins -r extra
  53. if use doc; then
  54. dohtml -r docs/build/html/*
  55. fi
  56. }
  57. pkg_postinst() {
  58. if [[ ${ALOT_UPDATE} = yes ]]; then
  59. ewarn "The syntax of theme-files and custom tags-sections of the config"
  60. ewarn "has been changed. You have to revise your config. There are"
  61. ewarn "converter scripts in /usr/share/alot/extra to help you out with"
  62. ewarn "this:"
  63. ewarn ""
  64. ewarn " * tagsections_convert.py for your ~/.config/alot/config"
  65. ewarn " * theme_convert.py to update your custom theme files"
  66. fi
  67. }