summaryrefslogtreecommitdiff
path: root/www/apache-tomcat55/Makefile
blob: 9c20321d67926544245cba32f6860cab5dca69d6 (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
# $NetBSD: Makefile,v 1.21 2012/10/28 06:30:09 asau Exp $

DISTNAME=	apache-tomcat-${TOMCAT_VERSION}
CATEGORIES=	www java
# The list of sites to download is generated by an apache website.
# The getsite.sh script parses the HTML and extracts the urls.

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://tomcat.apache.org/
COMMENT=	The Apache Project's Java Servlet 2.4 and JSP 2.0 server

LICENSE=	apache-2.0

TOMCAT_VERSION=	5.5.35

USE_JAVA=	run
# This needs java 1.5 or higher.
USE_JAVA2=	1.5

USE_TOOLS+=	pax

TOMCAT_LIB=	${PREFIX}/tomcat
CATALINA_DIR=	Catalina/localhost

EGDIR=		${TOMCAT_LIB}/share/examples/apache-tomcat
EGDIR2=		${EGDIR}/${CATALINA_DIR}

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

# Work around a bug in NetBSD 2.0's pax-as-tar (bin/27228)
.if !empty(MACHINE_PLATFORM:MNetBSD-2.0*)
EXTRACT_USING=	bsdtar
.endif

PKG_SYSCONFDIR.apache-tomcat=	${TOMCAT_LIB}/conf
MAKE_DIRS=	${PKG_SYSCONFDIR.apache-tomcat}/${CATALINA_DIR}

CONFLICTS+=	jakarta-tomcat55-[0-9]*
CONFLICTS+=	jakarta-tomcat-[0-9]*

RCD_SCRIPTS=	tomcat
CFILES=		server.xml web.xml tomcat-users.xml
CFILES+=	catalina.policy catalina.properties
CF2FILES=	manager.xml

CONF_FILES=	# empty
.for f in ${CFILES}
CONF_FILES+=	${EGDIR}/${f} ${PKG_SYSCONFDIR}/${f}
.endfor
.for f in ${CF2FILES}
CONF_FILES+=	${EGDIR2}/${f} ${PKG_SYSCONFDIR}/${CATALINA_DIR}/${f}
.endfor

FILES_SUBST+=	JAVA_HOME=${PKG_JAVA_HOME:Q} TOMCAT_LIB=${TOMCAT_LIB:Q}

# If we were going to build jsvc, this would be a start
# post-extract:
# 	@(cd ${WRKSRC} && ${GZCAT} bin/jsvc.tar.gz | ${TAR} xf - )
#
# post-configure:
# 	@(cd ${WRKSRC}/jsvc-src ; ${SH} ./configure)

do-build:
	${MV} ${WRKSRC}/conf ${WRKDIR}

INSTALLATION_DIRS+=	${EGDIR2} ${TOMCAT_LIB}

do-install:
.for f in ${CFILES}
	${INSTALL_DATA} ${WRKDIR}/conf/${f} ${DESTDIR}${EGDIR}
.endfor
.for f in ${CF2FILES}
	${INSTALL_DATA} ${WRKDIR}/conf/${CATALINA_DIR}/${f} ${DESTDIR}${EGDIR2}
.endfor
	${RM} -rf ${WRKSRC}/temp/*
	cd ${WRKSRC} && pax -rw -pm . ${DESTDIR}${TOMCAT_LIB}

	${FIND} ${DESTDIR}${TOMCAT_LIB} -type f -name \*.bat -print | ${XARGS} ${RM} -f
	${FIND} ${DESTDIR}${TOMCAT_LIB} -type d -print | ${XARGS} ${CHMOD} ${PKGDIRMODE}
	${FIND} ${DESTDIR}${TOMCAT_LIB} -type f -print | ${XARGS} ${CHMOD} ${SHAREMODE}
	${FIND} ${DESTDIR}${TOMCAT_LIB} -type f -name \*.sh -print | \
		${XARGS} ${CHMOD} ${BINMODE}

.include "../../mk/java-vm.mk"
.include "../../mk/bsd.pkg.mk"