<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
	License: CDDL 1.0   (see http://opensource.org/licenses/cddl-1.0)
	Copyright 2015 Jens Elkner

	NOTE: This service manifest is not editable; its contents will
	be overwritten by package or patch operations, including
	operating system upgrade. Make customizations in a different file.
-->

<!--
	We have choosen not to create an instance for each version, which would
	be technically smarter but would burden us with higher complexity wrt.
	deps to this service manifest, add. package ... So lets keep it small and
	simple (and make it easy for the admin to auto update possibly other
	package conf directories: just create an instance of this and set the
	config/pkg_db property value accordingly).
-->
<service_bundle type='manifest' name='LNFghc:pkg-cache-76'>

<service name='application/ghc-pkg-cache-76' type='service' version='1'>

	<create_default_instance enabled='true'/>

	<!-- such big things get usually installed only once on the network. So -->
	<dependency name='autofs' grouping='optional_all' restart_on='error'
		type='service'>
		<service_fmri value='svc:/system/filesystem/autofs:default' />
	</dependency>
	<!-- since it depends on svc:/system/filesystem/local , that's it -->

	<exec_method name='start' type='method' timeout_seconds='120'
		exec='/lib/svc/method/ghc-pkg-cache-7.6 start' />
	<exec_method name='refresh' type='method' timeout_seconds='60'
		exec='/lib/svc/method/ghc-pkg-cache-7.6 refresh' />
	<exec_method name='stop' type='method' timeout_seconds='60' exec=':true' />

	<property_group name='startd' type='framework'>
		<propval name='duration' type='astring' value='transient' />
	</property_group>
	<property_group name='general' type='framework'>
		<propval name='action_authorization' type='astring'
			value='solaris.smf.manage.ghc' />
	</property_group>

	<property_group name='config' type='application'>
		<!-- The directory which contains the package *.conf files as well as
			the package cache db file, which needs an updated. If empty, ghc's
			default package-db directory will be used. -->
		<propval name='pkg_db' type='astring' value='' />
		<propval name='value_authorization' type='astring'
			value='solaris.smf.value.ghc' />
	</property_group>

	<stability value='Evolving' />

	<template>
		<common_name>
			<loctext xml:lang='C'>
			Update the GHC package cache
			</loctext>
		</common_name>
		<documentation>
			<doc_link name='GHC User Guide'
			    uri='https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/packages.html#package-management' />
		</documentation>
	</template>
</service>

</service_bundle>
