summaryrefslogtreecommitdiff
path: root/shells/zsh/Makefile.common
blob: 54f76c180e5e6cf40e67623fe639f2035ae2db58 (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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# $NetBSD: Makefile.common,v 1.49 2008/12/21 16:53:31 uebayasi Exp $

DISTNAME=	zsh-${ZSH_VERSION}
CATEGORIES=	shells
MASTER_SITES=	ftp://mirrors.dotsrc.org/zsh/ \
		ftp://ftp.fu-berlin.de/pub/unix/shells/zsh/ \
		ftp://ftp.funet.fi/pub/unix/shells/zsh/ \
		http://www.math.technion.ac.il/pub/zsh/ \
		ftp://ftp.zsh.org/zsh/
EXTRACT_SUFX=	.tar.bz2

MAINTAINER=	${ZSH_MAINTAINER}
HOMEPAGE=	http://zsh.dotsrc.org/
COMMENT=	The Z shell

PKG_DESTDIR_SUPPORT=	user-destdir

GNU_CONFIGURE=		yes

CONFIGURE_ARGS+=	--enable-etcdir=${PKG_SYSCONFDIR:Q}

USE_TOOLS+=		makeinfo
INFO_FILES=		# PLIST
TEXINFO_REQD=		4.0

PKG_INSTALLATION_TYPES=	overwrite pkgviews

.include "../../mk/bsd.prefs.mk"

# Handle any PKG_OPTIONS that this package might have.
.sinclude "options.mk"

BUILD_DEFS+=	ZSH_STATIC
MAKE_JOBS_SAFE=	no
INSTALL_TARGET=	install install.info
PKG_SHELL=	bin/zsh
PLIST_VARS=	dynamic terminfo shlibs

################################################################################

_ZSH_OPSYS.OpenBSD=		dynamic terminfo -      ldflags tcsetpgrp
_ZSH_OPSYS.Linux=		dynamic terminfo -      ldflags tcsetpgrp
_ZSH_OPSYS.IRIX=		dynamic terminfo -      ldflags tcsetpgrp
_ZSH_OPSYS.Interix=		dynamic terminfo shlibs ldflags notcsetpgrp
_ZSH_OPSYS.DragonFly=		dynamic terminfo shlibs ldflags tcsetpgrp
_ZSH_OPSYS.FreeBSD=		dynamic terminfo shlibs ldflags tcsetpgrp
_ZSH_OPSYS.SunOS=		dynamic -        -      -       tcsetpgrp

_ZSH_OPSYS.${OPSYS}?=		dynamic -        shlibs ldflags tcsetpgrp

################################################################################

### static

# Might be overwritten by hacks.mk.
_ZSH_STATIC.BUILDLINK_PASSTHRU_RPATHDIRS=	# nothing
_ZSH_STATIC.LDFLAGS=				-static

_ZSH_LINKAGE.static.CONFIGURE_ARGS=	--disable-dynamic
_ZSH_LINKAGE.static.BUILDLINK_PASSTHRU_RPATHDIRS= \
	${_ZSH_STATIC.BUILDLINK_PASSTHRU_RPATHDIRS}
_ZSH_LINKAGE.static.LDFLAGS=		${_ZSH_STATIC.LDFLAGS}

### dynamic

_ZSH_DYNAMIC_VARS.ldflags=	${COMPILER_RPATH_FLAG}${PREFIX}/lib/zsh

_ZSH_LINKAGE.dynamic.CONFIGURE_ARGS=
_ZSH_LINKAGE.dynamic.BUILDLINK_PASSTHRU_RPATHDIRS=
_ZSH_LINKAGE.dynamic.LDFLAGS=	${_ZSH_DYNAMIC_VARS.${_ZSH_OPSYS.${OPSYS}:Mldflags}}

_ZSH_LINKAGE.dynamic.PLIST.dynamic=	${_ZSH_OPSYS.${OPSYS}:Mdynamic:?yes:no}
_ZSH_LINKAGE.dynamic.PLIST.terminfo=	${_ZSH_OPSYS.${OPSYS}:Mterminfo:?yes:no}
_ZSH_LINKAGE.dynamic.PLIST.shlibs=	${_ZSH_OPSYS.${OPSYS}:Mshlibs:?yes:no}

###

_ZSH_OPSYS_VARS.tcsetpgrp=	--with-tcsetpgrp
_ZSH_OPSYS_VARS.notcsetpgrp=	--without-tcsetpgrp

################################################################################

_ZSH_LINKAGE=	${ZSH_STATIC:M[Yy][Ee][Ss]:?static:dynamic}	# static / dynamic

CONFIGURE_ARGS+=		${_ZSH_LINKAGE.${_ZSH_LINKAGE}.CONFIGURE_ARGS} \
				${_ZSH_OPSYS_VARS.${_ZSH_OPSYS.${OPSYS}:Mtcsetpgrp}} \
				${_ZSH_OPSYS_VARS.${_ZSH_OPSYS.${OPSYS}:Mnotcsetpgrp}}
BUILDLINK_PASSTHRU_RPATHDIRS+=	${_ZSH_LINKAGE.${_ZSH_LINKAGE}.BUILDLINK_PASSTHRU_RPATHDIRS}
LDFLAGS+=			${_ZSH_LINKAGE.${_ZSH_LINKAGE}.LDFLAGS}
PLIST.dynamic=			${_ZSH_LINKAGE.${_ZSH_LINKAGE}.PLIST.dynamic}
PLIST.terminfo=			${_ZSH_LINKAGE.${_ZSH_LINKAGE}.PLIST.terminfo}
PLIST.shlibs=			${_ZSH_LINKAGE.${_ZSH_LINKAGE}.PLIST.shlibs}

################################################################################

.undef MANZ

pre-install:
	@cd ${WRKSRC}/Completion; ${FIND} . -name \*.orig -exec ${RM} \{\} \;

post-install:
	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/doc/zsh
	cd ${WRKSRC}/Etc && ${INSTALL_DATA} BUGS FAQ 	\
		${DESTDIR}${PREFIX}/share/doc/zsh
	cd ${WRKSRC} && ${INSTALL_DATA} FEATURES NEWS	\
		${DESTDIR}${PREFIX}/share/doc/zsh

# Utilize Zsh's test framework.
# Testing of dynamic shell only works after install has been done
#
.PHONY: do-test do-su-test real-su-test

do-test: do-su-test

do-su-test:
	@${_PKG_SILENT}${_PKG_DEBUG}					\
	${ECHO_MSG} "*** Warning: This test needs to be run as root"
	@${_PKG_SILENT}${_PKG_DEBUG}					\
	realtarget="real-su-test";					\
	action="install";						\
	${_SU_TARGET}

real-su-test:
	@${_PKG_SILENT}${_PKG_DEBUG}					\
	${ECHO_MSG} "${_PKGSRC_IN}> Testing for ${PKGNAME}"
	@cd ${WRKSRC} && ${MAKE} check
	@cd ${WRKSRC}/Test && ${MAKE} clean