summaryrefslogtreecommitdiff
path: root/editors/mg/Makefile
blob: 8b34f3985b7df0ae2196411fc45a3e7f7a71a537 (plain) (blame)
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
PORTNAME=	mg
DISTVERSION=	20241008
PORTEPOCH=	1
CATEGORIES=	editors
MASTER_SITES=	https://hydrus.org.uk/downloads/

MAINTAINER=	cdr.nil@gmail.com
COMMENT=	Small, fast Emacs-like editor
WWW=		https://man.openbsd.org/mg

LICENSE=	PD

FLAVORS=		dynamic static
FLAVOR?=		${FLAVORS:[1]}
static_PKGNAMESUFFIX=	-static

USES=		ncurses uidfix

.if ${FLAVOR} == static
COMMENT+=	(rescue(8) version)
MAKE_ARGS+=	NO_SHARED=yes
PLIST_FILES=	/rescue/mg
.else
PLIST_FILES=	bin/mg \
		share/man/man1/mg.1.gz
PORTDOCS=	README tutorial
OPTIONS_DEFINE=	DOCS
.endif

MAKE_ARGS+=	BINDIR=${PREFIX}/bin \
		MANDIR=${PREFIX}/share/man/man \
		NCURSESINC=${NCURSESINC} \
		NCURSESLIB=${NCURSESLIB}

.if ${FLAVOR} == static
do-install:
	@${MKDIR} ${STAGEDIR}/rescue
	${INSTALL_PROGRAM} ${WRKSRC}/mg ${STAGEDIR}/rescue
.else
post-install-DOCS-on:
	${MKDIR} ${STAGEDIR}${DOCSDIR}
	cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
.endif

.include <bsd.port.mk>