mksh-9999.ebuild 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit eutils toolchain-funcs
  5. if [[ $PV = 9999 ]]; then
  6. inherit cvs
  7. ECVS_SERVER="anoncvs.mirbsd.org:/cvs"
  8. ECVS_MODULE="mksh"
  9. ECVS_USER="_anoncvs"
  10. ECVS_AUTH="ext"
  11. KEYWORDS=""
  12. DEPEND="static? ( dev-libs/klibc )"
  13. else
  14. inherit unpacker
  15. DEPEND="app-arch/cpio
  16. static? ( dev-libs/klibc )"
  17. SRC_URI="http://www.mirbsd.org/MirOS/dist/mir/mksh/${PN}-R${PV}.cpio.gz"
  18. KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux"
  19. fi
  20. DESCRIPTION="MirBSD Korn Shell"
  21. HOMEPAGE="http://mirbsd.de/mksh"
  22. LICENSE="BSD"
  23. SLOT="0"
  24. IUSE="static"
  25. RDEPEND=""
  26. S="${WORKDIR}/${PN}"
  27. src_compile() {
  28. tc-export CC
  29. # we want to build static with klibc
  30. if use static; then unset CC; export CC="/usr/bin/klcc"; export LDSTATIC="-static"; fi
  31. export CPPFLAGS="${CPPFLAGS} -DMKSH_DEFAULT_PROFILEDIR=\\\"${EPREFIX}/etc\\\""
  32. sh Build.sh -r -c lto || sh Rebuild.sh || die
  33. }
  34. src_install() {
  35. exeinto /bin
  36. doexe mksh
  37. doman mksh.1
  38. dodoc dot.mkshrc
  39. }
  40. src_test() {
  41. ./test.sh || die
  42. }
  43. pkg_postinst() {
  44. ebegin "Updating /etc/shells"
  45. ( grep -v "^/bin/mksh$" "${ROOT}"etc/shells; echo "/bin/mksh" ) > "${T}"/shells
  46. mv -f "${T}"/shells "${ROOT}"etc/shells
  47. eend $?
  48. }