aboutsummaryrefslogtreecommitdiff
path: root/www/geronimo/Makefile
blob: 8f7aae48f0fefbc714ae267cbac5b663462098a2 (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
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
91
92
93
94
95
96
97
98
99
100
101
102
# New ports collection makefile for:	geronimo
# Date created:		26 Apr 2007
# Whom:			Nemo Liu <nemoliu@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	geronimo
PORTVERSION=	2.0.M3
CATEGORIES=	www devel java
MASTER_SITES=	${MASTER_SITE_APACHE}
MASTER_SITE_SUBDIR=	geronimo/${PORTVERSION:C/\.M/-M/}
DISTNAME=	${PORTNAME}-tomcat6-jee5-${PORTVERSION:C/\.M/-M/}-bin

MAINTAINER=	nemoliu@FreeBSD.org
COMMENT=	Open-source Java EE 5 application server

USE_JAVA=	yes
JAVA_VERSION=	1.5+
NO_BUILD=	YES

USE_RC_SUBR=	geronimo2.sh
SUB_FILES=	pkg-install pkg-deinstall

MAJOR_VER=	${PORTVERSION:S/.0.M3//}
APP_HOME?=	${PREFIX}/${PKGBASE}${PORTVERSION:S/.0.M3//}
LOG_DIR=	${APP_HOME}/var/log
APP_TITLE=	Geronimo
APP_SHORTNAME=	geronimo${MAJOR_VER:S/.0.M3//}
GERONIMO_USER?=	www
GERONIMO_GROUP?=www
GERONIMO_OUT=	${LOG_DIR}/geronimo.out
PID_FILE=	/var/run/${APP_SHORTNAME}.pid
WRKDIR?=	${WRKDIRPREFIX}${.CURDIR}/work
WRKSRC=		${WRKDIR}/${PORTNAME}-tomcat6-jee5-${PORTVERSION:C/\.M/-M/}
JAR_FILE=	bin/server.jar
PLIST_SUB+=	T=${APP_HOME:S/^${PREFIX}\///} WWWOWN=${TOMCAT_USER} WWWGRP=${TOMCAT_GROUP}
LATEST_LINK=	${APP_SHORTNAME}

SUB_LIST=	GERONIMO_HOME=${APP_HOME} \
		APP_SHORTNAME=${APP_SHORTNAME} \
		APP_TITLE="${APP_TITLE}" \
		GROUP=${GERONIMO_GROUP} \
		HTTP_PORT=${HTTP_PORT} \
		JAR_FILE=${JAR_FILE} \
		PID_FILE=${PID_FILE} \
		GERONIMO_OUT=${GERONIMO_OUT} \
		USER=${GERONIMO_USER} \
		GERONIMO_VERSION=${MAJOR_VER} \
		GERONIMO_OUT=${GERONIMO_OUT} \
		JAVA_HOME=${JAVA_HOME}

.include <bsd.port.pre.mk>

pre-patch:
	@${ECHO_MSG} "Installation settings:"
	@${ECHO_MSG} "   Destination directory:    ${APP_HOME}"
	@${ECHO_MSG} "   Location of JDK:          ${JAVA_HOME}"
	@${ECHO_MSG} "   Location of Java port:    ${JAVA_PORT}"
	@${ECHO_MSG} "   Running as (user/group):  ${GERONIMO_USER}/${GERONIMO_GROUP}"
	@${ECHO_MSG} "   Logfile:		   ${GERONIMO_OUT}"

post-patch:
	@${ECHO_MSG} -n ">> Removing unneeded files..."
	@${RM} -f `${FIND} ${WRKSRC} -name '*.bat'` `${FIND} ${WRKSRC} -name '*.orig'` `${FIND} ${WRKSRC} -name '*.exe'`
	@${ECHO_MSG} " [ DONE ]"

pre-install:
	@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL

do-install:
	@${ECHO_MSG} -n ">> Creating destination directory..."
	@${MKDIR} ${APP_HOME}
	@${MKDIR} ${LOG_DIR}
	@${MKDIR} ${APP_HOME}/deploy
	@${ECHO_MSG} " [ DONE ]"

	@${ECHO_MSG} ">> Copying files to destination directory..."
	@${CP} -R ${WRKSRC}/* ${APP_HOME}
	@${ECHO_MSG} " [ DONE ]"

	@${ECHO_MSG} -n ">> Creating log files..."
	@${INSTALL} -m 664 -o ${GERONIMO_USER} -g ${GERONIMO_GROUP} /dev/null ${GERONIMO_OUT}
	@${ECHO_MSG} " [ DONE ]"

	@${ECHO_MSG} -n ">> Creating symlink to tools.jar..."
	@${LN} -sf ${JAVA_HOME}/lib/tools.jar ${APP_HOME}/lib/tools.jar
	@${ECHO_MSG} " [ DONE ]"

	@${ECHO_MSG} -n ">> Fixing ownership settings..."
	@${CHOWN} -R ${GERONIMO_USER}:${GERONIMO_GROUP} ${APP_HOME}/lib ${APP_HOME}/var \
		${APP_HOME}/schema ${APP_HOME}/lib ${APP_HOME}/repository
	@${ECHO_MSG} " [ DONE ]"

	@${ECHO_MSG} -n ">> Fixing permissions..."
	@${CHMOD} 755 `${FIND} ${APP_HOME} -type d`
	@${ECHO_MSG} " [ DONE ]"

post-install:
	@${ECHO_MSG} "${APP_TITLE} ${PORTVERSION} has been installed in ${APP_HOME}."

.include <bsd.port.post.mk>