<?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>org.dogtagpki</groupId>
        <artifactId>jss-parent</artifactId>
        <version>${revision}</version>
    </parent>

    <artifactId>jss-native</artifactId>
    <packaging>so</packaging>

    <dependencies>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jss</artifactId>
            <version>${project.version}</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>native-maven-plugin</artifactId>
                <version>1.0-alpha-11</version>
                <extensions>true</extensions>
                <configuration>
                    <compilerProvider>generic-classic</compilerProvider>
                    <compilerExecutable>gcc</compilerExecutable>
                    <sources>
                        <source>
                            <directory>${basedir}/src/main/native</directory>
                            <includes>
                                <include>**/*.c</include>
                            </includes>
                        </source>
                    </sources>
                    <compilerStartOptions>
                        <compilerStartOption>-shared -Wl,-z,defs -Wl,-soname -Wl,libjss.so -I/usr/include/nspr -I/usr/include/nspr4 -I/usr/include/nss -I/usr/include/nss3 -fPIC</compilerStartOption>
                        <compilerStartOption>-I${JAVA_HOME}/include</compilerStartOption>
                        <compilerStartOption>-I${JAVA_HOME}/include/linux</compilerStartOption>
                        <compilerStartOption>-I${basedir}/src/main/native/org/mozilla/jss</compilerStartOption>
                        <compilerStartOption>-I${basedir}/src/main/native/org/mozilla/jss/crypto</compilerStartOption>
                        <compilerStartOption>-I${basedir}/src/main/native/org/mozilla/jss/nss</compilerStartOption>
                        <compilerStartOption>-I${basedir}/src/main/native/org/mozilla/jss/pkcs11</compilerStartOption>
                        <compilerStartOption>-I${basedir}/src/main/native/org/mozilla/jss/pkcs11/attrs</compilerStartOption>
                        <compilerStartOption>-I${basedir}/src/main/native/org/mozilla/jss/ssl</compilerStartOption>
                        <compilerStartOption>-I${basedir}/src/main/native/org/mozilla/jss/ssl/javax</compilerStartOption>
                        <compilerStartOption>-I${basedir}/src/main/native/org/mozilla/jss/util</compilerStartOption>
                        <compilerStartOption>-I${basedir}/../base/target/include</compilerStartOption>
                    </compilerStartOptions>
                    <linkerStartOptions>
                        <linkerStartOption>-lsmime3 -lssl3 -lnss3 -lnssutil3 -lplc4 -lplds4 -lnspr4 -lpthread -ldl -shared -fPIC</linkerStartOption>
                    </linkerStartOptions>
                    <linkerFinalName>libjss</linkerFinalName>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
