<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">

<!--

 Copyright 2008 filibeto.org, Stoyan Angelov (s_angelov@filibeto.org)
 All rights reserved.
 
 Use is subject to license terms.

 CDDL HEADER START

 The contents of this file are subject to the terms of the
 Common Development and Distribution License, Version 1.0 only
 (the "License").  You may not use this file except in compliance
 with the License.

 You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 or http://www.opensolaris.org/os/licensing.
 See the License for the specific language governing permissions
 and limitations under the License.

 When distributing Covered Code, include this CDDL HEADER in each
 file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 If applicable, add the following below this CDDL HEADER, with the
 fields enclosed by brackets "[]" replaced with your own identifying
 information: Portions Copyright [yyyy] [name of copyright owner]

 CDDL HEADER END

-->

<service_bundle type='manifest' name='pootle'>

<service
	name='network/pootle'
	type='service'
	version='1'>

	<create_default_instance enabled='false' />

	<single_instance />
	
	<!-- 
	    specify the location of the pootle.prefs configuration file.
	    /opt/pootle can be a symlink to whatever your
	    ...lib/python2.x/site-packages/Pootle directory is located.
	-->

	<dependency
		name='config_data'
		grouping='require_all'
		restart_on='restart'
		type='path'>
		<service_fmri value='file:///opt/pootle/pootle.prefs' />
	</dependency>

	<dependency
		name='net-loopback'
		grouping='require_all'
		restart_on='none'
		type='service'>
		<service_fmri value='svc:/network/loopback' />
	</dependency>
	
	<dependency
		name='net-physical'
		grouping='require_all'
		restart_on='none'
		type='service'>
		<service_fmri value='svc:/network/physical' />
	</dependency>
	
	<dependency
		name='fs-local'
		grouping='require_all'
		restart_on='none'
		type='service'>
		<service_fmri value='svc:/system/filesystem/local' />
	</dependency>

	<method_context> 
		<method_credential
			user='pootle'
			group='pootle' /> 
	</method_context>

	<exec_method
		name='start'
		type='method'
		exec='/lib/svc/method/pootle %m'
		timeout_seconds='60' />

	<exec_method
		name='stop'
		type='method'
		exec=':kill'
		timeout_seconds='60' />

	<property_group
		name='startd'
		type='framework'>
		<propval
			name='ignore_error'
			type='astring'
			value='core,signal' />
	</property_group>

	<property_group
		name='general'
		type='framework'>
		<propval
			name='action_authorization'
			type='astring'
			value='solaris.smf.manage.pootle' />
		<propval
			name='value_authorization'
			type='astring'
			value='solaris.smf.manage.pootle' />
	</property_group>
	
	<property_group
		name='pootle'
		type='application'>
		<propval
			name='bin'
			type='astring'
			value='/opt/csw/bin' />
		<propval
			name='port'
			type='astring'
			value='7320' />	
		<propval
			name='logdir'
			type='astring'
			value='/opt/pootle/logs' />
		<propval
			name='logfile'
			type='astring'
			value='pootle.log' />
	</property_group>

	<stability value='Unstable' />

	<template>
		<common_name>
			<loctext xml:lang='C'>
			Pootle - a web portal for translation
			</loctext>
		</common_name>

		<documentation>
                        <doc_link name='Pootle page'
				uri='http://www.wordforge.org/drupal/projects/wordforge/tools/pootle' />
                        <doc_link name='Pootle documentation'
				uri='http://translate.sourceforge.net/wiki/pootle/index' />
                </documentation>
	</template>

</service>

</service_bundle>

