logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

tinyssh-20181206.ebuild (1466B)


  1. # Copyright 1999-2018 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. inherit systemd
  5. DESCRIPTION="A small SSH server with state-of-the-art cryptography"
  6. HOMEPAGE="https://tinyssh.org"
  7. SRC_URI="https://github.com/janmojzis/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
  8. LICENSE="public-domain"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE="+sodium"
  12. DEPEND="
  13. sodium? ( dev-libs/libsodium )
  14. "
  15. RDEPEND="
  16. ${DEPEND}
  17. sys-apps/ucspi-tcp
  18. "
  19. src_prepare() {
  20. # Leave optimization level to user CFLAGS
  21. sed -i 's/-Os -fomit-frame-pointer -funroll-loops//g' ./conf-cc || die
  22. # Use make-tinysshcc.sh script, which has no tests and doesn't execute
  23. # binaries. See https://github.com/janmojzis/tinyssh/issues/2
  24. sed -i 's/tinyssh/tinysshcc/g' ./Makefile || die
  25. default
  26. }
  27. src_compile() {
  28. if use sodium
  29. then
  30. emake \
  31. LIBS="-lsodium" \
  32. CFLAGS="$CFLAGS -I/usr/include/sodium" \
  33. LDFLAGS="-L/usr/lib"
  34. else
  35. emake
  36. fi
  37. }
  38. src_install() {
  39. dosbin build/bin/tinysshd{,-makekey}
  40. dobin build/bin/tinysshd-printkey
  41. doman man/*
  42. newinitd "${FILESDIR}/${PN}.initd" "${PN}"
  43. newconfd "${FILESDIR}/${PN}.confd" "${PN}"
  44. systemd_newunit "${FILESDIR}/${PN}.service" "${PN}@.service"
  45. systemd_newunit "${FILESDIR}/${PN}.socket" "${PN}@.socket"
  46. systemd_dounit "${FILESDIR}/${PN}-makekey.service"
  47. }
  48. pkg_postinst() {
  49. einfo "TinySSH is in beta stage, and ready for production use."
  50. einfo "See https://tinyssh.org for more information."
  51. }