- Change install to DISTNAME instead of PKGNAME

- Kill INSTALL (from alek@)
- Move examples and documentation to -examples sub-package

with help and ok from nikolay@
This commit is contained in:
kurt 2005-03-03 21:50:43 +00:00
parent 48323327f9
commit a597da2309
9 changed files with 2093 additions and 2095 deletions

View File

@ -1,12 +1,12 @@
# $OpenBSD: Makefile,v 1.1.1.1 2004/11/04 21:46:04 naddy Exp $
# $OpenBSD: Makefile,v 1.2 2005/03/03 21:50:43 kurt Exp $
COMMENT= "Java servlet 2.4 and Java server pages 2.0 server"
# Requires a JVM
ONLY_FOR_ARCHS= i386
COMMENT-examples="example applications and documentation"
V= 5.0.28
DISTNAME= jakarta-tomcat-${V}
PKGNAME= ${DISTNAME}p0
PKGNAME-examples=jakarta-tomcat-examples-${V}p0
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_APACHE:=jakarta/tomcat-5/v$V/bin/} \
@ -14,13 +14,21 @@ MASTER_SITES= ${MASTER_SITE_APACHE:=jakarta/tomcat-5/v$V/bin/} \
HOMEPAGE= http://jakarta.apache.org/
MAINTAINER= Kurt Miller <truk@apache.org>
MAINTAINER= Kurt Miller <kurt@openbsd.org>
MULTI_PACKAGES= -examples
SUBPACKAGE?=
BUILD_DEPENDS= ::archivers/gtar
JAVA_HOME= ${LOCALBASE}/jdk1.3.1-linux
RUN_DEPENDS= :jdk*->=1.3:devel/jdk/1.3-linux
.if defined(PACKAGING) && ${SUBPACKAGE} == "-examples"
PREFIX= ${CATALINA_BASE}
RUN_DEPENDS= ::www/jakarta-tomcat/v5
.endif
# Apache Software License 2.0
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
@ -35,29 +43,36 @@ NO_REGRESS= Yes
CONFDIR= ${SYSCONFDIR}/tomcat
CATALINA_BASE= /var/tomcat
SAMPLEDIR= ${PREFIX}/share/examples/tomcat
SUBST_VARS+= PKGNAME CONFDIR CATALINA_BASE SAMPLEDIR
SUBST_VARS+= DISTNAME CONFDIR CATALINA_BASE
do-install:
${INSTALL_DATA_DIR} ${PREFIX}/${PKGNAME}
${INSTALL_DATA_DIR} ${PREFIX}/${DISTNAME}
cd ${WRKDIST} && \
tar cf - bin common server `find * -prune -type f` | \
tar -C ${PREFIX}/${PKGNAME} -xf -
tar -C ${PREFIX}/${DISTNAME} -xf -
${INSTALL_DATA_DIR} ${SAMPLEDIR}
${INSTALL_DATA} `find ${WRKDIST}/conf/* -prune -type f` ${SAMPLEDIR}
${INSTALL_DATA_DIR} ${WRKINST}/${CATALINA_BASE}
cd ${WRKDIST} && \
tar cf - conf webapps | \
tar -C ${SAMPLEDIR} -xf -
find ${WRKINST} -name *.orig -or -name *.bat -or -name *.exe | \
tar cf - webapps | \
tar -C ${WRKINST}/${CATALINA_BASE} -xf -
${INSTALL_DATA_DIR} ${WRKINST}/${CATALINA_BASE}/conf/Catalina/localhost
${INSTALL_DATA} ${WRKDIST}/conf/Catalina/localhost/* \
${WRKINST}/${CATALINA_BASE}/conf/Catalina/localhost
find ${WRKINST} -name \*.orig -or -name \*.bat -or -name \*.exe | \
xargs rm
@perl -pi -e 's,%%SYSCONFDIR%%,${SYSCONFDIR},' \
${PREFIX}/${PKGNAME}/bin/setclasspath.sh
${PREFIX}/${DISTNAME}/bin/setclasspath.sh
@sed -e 's,%%PREFIX%%,${TRUEPREFIX},' \
-e 's,%%PKGNAME%%,${PKGNAME},' \
-e 's,%%DISTNAME%%,${DISTNAME},' \
-e 's,%%SYSCONFDIR%%,${SYSCONFDIR},' \
-e 's,%%CATALINA_BASE%%,${CATALINA_BASE},' \
< ${FILESDIR}/README.OpenBSD \
> ${PREFIX}/${PKGNAME}/README.OpenBSD
> ${PREFIX}/${DISTNAME}/README.OpenBSD
@sed -e 's,%%PREFIX%%,${TRUEPREFIX},' \
-e 's,%%PKGNAME%%,${PKGNAME},' \
-e 's,%%DISTNAME%%,${DISTNAME},' \
-e 's,%%JAVA_HOME%%,${JAVA_HOME},' \
< ${FILESDIR}/tomcat.rc > ${SAMPLEDIR}/conf/tomcat.rc
-e 's,%%CATALINA_BASE%%,${CATALINA_BASE},' \
< ${FILESDIR}/tomcat.rc > ${SAMPLEDIR}/tomcat.rc
.include "bsd.port.mk"

View File

@ -1,18 +1,32 @@
$OpenBSD: README.OpenBSD,v 1.1.1.1 2004/11/04 21:46:04 naddy Exp $
$OpenBSD: README.OpenBSD,v 1.2 2005/03/03 21:50:43 kurt Exp $
Jakarta Tomcat on OpenBSD uses `%%SYSCONFDIR%%/tomcat' for its configuration files.
Jakarta Tomcat on OpenBSD uses the `%%SYSCONFDIR%%/tomcat' directory for its
configuration files. `$CATALINA_BASE' is `%%CATALINA_BASE%%'. All
files contained within these directories should be owned by the _tomcat
user.
The startup.sh script has been modified to get important environment
variables from `%%SYSCONFDIR%%/tomcat/tomcat.rc'. You should define environment
variables such as JAVA_HOME and JAVA_OPTS in `%%SYSCONFDIR%%/tomcat/tomcat.rc'.
The %%DISTNAME%% package does not install the example webapps.
You must supply your own webapps or install the jakarta-tomcat-examples
package to use the example webapps.
With the following command tomcat is started as user `_tomcat':
$ sudo -u _tomcat %%PREFIX%%/%%PKGNAME%%/bin/startup.sh
As `sudo' doesn't pass environment variables, you should define
environment variables in `%%SYSCONFDIR%%/tomcat/tomcat.rc'.
$ sudo -u _tomcat %%PREFIX%%/%%DISTNAME%%/bin/startup.sh
If you want Jakarta Tomcat to serve on privileged ports (e.g. 80),
then either edit `%%SYSCONFDIR%%/tomcat/server.xml' and change the Connector port
to 80, or even more secure: redirect all tcp traffic to port 80
to tomcat's default listener port 8080 using a pf.conf(5) rule like:
then makes sure the Connector port is 80 in your
`%%SYSCONFDIR%%/tomcat/server.xml', or even more secure: redirect all tcp
traffic to port 80 to tomcat's default listener port 8080 using a
pf.conf(5) rule like:
rdr on $NIC proto tcp from any to any port 80 -> 127.0.0.1 port 8080
`$CATALINA_BASE' (formerly `$TOMCAT_HOME') is `/var/tomcat'.
If you are upgrading and use database drivers, don't forget to copy
them into %%PREFIX%%/%%DISTNAME%%/common/lib. If you use
ssi or cgi, remember to rename to jar the appropriate .renametojar
files in %%PREFIX%%/%%DISTNAME%%/server/lib. You must
also delete any work files in `%%CATALINA_BASE%%/work' unless you are
reinstalling the same full version of tomcat.

View File

@ -1,18 +1,17 @@
# $OpenBSD: tomcat.rc,v 1.1.1.1 2004/11/04 21:46:04 naddy Exp $
# $OpenBSD: tomcat.rc,v 1.2 2005/03/03 21:50:43 kurt Exp $
#
# sudo doesn't pass environment variables, so
# define JAVA_HOME for _tomcat here
# Define JAVA_HOME for _tomcat here
# Start tomcat with following command:
# $ sudo -u _tomcat %%PREFIX%%/%%PKGNAME%%/bin/startup.sh
# $ sudo -u _tomcat %%PREFIX%%/%%DISTNAME%%/bin/startup.sh
#
JAVA_HOME=%%JAVA_HOME%%
# override other environment options:
#CATALINA_HOME=%%PREFIX%%/%%PKGNAME%%
#CATALINA_BASE=/var/tomcat
#CATALINA_HOME=%%PREFIX%%/%%DISTNAME%%
#CATALINA_BASE=%%CATALINA_BASE%%
#CATALINA_TMPDIR=$CATALINA_BASE/temp
#JAVA_OPTS=-Djava.net.preferIPv4Stack=true
#JAVA_OPTS="-server -Djava.net.preferIPv4Stack=true"
#JPDA_TRANSPORT=
#JPDA_ADDRESS=
#JSSE_HOME=

View File

@ -6,5 +6,5 @@ web services. Tomcat can be run as a standalone web server with
Servlet and JSP support, or using Apache HTTP Server as its web
server via the mod_jk Apache module (the www/mod_jk package).
See ${PREFIX}/${DISTNAME}/conf/README.OpenBSD for
See ${PREFIX}/${DISTNAME}/README.OpenBSD for
information on running Jakarta Tomcat on OpenBSD.

View File

@ -0,0 +1 @@
Example web applications and documentation for tomcat.

View File

@ -1,49 +0,0 @@
#!/bin/sh
# $OpenBSD: INSTALL,v 1.1.1.1 2004/11/04 21:46:09 naddy Exp $
#
# Pre/post-installation setup of jakarta-tomcat
# use a sane path and install prefix
#
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
CONFDIR=${CONFDIR}
CATALINA_BASE=${CATALINA_BASE}
SAMPLEDIR=${SAMPLEDIR}
#
# Function: post install webapp install and chown
#
do_post_install()
{
if [ -z "`ls ${CATALINA_BASE}/webapps/`" ]; then
echo "Empty ${CATALINA_BASE}/webapps detected."
echo "Installing example webapps from ${SAMPLEDIR}/webapps."
cd ${SAMPLEDIR}/webapps && \
tar cf - * | tar -C ${CATALINA_BASE}/webapps -xf -
chown -RP _tomcat:_tomcat ${CATALINA_BASE}/webapps
fi
}
# Verify proper execution
#
if [ $# -ne 2 ]; then
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
fi
# Verify/process the command
#
case $2 in
PRE-INSTALL)
;;
POST-INSTALL)
do_post_install "$1"
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
;;
esac
exit 0

View File

@ -1,16 +1,6 @@
For detailed instructions on how to run Tomcat see:
${SAMPLEDIR}/webapps/tomcat-docs/index.html
This package does not install the example webapps. You must supply
your own webapps or install the jakarta-tomcat-examples package to use
the example webapps.
For more information on application development with Tomcat, see
${SAMPLEDIR}/webapps/tomcat-docs/appdev/index.html
Note that Tomcat may be started with the following command:
$ sudo -u _tomcat ${PREFIX}/${PKGNAME}/bin/startup.sh
Configuration files are in `${SYSCONFDIR}/tomcat' (use tomcat.rc
for setting environment variables like JAVA_HOME/JAVA_OPTS/...)
`$CATALINA_BASE' is `/var/tomcat'.
See also ${PREFIX}/${PKGNAME}/README.OpenBSD for information
Please read ${PREFIX}/${DISTNAME}/README.OpenBSD for information
on running Jakarta Tomcat on OpenBSD.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff