summaryrefslogtreecommitdiff
path: root/sys-apps/nawk/nawk-20230909.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-09-12 04:40:07 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-09-12 04:40:07 +0100
commit5d5e56d92268c2b9b6ccc38eeaa3516ce9b1e8fd (patch)
tree587e467a631661f0e4786a584d79db3a9eeab5d7 /sys-apps/nawk/nawk-20230909.ebuild
parentf8399e5cf87087ab3b9f8b1ed2955c0bd5469a9b (diff)
gentoo auto-resync : 12:09:2023 - 04:40:07
Diffstat (limited to 'sys-apps/nawk/nawk-20230909.ebuild')
-rw-r--r--sys-apps/nawk/nawk-20230909.ebuild58
1 files changed, 58 insertions, 0 deletions
diff --git a/sys-apps/nawk/nawk-20230909.ebuild b/sys-apps/nawk/nawk-20230909.ebuild
new file mode 100644
index 000000000000..5230376651aa
--- /dev/null
+++ b/sys-apps/nawk/nawk-20230909.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="Brian Kernighan's pattern scanning and processing language"
+HOMEPAGE="https://www.cs.princeton.edu/~bwk/btl.mirror/"
+SRC_URI="https://github.com/onetrueawk/awk/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux"
+
+DEPEND="
+ app-alternatives/yacc
+"
+
+S="${WORKDIR}/awk-${PV}"
+
+DOCS=( README.md FIXES )
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ HOSTCC="$(tc-getBUILD_CC)" \
+ CFLAGS="${CFLAGS}" \
+ CPPFLAGS=-DHAS_ISBLANK \
+ ALLOC="${LDFLAGS}" \
+ YACC=$(type -p yacc) \
+ YFLAGS="-d -b awkgram"
+}
+
+src_install() {
+ newbin a.out "${PN}"
+ sed \
+ -e 's/awk/nawk/g' \
+ -e 's/AWK/NAWK/g' \
+ -e 's/Awk/Nawk/g' \
+ awk.1 > "${PN}".1 || die "manpage patch failed"
+ doman "${PN}.1"
+ einstalldocs
+}
+
+pkg_postinst() {
+ if has_version app-admin/eselect && has_version app-eselect/eselect-awk
+ then
+ eselect awk update ifunset
+ fi
+}
+
+pkg_postrm() {
+ if has_version app-admin/eselect && has_version app-eselect/eselect-awk
+ then
+ eselect awk update ifunset
+ fi
+}