.sopm Reference

Reference of all important .sopm elements for OTOBO, Znuny, and OTRS CE: name, version, framework, filelist, dependencies, and install sections.

.sopm Reference

The .sopm (Source OPM) is the XML source file of a package. The .opm file is generated from it during the build process. This reference describes the most common elements.

Root Element

ForkRoot ElementExample
OTOBOotobo_package<otobo_package version="1.1">
Znuny / OTRS CEotrs_package<otrs_package version="1.0">

The content is otherwise identical, which is why a package is usually portable across forks.

Required Elements

xml
<Name>MyPackage</Name>                 <!-- CamelCase, no spaces -->
<Version>1.0.0</Version>               <!-- major.minor.patch -->
<Framework>11.0.x</Framework>          <!-- at least one, format major.minor.x -->
<Vendor>Example GmbH</Vendor>
<License>GPL-3.0</License>
<Description Lang="en">...</Description>

<Framework>

Declares the compatible framework version lines. Multiple lines are allowed and act as the key to cross-fork compatibility:

xml
<Framework Minimum="11.0.9">11.0.x</Framework>
<Framework>7.0.x</Framework>

The optional Minimum attribute enforces a minimum patch version. Read more in the Compatibility Guide.

<Filelist>

Lists all files included in the package with their path and Unix permissions:

xml
<Filelist>
    <File Permission="660" Location="Kernel/Config/Files/XML/MyPackage.xml" />
    <File Permission="644" Location="var/httpd/htdocs/js/MyPackage.js" />
</Filelist>

Dependencies

xml
<PackageRequired Version="11.0.1">ITSMCore</PackageRequired>
<ModuleRequired Version="3.0">JSON::XS</ModuleRequired>
  • PackageRequired — another .opm package must be installed.
  • ModuleRequired — a Perl module (CPAN) must be available.

Install / Upgrade Sections

xml
<DatabaseInstall Type="post">
    <TableCreate Name="my_table">
        <Column Name="id" Required="true" PrimaryKey="true" AutoIncrement="true" Type="INTEGER" />
        <Column Name="name" Required="true" Size="200" Type="VARCHAR" />
    </TableCreate>
</DatabaseInstall>

<CodeInstall Type="post"><![CDATA[
    $Kernel::OM->Get('Kernel::System::MyModule')->Setup();
]]></CodeInstall>

Counterparts: DatabaseUninstall, CodeUninstall, DatabaseUpgrade, CodeUpgrade. The Type controls the timing (pre/post).

Tools