summaryrefslogtreecommitdiff
path: root/shells/zsh/Makefile.common
blob: 4a7d30e6b81bcb148da5c719ef063f8bf3130d75 (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
# $NetBSD: Makefile.common,v 1.15 2004/08/20 11:48:46 tron Exp $

DISTNAME=       zsh-${ZSH_VERSION}
CATEGORIES=	shells
MASTER_SITES=   ftp://sunsite.dk/pub/unix/shells/zsh/ \
		ftp://ftp.fu-berlin.de/pub/unix/shells/zsh/ \
		ftp://ftp.lysator.liu.se/pub/unix/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://sunsite.dk/zsh/
COMMENT=	The Z shell

USE_BUILDLINK3=		YES
USE_PKGINSTALL=		YES
GNU_CONFIGURE=		YES

USE_MAKEINFO=		YES
INFO_FILES=		zsh.info

PKG_INSTALLATION_TYPES=	overwrite pkgviews

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

BUILD_DEFS+=	ZSH_STATIC

.if defined(ZSH_STATIC) && !empty(ZSH_STATIC:M[Yy][Ee][Ss])
CONFIGURE_ARGS+=--disable-dynamic

NETBSD_SHLINKER=	/libexec/ld.elf_so

.  if ${OPSYS} == "NetBSD" && \
      defined(MKDYNAMICROOT) && !empty(MKDYNAMICROOT:M[Yy][Ee][Ss]) && \
      ${OBJECT_FMT} == "ELF" && exists(${NETBSD_SHLINKER})
#
# Built a dynamically linked "zsh" binary on NetBSD systems which use
# dynamically linked binaries on the root filesystem. The binary will
# only depend on the run-time link-editor and shared libraries on the
# root filesystem. We use "-rpath" below by purpose because the
# buildlink 3 framework won't filter it out.
#
LDFLAGS+=	-Wl,-dynamic-linker=${NETBSD_SHLINKER} -rpath=/lib
.  else
LDFLAGS+=	-static
.  endif
.else
.  if ${OPSYS} == "SunOS"
PLIST_SRC=	${PKGDIR}/PLIST.dynamic ${PKGDIR}/PLIST
.  else
LDFLAGS+=	-Wl,${RPATH_FLAG}${PREFIX}/lib/zsh
PLIST_SRC=	${PKGDIR}/PLIST.shlibs ${PKGDIR}/PLIST.dynamic ${PKGDIR}/PLIST
.  endif
.endif

.undef MANZ

PKG_SHELL=	${PREFIX}/bin/zsh

INSTALL_TARGET=	install install.info

post-install:
	@${INSTALL_DATA_DIR} ${PREFIX}/share/doc/zsh
	@cd ${WRKSRC}/Etc; ${INSTALL_DATA} BUGS FAQ 	\
		${PREFIX}/share/doc/zsh
	@cd ${WRKSRC}; ${INSTALL_DATA} FEATURES NEWS	\
		${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