summaryrefslogtreecommitdiff
path: root/parallel/glunix/Makefile
blob: e1e581b66d0bb949f578aa674e5207a1606cd8dc (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
# $NetBSD: Makefile,v 1.4 1999/03/03 23:28:52 hubertf Exp $

DISTNAME=	glunix-release-1-0a
PKGNAME=	glunix-1.0a
CATEGORIES=	parallel
MASTER_SITES=	http://now.cs.berkeley.edu/Glunix/ \
		http://www.inficad.com/~garbled/
DISTFILES=	${DISTNAME}${EXTRACT_SUFX} makedepend${EXTRACT_SUFX}

MAINTAINER=	root@garbled.net
HOMEPAGE=	http://now.cs.berkeley.edu/Glunix/glunix.html

DEPENDS+=	ssh-1.2.26:../../security/ssh
DEPENDS+=	addnerd-1.6:../../sysutils/addnerd

USE_GMAKE=	yes
USE_PERL5=	yes
IS_INTERACTIVE= yes
NO_MTREE=	yes
NO_WRKSUBDIR=	yes
MIRROR_DISTFILE=NO

MESSAGE_FILE=	${WRKDIR}/MESSAGE

NOW_ROOT=	${LOCALBASE}/now

.if (${MACHINE} == "i386")
FLAGS= "-m486 -DL_ENDIAN"
.endif

MAKE_ENV+= OPSYS=${OPSYS} ARCH=${MACHINE} NOW_ROOT=${NOW_ROOT}
MAKE_ENV+= PORTSDIR=${PKGDIR} WRKDIR=${WRKDIR} FLAGS=${FLAGS}

SCRIPTS_ENV+= ARCH=${MACHINE} RM=${RM} NOW_ROOT=${NOW_ROOT}

# the glunix group needs to exist before building.
pre-configure:
	${CP} ${FILESDIR}/Makefile-2 ${WRKSRC}/Makefile
	@addgroup=`${AWK} -F: 'BEGIN { found = gid = 0; }		\
		$$1 == "glunix" { found = 1; exit 0; }			\
		$$1 != "glunix" && $$1 != "nogroup" { if ($$3 > gid) { gid = $$3; } } \
		END { if (found) { printf("--exists--"); } else { printf("glunix:*:%d:\n", gid + 1); }}' /etc/group`;\
	if [ "$$addgroup" != "--exists--" ]; then			\
		${ECHO} "Adding group $$addgroup";			\
		${ECHO} "$$addgroup" >> /etc/group;			\
	fi

# On arm32, with UVM, pmap.h contains a C++ keyword. Workaround this.
pre-build:
	@if [ ${MACHINE} = "arm32" -a ! -z "${UVM}" ]; then		\
		${MKDIR} -p ${WRKSRC}/glunix/include/machine;		\
		${SED} -e 's|virtual|virt|' /usr/include/machine/pmap.h \
			> ${WRKSRC}/glunix/include/machine/pmap.h; 	\
	fi

pre-install:
	${SED} -e 's|\$${NOW_ROOT}|${NOW_ROOT}|g' ${PKGDIR}/MESSAGE > ${MESSAGE_FILE}
	@${ECHO} "updating /etc/shells";
	${CP} /etc/shells /etc/shells.bak;
	( ${GREP} -v ${NOW_ROOT}/bin/glush /etc/shells.bak;		\
		${ECHO} ${NOW_ROOT}/bin/glush				\
	) >/etc/shells
	-${LOCALBASE}/sbin/addnerd -g glunix -s ${NOW_ROOT}/bin/glush glunix

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