summaryrefslogtreecommitdiff
path: root/shells/ksh93/Makefile
blob: 73c0e18bcee148af69d2236ee5dc22bbe39c3f7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# $NetBSD: Makefile,v 1.1 2022/07/03 20:57:38 pin Exp $

DISTNAME=	v1.0.0-beta.2
PKGVER=		${DISTNAME:S,^v,,:S,-beta,,}
PKGNAME=	${GITHUB_PROJECT}93-${PKGVER}
CATEGORIES=	shells
MASTER_SITES=	${MASTER_SITE_GITHUB:=ksh93/}
GITHUB_PROJECT=	ksh
GITHUB_TAG=	${DISTNAME}

MAINTAINER=	vms@retrobsd.ddns.net
HOMEPAGE=	https://github.com/ksh93/ksh/
COMMENT=	Actively developed fork of AT&T KornShell 93u+
LICENSE=	epl-v1.0

CONFLICTS+=		ast-ksh-[0-9]* static-ast-ksh-[0-9]*

USE_LANGUAGES=		c
FORTIFY_SUPPORTED=	no

KSH=	${TOOLS_PATH.ksh:Q}

MAKEFLAGS+=		CC=${CC:Q} SHELL=${KSH}
MAKEFLAGS+=		CCFLAGS=${CFLAGS:M*:Q}

CFLAGS.SunOS+=	-std=c11 -D__EXTENSIONS__

PKG_SHELL=		bin/ksh93

INSTALLATION_DIRS=	bin ${PKGMANDIR}/man1

WRKSRC=	${WRKDIR}/ksh-${DISTNAME:S,^v,,}

do-build:
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} 				\
		${KSH} ./bin/package make ${MAKEFLAGS}

do-install:
	set -e;								\
	arch=`${WRKSRC}/bin/package host`;                              \
	${INSTALL_PROGRAM} ${WRKSRC}/arch/"$${arch}"/bin/ksh 		\
		${DESTDIR}${PREFIX}/bin/ksh93

	${INSTALL_MAN} ${WRKSRC}/src/cmd/ksh93/sh.1 			\
		${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/ksh93.1

do-test:
	cd ${WRKSRC} && ${SETENV} SHELL=${KSH}				\
		${KSH} ./bin/package test

.include "../../mk/bsd.pkg.mk"