<?xml version="1.0" encoding="UTF-8"?>
<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>com.rackspace.repose.installation.rpm</groupId>
        <artifactId>rpm</artifactId>
        <version>2.1.4</version>
    </parent>

    <groupId>com.rackspace.repose.installation.rpm.cli-utils</groupId>
    <artifactId>cli-utils</artifactId>
    <version>2.1.4</version>

    <name>Repose - Installation Cloud Integration CLI-Utils RPM</name>

    <description>
        Module for the CLI-Utils RPM.
    </description>

    <packaging>pom</packaging>

    <profiles>
        <profile>
            <id>build-system-packages</id>

            <activation>
                <property>
                    <name>Build CLI-Utils RPM</name>
                </property>
            </activation>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>rpm-maven-plugin</artifactId>

                        <configuration>

                            <name>cli-utils</name>

                            <mappings>
                                <mapping>
                                    <directory>/usr/share/lib/repose</directory>
                                    <username>root</username>
                                    <groupname>root</groupname>
                                    <filemode>755</filemode>

                                    <sources>
                                        <source>
                                            <location>
                                                ${basedir}/../../../components/cli-utils/target/repose-cli.jar
                                            </location>
                                        </source>
                                    </sources>
                                </mapping>

                                <mapping>
                                    <directory>/etc/repose/</directory>
                                    <username>tomcat</username>
                                    <groupname>tomcat</groupname>
                                    <filemode>755</filemode>

                                    <sources>
                                        <source>
                                            <location>
                                                ${basedir}/../../bash/dd-remove
                                            </location>
                                        </source>
                                    </sources>
                                </mapping>

                                <mapping>
                                    <directory>/usr/bin</directory>
                                    <username>tomcat</username>
                                    <groupname>tomcat</groupname>
                                    <filemode>755</filemode>

                                    <sources>
                                        <source>
                                            <location>
                                                ${basedir}/../../bash/clean-repose-deploy
                                            </location>
                                        </source>
                                    </sources>
                                </mapping>

                            </mappings>

                            <requires>
                                <require>java-1.6.0-openjdk</require>
                            </requires>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
