--- ubin-wrappers-0.ebuild~ 2012-12-08 10:06:05.000000000 +0100 +++ ubin-wrappers-0.ebuild 2015-05-28 11:29:46.000000000 +0200 @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-freebsd/ubin-wrappers/ubin-wrappers-0.ebuild,v 1.2 2012/12/08 09:06:05 ulm Exp $ -EAPI=4 +EAPI=5 DESCRIPTION="/usr/bin wrapper scripts for FreeBSD script compatibility" HOMEPAGE="http://www.gentoo.org" @@ -18,12 +18,21 @@ S="${WORKDIR}" +dowrap() { + local x + for x do + [[ -e ${x} ]] || die "${x} does not exist" + newbin - "$(basename "${x}")" <<-EOF + #!/bin/sh + exec ${x} \${1:+"\$@"} + EOF + done +} + src_install() { - - into /usr/bin - "${FILESDIR}/dowrap" "${EPREFIX}/bin/"{bunzip2,bzcat,cpio,egrep,fgrep,grep,gunzip,gzip,zcat} - use userland_BSD && "${FILESDIR}/dowrap" "${EPREFIX}/bin/sort" - use userland_GNU && "${FILESDIR}/dowrap" "${EPREFIX}/bin/"{fuser,sed,uncompress} - + dowrap \ + "${EPREFIX}/bin/"{bunzip2,bzcat,cpio,egrep,fgrep,grep,gunzip,gzip,zcat} + use userland_BSD && dowrap "${EPREFIX}/bin/sort" + use userland_GNU && dowrap "${EPREFIX}/bin/"{fuser,sed,uncompress} }