<?xml version="1.0" encoding="UTF-8"?>
<!--

    See the NOTICE file distributed with this work for additional
    information regarding copyright ownership.

    This is free software; you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as
    published by the Free Software Foundation; either version 2.1 of
    the License, or (at your option) any later version.

    This software is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this software; if not, write to the Free
    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
    02110-1301 USA, or see the FSF site: http://www.fsf.org.

-->
<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>edu.toronto.cs.savant</groupId>
    <artifactId>savant-distribution</artifactId>
    <version>2.0.5</version>
  </parent>

  <artifactId>savant-rpm</artifactId>
  <packaging>rpm</packaging>
  <name>Savant - RedHat Distribution</name>
  <description>Distribution containing the Savant Genome Browser and its dependencies as a RedHat (RPM) package.</description>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>savant-core</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>savant-plugin-data</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>savant-plugin-sql</artifactId>
      <version>${project.version}</version>
      <classifier>jar-with-dependencies</classifier>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>savant-plugin-ucscexplorer</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>savant-plugin-ucsc</artifactId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>rpm-maven-plugin</artifactId>
        <version>2.1-alpha-3</version>
        <extensions>true</extensions>
        <configuration>
          <name>savant-genome-browser</name>
          <summary>Savant Genome Browser</summary>
          <description>Savant is a next-generation genome browser designed for the latest generation of genome data.</description>
          <packager>Computational Biology Lab, University of Toronto (development@medavant.com)</packager>
          <copyright>LGPL 2.1</copyright>
          <group>Applications/Science</group>
          <icon>src/main/resources/savant.gif</icon>
          <prefix>/usr/local</prefix>
          <defaultDirmode>755</defaultDirmode>
          <defaultFilemode>644</defaultFilemode>
          <requires>
            <require>java &gt;= 0:1.6.0</require>
          </requires>
          <mappings>
            <mapping>
              <directory>/usr/bin/</directory>
              <filemode>755</filemode>
              <username>root</username>
              <groupname>root</groupname>
              <sources>
                <source>
                  <location>${project.build.outputDirectory}/savant.sh</location>
                  <destination>savant-${project.version}</destination>
                  <filter>true</filter>
                </source>
              </sources>
            </mapping>
            <mapping>
              <directory>/usr/local/savant-${project.version}/lib</directory>
              <filemode>644</filemode>
              <username>root</username>
              <groupname>root</groupname>
              <dependency>
                <excludes>
                  <exclude>${project.groupId}:savant-core</exclude>
                  <exclude>${project.groupId}:savant-plugin-data</exclude>
                  <exclude>${project.groupId}:savant-plugin-sql</exclude>
                  <exclude>${project.groupId}:savant-plugin-ucsc</exclude>
                  <exclude>${project.groupId}:savant-plugin-ucscexplorer</exclude>
                </excludes>
              </dependency>
            </mapping>
            <mapping>
              <directory>/usr/local/savant-${project.version}/plugins</directory>
              <filemode>644</filemode>
              <username>root</username>
              <groupname>root</groupname>
              <dependency>
                <includes>
                  <include>${project.groupId}:savant-plugin-data</include>
                  <include>${project.groupId}:savant-plugin-sql</include>
                  <include>${project.groupId}:savant-plugin-ucsc</include>
                  <include>${project.groupId}:savant-plugin-ucscexplorer</include>
                </includes>
              </dependency>
            </mapping>
            <mapping>
              <directory>/usr/local/savant-${project.version}</directory>
              <filemode>644</filemode>
              <username>root</username>
              <groupname>root</groupname>
              <dependency>
                <includes>
                  <include>${project.groupId}:savant-core</include>
                </includes>
              </dependency>
            </mapping>
            <mapping>
              <directory>/usr/local/savant-${project.version}</directory>
              <filemode>644</filemode>
              <username>root</username>
              <groupname>root</groupname>
              <sources>
                <source>
                  <location>${project.build.outputDirectory}/savant.png</location>
                </source>
              </sources>
            </mapping>
            <mapping>
              <directory>/usr/bin</directory>
              <filemode>755</filemode>
              <username>root</username>
              <groupname>root</groupname>
              <sources>
                <softlinkSource>
                  <destination>savant</destination>
                  <location>savant-${project.version}</location>
                </softlinkSource>
              </sources>
            </mapping>
            <mapping>
              <directory>/usr/share/applications</directory>
              <filemode>644</filemode>
              <username>root</username>
              <groupname>root</groupname>
              <sources>
                <source>
                  <location>${project.build.outputDirectory}/savant.desktop</location>
                  <destination>savant-${project.version}.desktop</destination>
                  <filter>true</filter>
                </source>
              </sources>
            </mapping>
          </mappings>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
