summaryrefslogtreecommitdiffstats
path: root/www/gn/Makefile
blob: fcf1e3e251befa43fa8570fc3d79bcf3c3b807b0 (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
# New ports collection makefile for:    gn
# Version required:     2.24
# Date created:         20 Sep 1994
# Whom:                 adam
#
# $Id: Makefile,v 1.22 1999/08/27 22:30:22 mharo Exp $
#

DISTNAME=       gn-2.24
CATEGORIES=	www net
MASTER_SITES=	ftp://ftp.acns.nwu.edu/pub/gn/

MAINTAINER=	adam@veda.is

BUILD_DEPENDS=	${WAISDIR}/bin/waisindex:${PORTSDIR}/net/wais

IS_INTERACTIVE=	yes
NO_PACKAGE=	"Compiled in hostnames"
WAISDIR=	${PORTSDIR}/net/wais/work/freeWAIS-0.5

INETD_CONF=	/etc/inetd.conf
CONF=	'	stream	tcp	nowait	nobody	${PREFIX}/libexec/gn	gn'

pre-build:
	@${LN} -fs ${WAISDIR}/include ${WRKSRC}/waisgn/ir
	@${LN} -fs ${WAISDIR}/bin ${WRKSRC}/waisgn

pre-install:
	@${MKDIR} ${WRKSRC}/etc ${WRKSRC}/libexec ${WRKSRC}/gnroot
	@cd ${WRKSRC}/gnroot; \
		tar -cf - -C ${WRKSRC} docs | tar xpf - && \
			mv docs/sample.root.menu menu

post-install:
	@cd ${PREFIX}; \
	  [ -s etc/gn_mime.types ] && \
	  if ! cmp -s etc/gn_mime.types ${WRKSRC}/etc/gn_mime.types; then \
		${ECHO} mv etc/gn_mime.types etc/gn_mime.types.old; \
		mv etc/gn_mime.types etc/gn_mime.types.old; \
  	  fi; \
	  [ -s gnroot/menu ] && \
	  if ! cmp -s gnroot/menu ${WRKSRC}/gnroot/menu; then \
		${ECHO} mv gnroot/menu gnroot/menu.old; \
		mv gnroot/menu gnroot/menu.old; \
	  fi; \
	  tar -cf - -C ${WRKSRC} gnroot libexec bin etc | tar xpf - && \
		(cd gnroot; ${WRKSRC}/bin/mkcache -r); \
	  ${AWK} '$$1 ~ /#*gopher/ && $$6 == "${PREFIX}/libexec/gn" { exit 1 }' \
		${INETD_CONF} || { \ ${ECHO} '#'gopher${CONF} >>${INETD_CONF}
	  }

.include <bsd.port.mk>
OpenPOWER on IntegriCloud