about summary refs log tree commit diff
path: root/pkgs/development/libraries/dbus/make-system-conf.xsl
blob: dd644b4bce7c5c987f7aa4a340e020307672f961 (plain) (blame)
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
<?xml version="1.0"?>

<!--
  This script copies the original system.conf from the dbus
  distribution, but sets paths from $serviceDirectories parameter
  and suid helper from $suidHelper parameter.
-->

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:str="http://exslt.org/strings"
                extension-element-prefixes="str"
                >

  <xsl:output method='xml' encoding="UTF-8" doctype-system="busconfig.dtd" />

  <xsl:param name="serviceDirectories" />
  <xsl:param name="suidHelper" />

  <xsl:template match="/busconfig">
    <busconfig>
      <xsl:copy-of select="child::node()[name() != 'include' and name() != 'standard_system_servicedirs' and name() != 'servicehelper' and name() != 'servicedir' and name() != 'includedir']" />

      <!-- set suid helper -->
      <servicehelper><xsl:value-of select="$suidHelper" /></servicehelper>

      <xsl:for-each select="str:tokenize($serviceDirectories)">
        <servicedir><xsl:value-of select="." />/share/dbus-1/system-services</servicedir>
        <includedir><xsl:value-of select="." />/etc/dbus-1/system.d</includedir>
        <includedir><xsl:value-of select="." />/share/dbus-1/system.d</includedir>
      </xsl:for-each>
    </busconfig>
  </xsl:template>

</xsl:stylesheet>