<?xml version="1.0" encoding="utf-8"?>
<creole>
    <files>
        <file filelist='ethercalc-bareos' name='/etc/bareos/bareosfichiers.d/ethercalc.conf' source='ethercalc-bareos.conf' rm='True'/>
    </files>

    <containers>
        <container name="web">
            <package>ethercalc-apps</package>            
            <service method="apache" servicelist="ethercalc">ethercalc</service>
            <service servicelist="ethercalc">ethercalc-apps</service>
            <file filelist='ethercalc' name='/etc/cron.d/ethercalc' source='ethercalc.cron' rm='True'/>
            <file filelist="ethercalc" name="/etc/apache2/sites-available/ethercalc" source="ethercalc-apache.conf.tmpl"/>
            <file filelist="ethercalc" name="/etc/pm2/ethercalc.json" source="ethercalc-pm2.json.tmpl"/>
            <file filelist="ethercalc" name="/usr/share/eole/nodejs/ethercalc/settings.json" source="ethercalc-settings.json.tmpl"/>
            <file filelist="ethercalc" name="/usr/share/eole/nodejs/ethercalc/index.html" source="ethercalc-index.html.tmpl"/>
            <file filelist="ethercalc" name="/usr/share/eole/nodejs/ethercalc/start.html" source="ethercalc-start.html.tmpl"/>

        </container>
    </containers>
    <variables>
        <family name="applications web">
            <variable name="activer_ethercalc" type="oui/non" description="Activer Ethercalc (Tableur en ligne colaboratif)">
                <value>oui</value>
            </variable>
            <variable name="ethercalc_port" type="string" description="Port d'écoute d'ethercalc">
                <value>9002</value>
            </variable>
        </family>
    </variables>
    <constraints>
        <condition name="hidden_if_in" source="activer_ethercalc">
            <param>non</param>
            <target type="filelist">ethercalc</target>
            <target type='filelist'>ethercalc-bareos</target>
            <target type="servicelist">ethercalc</target>
            <target type="variable">ethercalc_port</target>
        </condition>

        <condition name='hidden_if_in' source='activer_bareos_dir' fallback='True'>
            <param>non</param>
            <target type='filelist'>ethercalc-bareos</target>
		</condition>        
    </constraints>
</creole>
