nufw-2.2.22-r1.ebuild 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. SSL_CERT_MANDATORY=1
  5. inherit autotools eutils multilib pam ssl-cert
  6. DESCRIPTION="An enterprise grade authenticating firewall based on netfilter"
  7. HOMEPAGE="http://www.nufw.org/"
  8. SRC_URI="http://www.nufw.org/attachments/download/39/${P}.tar.bz2"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="~amd64 x86"
  12. IUSE="debug ldap mysql pam pam_nuauth plaintext postgres prelude unicode nfqueue nfconntrack static syslog test"
  13. REQUIRED_USE="pam_nuauth? ( plaintext )"
  14. DEPEND="
  15. dev-libs/cyrus-sasl
  16. dev-libs/glib:2
  17. dev-libs/libgcrypt:0
  18. dev-python/ipy
  19. net-firewall/iptables
  20. net-libs/gnutls
  21. ldap? ( >=net-nds/openldap-2 )
  22. mysql? ( virtual/mysql )
  23. nfconntrack? ( net-libs/libnetfilter_conntrack )
  24. nfqueue? ( net-libs/libnfnetlink net-libs/libnetfilter_queue )
  25. pam? ( sys-libs/pam )
  26. pam_nuauth? ( sys-libs/pam )
  27. postgres? ( dev-db/postgresql[server] )
  28. prelude? ( dev-libs/libprelude )
  29. "
  30. RDEPEND=${DEPEND}
  31. RESTRICT="test"
  32. src_prepare() {
  33. epatch "${FILESDIR}"/${P}-var-run.patch
  34. sed -i \
  35. -e 's:^#\(nuauth_tls_key="/etc/nufw/\)nuauth-key.pem:\1nuauth.key:' \
  36. -e 's:^#\(nuauth_tls_cert="/etc/nufw/\)nuauth-cert.pem:\1nuauth.pem:' \
  37. conf/nuauth.conf || die
  38. sed -i \
  39. -e "/^modulesdir/s|=.*|= /$(get_libdir)/security|g" \
  40. src/clients/pam_nufw/Makefile.am || die
  41. eautoreconf
  42. }
  43. src_configure() {
  44. econf \
  45. $(use_enable debug) \
  46. $(use_enable pam_nuauth pam-nufw) \
  47. $(use_enable static) \
  48. $(use_with ldap) \
  49. $(use_with mysql mysql-auth) \
  50. $(use_with mysql mysql-log) \
  51. $(use_with nfconntrack) \
  52. $(use_with nfqueue) \
  53. $(use_with pam system-auth) \
  54. $(use_with plaintext plaintext-auth) \
  55. $(use_with postgres pgsql-log) \
  56. $(use_with prelude prelude-log) \
  57. $(use_with syslog syslog-log) \
  58. $(use_with unicode utf8) \
  59. --enable-shared \
  60. --includedir="/usr/include/nufw" \
  61. --localstatedir="/var" \
  62. --sysconfdir="/etc/nufw" \
  63. --with-mark-group \
  64. --with-user-mark
  65. }
  66. src_install() {
  67. default
  68. newinitd "${FILESDIR}"/nufw-init.d nufw
  69. newconfd "${FILESDIR}"/nufw-conf.d nufw
  70. newinitd "${FILESDIR}"/nuauth-init.d nuauth
  71. newconfd "${FILESDIR}"/nuauth-conf.d nuauth
  72. insinto /etc/nufw
  73. doins conf/nuauth.conf
  74. dodoc AUTHORS ChangeLog NEWS README TODO
  75. docinto scripts
  76. dodoc scripts/{clean_conntrack.pl,nuaclgen,nutop,README,ulog_rotate_daily.sh,ulog_rotate_weekly.sh}
  77. docinto conf
  78. dodoc conf/*.{nufw,schema,conf,dump,xml}
  79. if use pam; then
  80. pamd_mimic system-auth nufw auth account password session
  81. fi
  82. prune_libtool_files
  83. }
  84. pkg_postinst() {
  85. install_cert /etc/nufw/{nufw,nuauth}
  86. }