ufw-frontends-0.3.2-r3.ebuild 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # Copyright 1999-2016 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
  6. DESCRIPTION="Provides graphical frontend to ufw"
  7. HOMEPAGE="https://github.com/baudm/ufw-frontends"
  8. SRC_URI="https://github.com/baudm/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
  9. # CC-BY-NC-SA-3.0 is for a png file
  10. LICENSE="GPL-3 CC-BY-NC-SA-3.0"
  11. SLOT="0"
  12. KEYWORDS="~amd64 ~x86"
  13. IUSE="kde policykit"
  14. DEPEND=""
  15. RDEPEND="${DEPEND}
  16. dev-python/pygobject:2[${PYTHON_USEDEP}]
  17. dev-python/pygtk[${PYTHON_USEDEP}]
  18. dev-python/pyinotify[${PYTHON_USEDEP}]
  19. net-firewall/ufw[${PYTHON_USEDEP}]
  20. !policykit? (
  21. kde? ( kde-apps/kdesu ) )
  22. policykit? ( sys-auth/polkit )
  23. "
  24. python_prepare_all() {
  25. if use policykit; then
  26. sed -i 's/^Exec=su-to-root -X -c/Exec=pkexec/' \
  27. share/ufw-gtk.desktop || die
  28. elif use kde; then
  29. sed -i 's/^Exec=su-to-root -X -c/Exec=kdesu/' \
  30. share/ufw-gtk.desktop || die
  31. fi
  32. # don't try to override run() to install the script
  33. # under /usr/sbin; it does not work with distutils-r1
  34. # and so it is handled differently (in python_install)
  35. sed -i '/cmdclass=/d' setup.py || die
  36. # Qt version is unusable
  37. rm gfw/frontend_qt.py || die
  38. distutils-r1_python_prepare_all
  39. # fix crash when no ufw logs in supported locations can
  40. # be found
  41. epatch "${FILESDIR}/${P}-no-log-crash.patch"
  42. }
  43. python_install() {
  44. distutils-r1_python_install --install-scripts="/usr/sbin"
  45. }
  46. python_install_all() {
  47. distutils-r1_python_install_all
  48. if use policykit; then
  49. insinto /usr/share/polkit-1/actions/
  50. doins "${FILESDIR}"/org.gentoo.pkexec.ufw-gtk.policy
  51. elif ! use kde; then
  52. rm "${D}usr/share/applications/ufw-gtk.desktop" || die
  53. fi
  54. }