portage-overlay

personal portage ebuild repository
git clone anongit@rnpnr.xyz:portage-overlay.git
Log | Files | Refs | Feed | README

oksh-9999.ebuild (1003B)


      1 EAPI=8
      2 
      3 inherit git-r3
      4 
      5 DESCRIPTION="Portable OpenBSD ksh, based on the Public Domain Korn Shell (pdksh)"
      6 HOMEPAGE="https://github.com/ibara/oksh"
      7 EGIT_REPO_URI="https://github.com/ibara/oksh.git"
      8 
      9 LICENSE="public-domain"
     10 SLOT=0
     11 IUSE="+static +ksh curses"
     12 
     13 RDEPEND="ksh? ( !app-shells/ksh )"
     14 
     15 src_configure() {
     16 	econf CC=${CC} \
     17 		$(use_enable static) \
     18 		$(use_enable curses) \
     19 		--prefix="${EPREFIX}"/ \
     20 		--bindir="${EPREFIX}"/bin \
     21 		--mandir="${EPREFIX}"/usr/share/man
     22 }
     23 
     24 src_install() {
     25 	emake DESTDIR="${D}" install
     26 	use ksh && dosym oksh /bin/ksh || die
     27 	manfile=oksh.*
     28 	use ksh && dosym ${manfile} "${EPREFIX}"/usr/share/man/man1/ksh.${manfile#*.} || die
     29 	einstalldocs
     30 }
     31 
     32 pkg_postinst() {
     33 	if ! grep -q '^/bin/oksh$' "${EROOT}"/etc/shells ; then
     34 		ebegin "Updating /etc/shells"
     35 		echo "/bin/oksh" >> "${EROOT}"/etc/shells
     36 		eend $?
     37 	fi
     38 	if use ksh && ! grep -q '^/bin/ksh$' "${EROOT}"/etc/shells ; then
     39 		ebegin "Updating /etc/shells"
     40 		echo "/bin/ksh" >> "${EROOT}"/etc/shells
     41 		eend $?
     42 	fi
     43 }