summaryrefslogtreecommitdiff
blob: 57dd00b72bace16d4444819f276037556f4020f9 (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-servers/orion/orion-2.0.5.ebuild,v 1.3 2005/03/16 13:55:30 luckyduck Exp $

inherit eutils java-pkg

S=${WORKDIR}/${PN}

At=${PN}${PV}.zip

DESCRIPTION="Orion EJB/J2EE application webserver"
SRC_URI="http://www.orionserver.com/distributions/${At}"
HOMEPAGE="http://www.orionserver.com/"
KEYWORDS="~x86 ~ppc ~sparc ~amd64"
LICENSE="ORIONSERVER"
SLOT="0"
DEPEND=">=virtual/jdk-1.3
	app-arch/unzip"
IUSE=""

src_unpack() {
	unpack ${A}
	cd ${S}
	epatch ${FILESDIR}/${PV}/${PV}-gentoo.patch
}

pkg_preinst() {
	enewgroup orion
	enewuser orion -1 /bin/bash /opt/orion orion
}

src_install() {
	# CREATE DIRECTORIES
	diropts -m0755
	dodir /opt/${PN}
	dodir /opt/${PN}/config
	dodir /opt/${PN}/sbin
	dodir /var/log/${PN}

	cd ${S}

	# INSTALL STARTUP SCRIPTS
	insinto /opt/orion/sbin
	insopts -m0750
	doins ${FILESDIR}/${PV}/start_orion.sh
	doins ${FILESDIR}/${PV}/stop_orion.sh

	cp -a ${FILESDIR}/${PV}/orion.init ${S}/orion
	insinto /etc/init.d
	insopts -m0750
	doins ${S}/orion

	cp -a ${FILESDIR}/${PV}/orion.conf ${S}/orion
	insinto /etc/conf.d
	insopts -m0750
	doins ${S}/orion

	# CREATE DUMMY LOG & PERSISTENCE DIR
	dodir /var/log/${PN}
	dodir /opt/${PN}/persistence

	keepdir /var/log/${PN}
	keepdir /opt/${PN}/persistence

	# INSTALL EXTRA FILES
	local dirs="applications default-web-app demo lib persistence autoupdate.properties"
	for i in $dirs ; do
		cp -a ${i} ${D}/opt/${PN}/
	done

	# INSTALL APP CONFIG
	cd ${S}/config
	local dirs="application.xml data-sources.xml database-schemas default-web-site.xml global-web-application.xml jms.xml mime.types principals.xml rmi.xml server.xml"
	for i in $dirs ; do
		cp -a ${i} ${D}/opt/${PN}/config
	done

	# INSTALL JARS
	cd ${S}
	for i in `ls *.jar` ; do
		java-pkg_dojar $i
	done

	# LINK IN SDK TOOLS.JAR
	dosym ${JAVA_HOME}/lib/tools.jar /usr/share/${PN}/lib/tools.jar

	# INSTALL DOCS
	dodoc Readme.txt changes.txt
}

pkg_postinst() {

	chown -R orion:orion /opt/${PN} || die "Failed to chown in /opt"
	chown -R orion:orion /var/log/${PN} || die "Failed to chown in /var/log"
	chown root:root /etc/conf.d/orion

	einfo " "
	einfo " NOTICE!"
	einfo " User and group 'orion' have been added."
	einfo " Please set a password for the user account 'orion'"
	einfo " if you have not done so already."
	einfo " "
	einfo " "
	einfo " FILE LOCATIONS:"
	einfo " 1.  Orion home directory: /opt/orion"
	einfo "     Contains application data, configuration files."
	einfo " 2.  Runtime settings: /etc/conf.d/orion"
	einfo "     Contains CLASSPATH and JDK settings."
	einfo " 3.  Logs:  /var/log/orion/"
	einfo " 4.  Executables, libraries:  /usr/share/${PN}/"
	einfo " "
	einfo " "
	einfo " STARTING AND STOPPING ORION:"
	einfo "   /etc/init.d/orion start"
	einfo "   /etc/init.d/orion stop"
	einfo "   /etc/init.d/orion restart"
	einfo " "
	einfo " "
	einfo " NETWORK CONFIGURATION:"
	einfo " By default, Orion runs on port 8080.  You can change this"
	einfo " value by editing /opt/orion/config/default-web-site.xml."
	einfo " "
	einfo " To test Orion while it's running, point your web browser to:"
	einfo " http://localhost:8080/"
	einfo " "
	einfo " "
	einfo " APPLICATION DEPLOYMENT:"
	einfo " To set an administrative password, execute the following"
	einfo " commands as user 'orion':"
	einfo " \$ java -jar /usr/share/${PN}/lib/orion.jar -install"
	einfo " "
	einfo " "
	einfo " BUGS:"
	einfo " Please file any bugs at http://bugs.gentoo.org/ or else it"
	einfo " may not get seen.  Thank you."
	einfo " "
}