summaryrefslogtreecommitdiff
path: root/www/neowebscript/Makefile
blob: ddf18ffd303d3e67b5d51cc9a153f081251ce654 (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
# New ports collection makefile for:	neowebscript
# Date created:				October 28, 2001
# Whom:					Mikhail Teterin <mi@aldan.algebra.com>
#
# $FreeBSD$
#

PORTNAME=	neowebscript
PORTVERSION=	3.3
PORTREVISION=	1
CATEGORIES=	www tcl83
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR=nws

MAINTAINER=	mi@aldan.algebra.com
COMMENT=	Embeds a TCL8 interpreter in the Apache server

BUILD_DEPENDS=	${APXS}:${PORTSDIR}/${APACHE_PORT}
LIB_DEPENDS=	neo82:${PORTSDIR}/devel/tcl-neo

MAKEFILE=	${FILESDIR}/Makefile.bsd
WRKSRC=		${WRKDIR}/${DISTNAME}/modules
MAKE_ENV+=	FILESDIR="${FILESDIR}" INSTALL_DATA="${INSTALL_DATA}"
USE_PERL5_BUILD=yes

SUBDIRS=	modules neowebscript htdocs # tools

# Only extract what we care for -- the tarball also includes antiquated
# versions of Apache, TCL, TclX, ITCL, gd...
EXTRACT_AFTER_ARGS:=| ${TAR} -xf - ${SUBDIRS:%=${PORTNAME}-${PORTVERSION}/%}

post-patch:
	# Replacing writeGIF with writePNG
	${PERL} -pi -e 's/writeGIF/writePNG/g' \
		`${FIND} ${WRKSRC}/.. -type f|${XARGS} fgrep -l --mmap writeGIF`

pre-install:
	# Removing *.orig files and empty directories:
	${FIND} ${WRKSRC}/../neowebscript ${WRKSRC}/../htdocs \
		\( -type f -name \*.orig -o -type d -empty \) -delete

CONFSCRIPT=	${LOCALBASE}/etc/apache/neowebscript.conf
PREFIX_CMD=	's^/usr/local^${PREFIX}^g'

post-install:
	test -e ${CONFSCRIPT} || ${SED} ${PREFIX_CMD} < \
		${FILESDIR}/neowebscript.conf > ${CONFSCRIPT}
.ifndef(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}
	${CP} -Rp ${WRKSRC}/../htdocs/* ${DOCSDIR}
.endif
	@${SED} ${PREFIX_CMD} < ${PKGMESSAGE}

.include <bsd.port.mk>