Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Jan 2014 17:03:57 +0000 (UTC)
From:      Jason Helfman <jgh@FreeBSD.org>
To:        doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org
Subject:   svn commit: r43639 - head/en_US.ISO8859-1/books/porters-handbook
Message-ID:  <201401241703.s0OH3vmB031602@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jgh
Date: Fri Jan 24 17:03:57 2014
New Revision: 43639
URL: http://svnweb.freebsd.org/changeset/doc/43639

Log:
  - document proper handling of .war file in porters handbook
  
  Approved by:	wblock (mentor)
  Reviewed by:	bcr, remko (mentors)

Modified:
  head/en_US.ISO8859-1/books/porters-handbook/book.xml

Modified: head/en_US.ISO8859-1/books/porters-handbook/book.xml
==============================================================================
--- head/en_US.ISO8859-1/books/porters-handbook/book.xml	Fri Jan 24 08:04:00 2014	(r43638)
+++ head/en_US.ISO8859-1/books/porters-handbook/book.xml	Fri Jan 24 17:03:57 2014	(r43639)
@@ -7547,6 +7547,33 @@ USE_QT4=	moc_build qmake_build rcc_build
 	  already installed ones (from
 	  <filename>${JAVAJARDIR}</filename>).</para>
 
+	<para>When porting a &java; application that requires an
+	  application server such as
+	  <package role="port">www/tomcat7</package> to run the
+	  service, it is quite common for a vendor to distribute a
+	  <filename>.war</filename> file.  A <filename>.war</filename>
+	  file is a Web application ARchive and is extracted when called
+	  by the application.  Avoid adding a <filename>.war</filename>
+	  file to the <filename>pkg-plist</filename>.
+	  It is not considered best practice.  An application server
+	  will expand the <filename>war</filename> archive, but not
+	  clean it up properly if the port is removed.  A more
+	  desirable way of working with this file is to extract the
+	  archive, then install the files, and lastly add these files
+	  to <filename>pkg-plist</filename>.</para>
+
+	<programlisting>TOMCATDIR=	${LOCALBASE}/apache-tomcat-7.0
+WEBAPPDIR=	myapplication
+
+post-extract:
+	@${MKDIR} ${WRKDIR}/${PORTDIRNAME}
+	@${TAR} xf ${WRKDIR}/myapplication.war -C ${WRKDIR}/${PORTDIRNAME}
+
+do-install:
+	cd ${WRKDIR} &amp;&amp; \
+	${INSTALL} -d -o ${WWWOWN} -g ${WWWGRP} ${TOMCATDIR}/webapps/${PORTDIRNAME}
+	@cd ${WRKDIR}/${PORTDIRNAME} &amp;&amp; ${COPYTREE_SHARE} \* ${WEBAPPDIR}/${PORTDIRNAME}</programlisting>
+
 	<para>Regardless of the type of your port (library or
 	  application), the additional documentation should be
 	  installed in the



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401241703.s0OH3vmB031602>