<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <artifactId>device-httpd</artifactId>
    <groupId>zone.device.platform</groupId>
    <version>0.9.30-SNAPSHOT</version>
  </parent>

  <properties>
    <release.distribution>el9</release.distribution>
    <release.instance>device</release.instance>
    <jdk.version>1.8</jdk.version>
    <release.cacert>/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem</release.cacert>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>

  <artifactId>device-httpd-remote</artifactId>
  <groupId>zone.device.platform.el9</groupId>
  <version>0.9.30-SNAPSHOT</version>
  <packaging>rpm</packaging>
  <name>device httpd remote applicance for el9</name>
  <description>Packaging for the httpd remote server appliance for ${release.distribution}</description>
  <inceptionYear>2023</inceptionYear>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>preremove</include>
          <include>postinstall</include>
        </includes>
      </resource>
      <resource>
        <targetPath>usr</targetPath>
        <directory>src/main/resources/usr</directory>
        <filtering>true</filtering>
        <includes>
          <include>**/*</include>
        </includes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>3.1.0</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <escapeString>\</escapeString>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.12.0</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.2</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>rpm-maven-plugin</artifactId>
        <version>2.2.0</version>
        <extensions>true</extensions>
        <configuration>
          <copyright>Graham Leggett</copyright>
          <distribution>${release.distribution}</distribution>
          <group>System Environment/Base</group>
          <packager>http://device.zone</packager>
          <prefix>/usr</prefix>
          <version>${project.version}</version>
          <keyname>platform@device.zone</keyname>
          <defineStatements>
            <defineStatement>_unpackaged_files_terminate_build 0</defineStatement>
          </defineStatements>
          <mappings>
            <mapping>
              <directory>/usr/libexec/device-autodiscovery/httpd.d</directory>
              <directoryIncluded>false</directoryIncluded>
              <filemode>755</filemode>
              <username>root</username>
              <groupname>root</groupname>
              <sources>
                <source>
                  <location>target/classes/usr/libexec/device-httpd-autodiscovery-remote</location>
                  <destination>40-remote</destination>
                </source>
              </sources>
            </mapping>
            <mapping>
              <directory>/etc/device/services/www/remote</directory>
              <directoryIncluded>true</directoryIncluded>
              <filemode>2775</filemode>
              <username>root</username>
              <groupname>device</groupname>
            </mapping>
            <mapping>
              <directory>/usr/libexec/device/services/www/remote</directory>
              <directoryIncluded>true</directoryIncluded>
              <filemode>755</filemode>
              <username>root</username>
              <groupname>root</groupname>
            </mapping>
            <mapping>
              <directory>/usr/libexec/device/services/www/remote</directory>
              <directoryIncluded>false</directoryIncluded>
              <filemode>755</filemode>
              <username>root</username>
              <groupname>root</groupname>
              <sources>
                <source>
                  <location>target/classes/usr/libexec/device/services/www/remote/add</location>
                </source>
                <source>
                  <location>target/classes/usr/libexec/device/services/www/remote/remove</location>
                </source>
                <source>
                  <location>target/classes/usr/libexec/device/services/www/remote/set</location>
                </source>
                <source>
                  <location>target/classes/usr/libexec/device/services/www/remote/show</location>
                </source>
              </sources>
            </mapping>
          </mappings>
          <requires>
            <require>device</require>
            <require>redwax-tool &gt;= 0.9.7</require>
          </requires>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>

