aboutsummaryrefslogtreecommitdiffstats
path: root/editors/jed/Makefile
blob: 010fba8816a6112589f38cce5c6f5e3791ff75cc (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Created by: eric
# $FreeBSD$

PORTNAME=   jed
PORTVERSION=    0.99.19
PORTREVISION=   4
CATEGORIES= editors
MASTER_SITES=   ftp://space.mit.edu/pub/davis/jed/v${PORTVERSION:R}/ \
        ftp://ftp.fu-berlin.de/pub/unix/editors/jed/v${PORTVERSION:R}/ \
        ftp://ftp.ntua.gr/pub/lang/slang/jed/v${PORTVERSION:R}/
DISTNAME=   ${PORTNAME}-${PORTVERSION:R}-${PORTVERSION:E}

MAINTAINER= garga@FreeBSD.org
COMMENT=    A SLang-based text editor

LIB_DEPENDS=    slang:${PORTSDIR}/devel/libslang2

CONFLICTS=  jed-devel-[0-9]*

OPTIONS_DEFINE= X11 PERMS HOSTLOOKUP DOCS
OPTIONS_DEFAULT=X11 HOSTLOOKUP DOCS

PERMS_DESC= Respect permissions by Root
HOSTLOOKUP_DESC=Look-up for hostname

USE_BZIP2=  yes
DIST_SUBDIR=    jed
GNU_CONFIGURE=  yes
MAKE_JOBS_UNSAFE=   yes
CONFIGURE_ENV+= JED_ROOT=${PREFIX}/lib/jed

PORTDOCS=   *
MAKE_ENV+=  DEST_DOC_DIR=${DOCSDIR}
.if empty(PORT_OPTIONS:MDOCS)
MAKE_ENV+=  JED_DOC_FILES="" \
        JED_DOC_TXT_FILES="" \
        JED_DOC_HLP_FILES="" \
        JED_DOC_MAN_FILES=""
.endif

ALL_TARGET= all getmail
MAN1=       jed.1 rgrep.1

.include <bsd.port.pre.mk>

.if ${PORT_OPTIONS:MX11}
USE_XORG=   x11 ice xt
ALL_TARGET+=    xjed
PLIST_SUB+= XJED=""
.else
PLIST_SUB+= XJED="@comment "
.endif

.if empty(PORT_OPTIONS:MHOSTLOOKUP)
HOSTNAME_CMD=   /bin/hostname
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-src__userinfo.c
.endif

post-patch:
    @${REINPLACE_CMD} -e 's,(DEST_JED_ROOT)/doc,(DEST_DOC_DIR),g' \
              -e 's,\.\./info/\*,,' \
              -e 's,^\(JED_DOC_.*FILES\) =,\1 \?=,g' \
        ${WRKSRC}/src/Makefile.in
.if empty(PORT_OPTIONS:MDOCS)
    @${REINPLACE_CMD} -e '/MKINSDIR.*DEST_DOC_DIR/d' \
        ${WRKSRC}/src/Makefile.in
.endif
.if empty(PORT_OPTIONS:MPERMS)
    @${REINPLACE_CMD} 's|jed_file_is_readonly (file, 1)|jed_file_is_readonly (file, 0)|' ${WRKSRC}/src/file.c
.endif
.if empty(PORT_OPTIONS:MHOSTLOOKUP)
    @${REINPLACE_CMD} -e "s/%%JED_HOSTNAME%%/$$(${HOSTNAME_CMD})/" \
        ${WRKSRC}/src/userinfo.c
.endif

post-configure:
    @${REINPLACE_CMD} -e 's,\(.usr.bin.install\) *-c,\1 -s -m 555,' \
        ${WRKSRC}/src/Makefile

post-install:
    ${INSTALL_DATA} ${WRKSRC}/lib/vms_shell.com ${PREFIX}/lib/jed/lib
    ${INSTALL_DATA} ${WRKSRC}/lib/README ${PREFIX}/lib/jed/lib
    ${INSTALL_DATA} ${WRKSRC}/lib/jed.conf ${PREFIX}/lib/jed/lib

.include <bsd.port.post.mk>