# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="A fast Servlet 2.4 and JSP 2.0 engine with EJB." HOMEPAGE="http://www.caucho.com" SRC_URI="http://www.caucho.com/download/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="jni" RESTRICT="nostrip" RDEPEND=">=virtual/jdk-1.4 dev-lang/perl" RESIN_HOME="/opt/resin" pkg_preinst() { enewgroup resin enewuser resin -1 -1 /opt/resin resin # when updating from resin 2, move things to there new location if [ ! -L ${RESIN_HOME}/conf ]; then if [ ! -d /etc/resin ]; then mkdir /etc/resin chown resin:resin /etc/resin fi mv ${RESIN_HOME}/conf/ /etc/resin/conf.old fi } src_compile() { epatch ${FILESDIR}/${PV}/resin_gentoo_fix.patch # Disable openssl support in Resin Open Source. # OpenSSL support only by Resin Professional. # If you need ssl support in Resin Open Source use JSSE. econf --prefix=${RESIN_HOME} --disable-ssl $(use_with jni)|| eerror "emake failed" emake || eerror "emake failed" } src_install() { dodir /etc/resin ${RESIN_HOME} /usr/share/${PN}/lib /var/log/${PN} /var/run/${PN} dosym ../../etc/resin ${RESIN_HOME}/conf dosym ../../usr/share/${PN}/lib ${RESIN_HOME}/lib dosym ../../var/log/${PN} ${RESIN_HOME}/logs keepdir /var/log/${PN}/ dosym ../../var/run/${PN} ${RESIN_HOME}/pid keepdir /var/run/${PN}/ emake PREFIX=${D}${RESIN_HOME} install || die # INIT SCRIPTS AND ENV insinto /etc/init.d ; insopts -m0750 ; newins ${FILESDIR}/${PV}/init.d/resin resin insinto /etc/conf.d ; insopts -m0644 ; newins ${FILESDIR}/${PV}/conf.d/resin resin insinto /etc/env.d ; insopts -m0644 ; doins ${FILESDIR}/${PV}/env.d/21resin dodoc README chown -R resin:resin ${D}${RESIN_HOME} chown -R resin:resin ${D}/var/log/${PN} chown -R resin:resin ${D}/var/run/${PN} chown -R resin:resin ${D}/etc/resin } pkg_postinst() { einfo einfo " NOTICE!" einfo " User and group 'resin' have been added." einfo " " einfo " FILE LOCATIONS:" einfo " 1. Resin home directory: ${RESIN_HOME}" einfo " Contains application data, configuration files." einfo " 2. Runtime settings: /etc/conf.d/resin" einfo " Contains CLASSPATH and JAVA_HOME settings." einfo " 3. Logs: /var/log/resin/" einfo " 4. Executables, libraries: /usr/share/resin/" einfo einfo "If you are updating from resin-2* your old configuration files" einfo "have been moved to /etc/resin/conf.old" einfo " " einfo " STARTING AND STOPPING RESIN:" einfo " /etc/init.d/resin start" einfo " /etc/init.d/resin stop" einfo " /etc/init.d/resin restart" einfo einfo einfo " NETWORK CONFIGURATION:" einfo " By default, Resin runs on port 8080. You can change this" einfo " value by editing ${RESIN_HOME}/conf/resin.conf." einfo einfo " To test Resin while it's running, point your web browser to:" einfo " http://localhost:8080/" einfo einfo " Resin cannot run on port 80 as non-root (as of this time)." einfo " The best way to get Resin to respond on port 80 is via port" einfo " forwarding -- by installing a firewall on the machine running" einfo " Resin or the network gateway. Simply redirect port 80 to" einfo " port 8080." einfo einfo " BUGS:" einfo " Please file any bugs at http://bugs.gentoo.org/ or else it" einfo " may not get seen. Thank you." einfo } pkg_postrm() { einfo "You may want to remove the resin user and group" }