Enterprise Configurator

Epconf helps to configure software components that are commonly used in an enterprise environment (e.g. at companies).

Supported devices:
 * N900 (Fremantle)

It supports the installation and modification of:
 * Browser bookmark thumbnail images: thumbnail_* files.
 * Wifi root certificates:  files are used when authenticating via WLAN.
 * GConf schemas:  files are registered with GConf.
 * VCard files:  files are added to the contact list.
 * Custom actions: Custom configuration can be done with epconftool in-files.

The above mentioned input files are taken from the directory.

With epconf in-files you can configure:
 * Arbitrary XML files
 * GConf values
 * Anything with script files

If an epconf in-file file matches  then the operations described by it will be executed as the user. For more information about in-files, please refer to epconftool. See here for more details about epconftool in-files.

Command line syntax
usage: epconf [debug] macro file_name ACTION SET[:GROUP[:ELEMENT]]...    debug            Enables debug output. macro           Uses the specified macro file instead of the default one. ACTION          May be either install or uninstall. SET             Name of the configuration set to process. It may be "all" which means "Process all the available set". "all" cannot be mixed with other sets! GROUP           Can be one of                          thumbnail: Process thumbnail_* thumbnails crt: Process *.crt certificates vcard: Process *.vcard vCards. schemas: Process *.schemas GConf schemas epin: Process *.epin epconftool in-files If it is not given then all the groups are processed. ELEMENT         This can be used only with epin group. Only the infile with the given name willbe processed.

The following example pulls the input files from :

epconf macro /home/user/macro.xml install my_set

The following example processes
 * from  then
 * from  and finally
 * all supported files from :

epconf install my_set:epin:best_in your_set:vcard their_set

= epconftool =

Epconftool processes in-files that can be used for the creation of sophisticated configuration scripts.

Command line syntax
usage: epconftool [-f] [-s] [-d] { -x | -l } macro-file { -i | -u } in-files...  -i    Install using the given input files. -u   Uninstall using the given input files. -x   Macro file in XML format -l   Macro file in plain key-value format -f   Force. If the process fails at one input file it goes on to the next one. Without this option (default), a bad input file stops the entire process and the subsequent input files are not processed. -s   Do simple macro substitution (a macro in a macro is not processed). -d   Print debug output to stderr. Either -i or -u can be used. They cannot be mixed.

Built-in macros:
 * : The seconds elapsed since 1970.01.01 (see 'man 2 time').
 * : Absolute path of the directory containing the in-file being processed.
 * : This may be used e.g. in XML in-files. If a node_path node contains this as a text field anywhere in its subtree, then that node is removed during un-installation. Otherwise it is not removed!

Macro file
The MACRO file contains usernames, passwords, etc. Each value in this file has a key associated with it. E.g., the WLAN_username key may have the value Jack. The keys of the MACRO file can be used in in-files as. E.g.,.

Two kinds of macro files are supported:
 * XML
 * Key-value list

XML
Let's take the following as an example:

  Joe Buck  joebuck   ext-joe.4.buck 98765876    joejoe</LOGIN> buckybuck</PASS> </RESTAURANT> </WLAN> <EMAIL> <ADDRESS>ext-joe.4.buck@company.org</ADDRESS> </EMAIL> </CONF>

When using the above example macro file, the macro values are the text nodes and the macro names are formed formed the tag names. For example, the macro refers to the value.

Key-value list
Let's take the following as an example: "CONF_NAME" "Joe Buck" "CONF_REMOTE_ACCESS_LOGIN" "joebuck" "CONF_SIP_NAME" "ext-joe.4.buck" "CONF_SIP_PASS" "98765876" "CONF_WLAN_RESTAURANT_LOGIN" "joejoe" "CONF_WLAN_RESTAURANT_PASS" "buckybuck" "CONF_EMAIL_ADDRESS" "ext-joe.4.buck@company.org"

When using the above example macro file, the macro refers to the value "joebuck".

If the " (double quote) character appears in a key or a value, then it must be escaped. For example, "Norton said \"Howdy!\" and then he left.". Same for the \ (backslash) character. For example, "\\" represents a single backslash character.

Input Template file (in-file)
In-files have the following general format:

[CONTROL] type:gconf|xml|shell ... [DATA] ... ...%MACRO%... ...
 * 1) Comment

The following lines are ignored:
 * empty lines: lines with only whitespace or newline
 * comments: lines whose first non-whitespace character is hash-mark ("#")

The tag (e.g., "type") and its value (e.g., "xml") in the  section are separated by a single colon character. The "type" tag is mandatory, and it must be the first non-ignored line in the section.

Every  macro is replaced with the matching value from the file during the installation/un-installation process. Macro substitution is applied to the entire in-file (e.g. if the value of  is "Hello Hippo" then   is replaced with ).

No recursive macro substitution is done. For example, if macro  has the value  then the   is not considered as a macro for substitution.

gconf
This in-file is used to add/remove gconf values. See [2] for an example!

Syntax: [CONTROL] type:gconf [DATA] dir:/path/to/gconf/directory behavior:type:key_name:value behavior:type-list:key_name:[value,value,...] ...

The  tag tells that it's a gconf in-file. The first line in the DATA section is the gconf directory that we want to configure. Subsequent lines describe key/value pairs for gconf keys, whitespaces are not allowed. Value lists are also supported. In this case, the type name is suffixed with the  word and the value is a comma separated list enclosed in brackets. The behavior can be one of the following:
 * : If the key already exists, it is replaced.
 * : Only for value lists. If the key already exists, it is merged with the specified one.
 * : If the key already exists, it is not changed.

Installation:
 * In the  section, all the   tags are replaced with the proper values.
 * If the gconf directory  does not exist, it is created and populated with the provided key/value pairs.
 * If the gconf directory  exists:
 * If a provided key does not exist, it is created and its value is set.
 * If a provided key exists, the action taken depends on the specified behavior.

Uninstallation:
 * Simple values: The key is deleted.
 * List values: If behavior is  only the values given in the in-file are removed from the list. For other behaviors, the entire key is deleted.
 * If after removing the keys, the entire  directory is deleted from gconf if it has become empty.

xml
This in-file is used to add/remove xml nodes in xml files, such as bookmarks and Pidgin accounts.

Syntax:

[CONTROL] type:xml target:/path/to/the/xml/file/that/we/want/to/modify/or/create.xml node_path:/xml/path/to/a/node node_id_path:/xml/path/to/the/id/node /xml/path/to/another/id/node remove_by:id|marker if_exists:replace|keepold [DATA] A complete XML document...


 * : Tells that it's an xml in-file.
 * : The file system path of the final output. If the file exists, it is also used as input.
 * : It is an XML-path that defines the nodes in the in-file  section that will be added to the target file.
 * : It is a spaces and/or tabs separated list of XML-paths. These paths are combined and used as the primary-key to identify duplicate/existing entries.
 * : Optional. Default is . Defines the behavior for installation. When set to , existing nodes are replaced with the ones in the   section. When set to  , existing nodes are left intact.
 * : Optional. Default is . Defines the behavior for uninstallation. When set to , nodes that match the   are removed. When set to  , nodes that contain the   value in any of their (or children) attributes or children nodes, are removed.

All XML-paths use the X-Path syntax, see http://www.w3schools.com/XPath/default.asp, http://www.w3.org/TR/xpath20/, http://xmlsoft.org/html/libxml-xpath.html.

The  section contains a complete XML document.

Installation:
 * In the  section, all the   tags are replaced with the proper values.
 * If the target file does not exist, it is created with the output of the previous steps, which is the processed  section (the un-macroed   section).
 * If the target file exists:
 * Based on the  and , nodes from the processed   section are added to the target file. If a node already exists (based on  ), the node is not added.

Uninstallation:
 * If  is  : Delete every node (based on  ), from the target file that has a text element anywhere in it with the   macro. Therefore, you MUST add the   macro somewhere in the nodes that you want to be removed later.
 * If  is  : Delete every node (based on  ), from the target file that has the same id value (based on  ) as the XML in the   section.

shell
Shell in-files are a flexible way to create custom configurator scripts.

Syntax:

[CONTROL] type:shell [DATA] install: commands commands commands ... uninstall: commands commands commands ...

The  section consists of and   and an   subsection. The command lines below the subsections constitute the content of the script. A script file is created with that content and is executed. So basically, you can write, e.g., shell scripts, perl and python scripts, etc.. Command lines cannot start with  or  !