conserver-8.1.18-r1.ebuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit ssl-cert eutils pam autotools
  5. DESCRIPTION="Serial Console Manager"
  6. HOMEPAGE="http://www.conserver.com/"
  7. SRC_URI="http://www.conserver.com/${P}.tar.gz"
  8. LICENSE="BSD GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
  11. IUSE="kerberos libressl pam ssl tcpd debug"
  12. DEPEND="ssl? (
  13. !libressl? ( dev-libs/openssl:0= )
  14. libressl? ( dev-libs/libressl:0= )
  15. )
  16. pam? ( virtual/pam )
  17. tcpd? ( sys-apps/tcp-wrappers )
  18. debug? ( dev-libs/dmalloc )
  19. kerberos? (
  20. virtual/krb5
  21. net-libs/libgssglue
  22. )"
  23. RDEPEND="${DEPEND}
  24. pam? ( >=sys-auth/pambase-20080219.1 )"
  25. src_prepare() {
  26. # Apply patch to prevent package from stripping binaries
  27. epatch "${FILESDIR}"/${PN}-prestrip.patch
  28. # Apply patch to use custom dmalloc macro
  29. epatch "${FILESDIR}"/${P}-dmalloc.patch
  30. AT_M4DIR="m4" eautoreconf
  31. }
  32. src_configure() {
  33. econf \
  34. $(use_with ssl openssl) \
  35. $(use_with pam) \
  36. $(use_with tcpd libwrap) \
  37. $(use_with debug dmalloc) \
  38. $(use_with kerberos gssapi) \
  39. --with-logfile=/var/log/conserver.log \
  40. --with-pidfile=/var/run/conserver.pid \
  41. --with-cffile=conserver/conserver.cf \
  42. --with-pwdfile=conserver/conserver.passwd \
  43. --with-master=localhost \
  44. --with-port=7782
  45. }
  46. src_install() {
  47. emake DESTDIR="${D}" exampledir="/usr/share/doc/${PF}/examples" install
  48. ## create data directory
  49. dodir /var/consoles
  50. fowners daemon:daemon /var/consoles
  51. fperms 700 /var/consoles
  52. ## add startup and sample config
  53. newinitd "${FILESDIR}"/conserver.initd-r1 conserver
  54. newconfd "${FILESDIR}"/conserver.confd conserver
  55. dodir /etc/conserver
  56. fperms 700 /etc/conserver
  57. insinto /etc/conserver
  58. newins "${S}"/conserver.cf/conserver.cf conserver.cf.sample
  59. newins "${S}"/conserver.cf/conserver.passwd conserver.passwd.sample
  60. ## add docs
  61. dohtml conserver.html
  62. dodoc CHANGES FAQ PROTOCOL README TODO
  63. dodoc conserver/Sun-serial contrib/maketestcerts
  64. newdoc conserver.cf/conserver.cf conserver.cf.sample
  65. # Add pam config
  66. newpamd "${FILESDIR}"/conserver.pam-pambase conserver
  67. }
  68. pkg_postinst() {
  69. # Add certs if SSL use flag is enabled
  70. if use ssl && [ ! -f "${ROOT}"/etc/ssl/conserver/conserver.key ]; then
  71. install_cert /etc/ssl/conserver/conserver
  72. fi
  73. }