teco-1.00-r4.ebuild 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils toolchain-funcs flag-o-matic readme.gentoo
  5. DESCRIPTION="Classic TECO editor, Predecessor to EMACS"
  6. HOMEPAGE="http://www.ibiblio.org/pub/linux/apps/editors/tty/ http://www.ibiblio.org/pub/academic/computer-science/history/pdp-11/teco"
  7. SRC_URI="http://www.ibiblio.org/pub/linux/apps/editors/tty/teco.tar.gz
  8. doc? ( mirror://gentoo/tecolore.txt.gz
  9. mirror://gentoo/tech.txt.gz
  10. mirror://gentoo/teco.doc.gz
  11. mirror://gentoo/tecoprog.doc.gz )"
  12. LICENSE="freedist"
  13. SLOT="0"
  14. KEYWORDS="alpha amd64 ~ppc x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
  15. IUSE="doc"
  16. RDEPEND="sys-libs/ncurses:0"
  17. DEPEND="${RDEPEND}
  18. virtual/pkgconfig"
  19. S="${WORKDIR}"
  20. src_unpack() {
  21. unpack teco.tar.gz
  22. if use doc; then
  23. mkdir doc
  24. cd doc || die
  25. unpack tecolore.txt.gz tech.txt.gz teco.doc.gz tecoprog.doc.gz
  26. fi
  27. }
  28. src_prepare() {
  29. local pkg_config=$("$(tc-getPKG_CONFIG)" --libs ncurses)
  30. sed -i -e "s:\$(CC):& \$(LDFLAGS):;s:-ltermcap:${pkg_config}:" \
  31. Makefile || die
  32. # bug 103257
  33. epatch "${FILESDIR}"/${PN}-double-free.diff
  34. epatch "${FILESDIR}"/${PN}-gcc4.patch
  35. epatch "${FILESDIR}"/${PN}-warnings.patch
  36. }
  37. src_compile() {
  38. append-flags -ansi
  39. append-cppflags -D_POSIX_SOURCE
  40. emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
  41. }
  42. src_install() {
  43. dobin te
  44. doman te.1
  45. dodoc sample.tecorc sample.tecorc2 READ.ME MANIFEST
  46. if use doc; then
  47. cd doc
  48. dodoc tecolore.txt tech.txt teco.doc tecoprog.doc
  49. fi
  50. DOC_CONTENTS="The TECO binary is called te.
  51. \nSample configurations and documentation are available
  52. in /usr/share/doc/${PF}/."
  53. readme.gentoo_create_doc
  54. }