firewalld-0.4.3.3.ebuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python{2_7,3_4} )
  5. #BACKPORTS=
  6. inherit autotools eutils gnome2-utils python-r1 systemd multilib bash-completion-r1
  7. DESCRIPTION="A firewall daemon with D-BUS interface providing a dynamic firewall"
  8. HOMEPAGE="http://www.firewalld.org/"
  9. SRC_URI="https://fedorahosted.org/released/${PN}/${P}.tar.bz2
  10. ${BACKPORTS:+https://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz}"
  11. LICENSE="GPL-2+"
  12. SLOT="0"
  13. KEYWORDS="amd64 x86"
  14. IUSE="gui"
  15. RDEPEND="${PYTHON_DEPS}
  16. dev-python/dbus-python[${PYTHON_USEDEP}]
  17. dev-python/decorator[${PYTHON_USEDEP}]
  18. >=dev-python/python-slip-0.2.7[dbus,${PYTHON_USEDEP}]
  19. dev-python/pygobject:3[${PYTHON_USEDEP}]
  20. net-firewall/ebtables
  21. net-firewall/iptables[ipv6]
  22. net-firewall/ipset
  23. || ( >=sys-apps/openrc-0.11.5 sys-apps/systemd )
  24. gui? (
  25. x11-libs/gtk+:3
  26. dev-python/PyQt4[${PYTHON_USEDEP}]
  27. )"
  28. DEPEND="${RDEPEND}
  29. dev-libs/glib:2
  30. >=dev-util/intltool-0.35
  31. sys-devel/gettext"
  32. src_prepare() {
  33. [[ -n ${BACKPORTS} ]] && \
  34. EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
  35. epatch
  36. epatch_user
  37. eautoreconf
  38. }
  39. src_configure() {
  40. python_setup
  41. econf \
  42. --enable-systemd \
  43. --with-iptables="${EROOT}/sbin/iptables" \
  44. --with-ip6tables="${EROOT}/sbin/ip6tables" \
  45. --with-iptables_restore="${EROOT}/sbin/iptables-restore" \
  46. --with-ip6tables_restore="${EROOT}/sbin/ip6tables-restore" \
  47. --with-ebtables="${EROOT}/sbin/ebtables" \
  48. --with-ebtables_restore="${EROOT}/sbin/ebtables-restore" \
  49. "$(systemd_with_unitdir 'systemd-unitdir')" \
  50. --with-bashcompletiondir="$(get_bashcompdir)"
  51. }
  52. src_install() {
  53. # manually split up the installation to avoid "file already exists" errors
  54. emake -C config DESTDIR="${D}" install
  55. emake -C po DESTDIR="${D}" install
  56. emake -C shell-completion DESTDIR="${D}" install
  57. emake -C doc DESTDIR="${D}" install
  58. install_python() {
  59. emake -C src DESTDIR="${D}" pythondir="$(python_get_sitedir)" install
  60. python_optimize
  61. }
  62. python_foreach_impl install_python
  63. python_replicate_script "${D}"/usr/bin/firewall-{offline-cmd,cmd,applet,config}
  64. python_replicate_script "${D}/usr/sbin/firewalld"
  65. # Get rid of junk
  66. rm -rf "${D}/etc/rc.d/"
  67. rm -rf "${D}/etc/sysconfig/"
  68. # For non-gui installs we need to remove GUI bits
  69. if ! use gui; then
  70. rm -rf "${D}/etc/xdg/autostart"
  71. rm -f "${D}/usr/bin/firewall-applet"
  72. rm -f "${D}/usr/bin/firewall-config"
  73. rm -rf "${D}/usr/share/applications"
  74. rm -rf "${D}/usr/share/icons"
  75. fi
  76. newinitd "${FILESDIR}"/firewalld.init firewalld
  77. }
  78. pkg_preinst() {
  79. gnome2_icon_savelist
  80. gnome2_schemas_savelist
  81. }
  82. pkg_postinst() {
  83. gnome2_icon_cache_update
  84. gnome2_schemas_update
  85. }
  86. pkg_postrm() {
  87. gnome2_icon_cache_update
  88. gnome2_schemas_update
  89. }