blob: f643afcecba98ddd7e1abd9717efcea3542bbedc [file] [log] [blame]
<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.eclipse.scada.deploy</groupId>
<artifactId>org.eclipse.scada.deploy.packages.common</artifactId>
<version>0.3.0</version>
<relativePath>../../common</relativePath>
</parent>
<groupId>org.eclipse.scada.deploy</groupId>
<artifactId>org.eclipse.scada-common</artifactId>
<packaging>pom</packaging>
<description>
Eclipse NeoSCADA base package
</description>
<properties>
<srcBase>${basedir}/../../src</srcBase>
</properties>
<profiles>
<profile>
<!--rpm must be a profile since it requires 'rpmbuild' on the target machine -->
<id>rpm</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<configuration>
<name>org.eclipse.scada</name>
<copyright>EPL</copyright>
<distribution>Eclipse NeoSCADA %{version} (Incubation)</distribution>
<group>System Environment/Base</group>
<changelogFile>../rpm/changelog</changelogFile>
<defaultUsername>root</defaultUsername>
<defaultGroupname>root</defaultGroupname>
</configuration>
<executions>
<execution>
<id>generate-rpm</id>
<goals>
<goal>rpm</goal>
</goals>
<phase>compile</phase>
<configuration>
<requires>
<require>org.eclipse.scada-distribution</require>
<require>rsync</require>
</requires>
<conflicts>
<conflict>org.openscada</conflict>
</conflicts>
<mappings>
<mapping>
<directory>/etc/profile.d</directory>
<directoryIncluded>false</directoryIncluded>
<configuration>true</configuration>
<username>root</username>
<groupname>root</groupname>
<filemode>0755</filemode>
<sources>
<source>
<location>${srcBase}/default/eclipsescada.sh</location>
</source>
</sources>
</mapping>
<mapping>
<directory>/usr/jar</directory>
<filemode>0755</filemode>
</mapping>
<mapping>
<directory>/etc/eclipsescada</directory>
<filemode>0755</filemode>
</mapping>
<mapping>
<directory>/etc/eclipsescada/schema</directory>
<filemode>0755</filemode>
</mapping>
<mapping>
<directory>/usr/share/eclipsescada</directory>
<filemode>0755</filemode>
</mapping>
<mapping>
<directory>/usr/share/eclipsescada/sql</directory>
<filemode>0755</filemode>
</mapping>
<mapping>
<directory>/var/log/eclipsescada</directory>
<username>root</username>
<groupname>eclipsescada</groupname>
<filemode>0775</filemode>
</mapping>
<mapping>
<directory>/var/run/eclipsescada</directory>
<username>root</username>
<groupname>eclipsescada</groupname>
<filemode>0775</filemode>
</mapping>
<mapping>
<directory>/usr/bin</directory>
<directoryIncluded>false</directoryIncluded>
<username>root</username>
<groupname>root</groupname>
<filemode>0755</filemode>
<sources>
<source>
<location>${srcBase}/bin</location>
<includes>
<include>es*</include>
</includes>
</source>
<source>
<location>${srcBase}/bin/hds-replicate-once</location>
</source>
</sources>
</mapping>
<mapping>
<directory>/usr/share/eclipsescada</directory>
<directoryIncluded>false</directoryIncluded>
<username>root</username>
<groupname>root</groupname>
<filemode>0755</filemode>
<sources>
<source>
<location>${srcBase}/share</location>
</source>
</sources>
</mapping>
</mappings>
<preinstallScriptlet>
<script><![CDATA[
if ! getent passwd "eclipsescada" >/dev/null; then
# create new user
useradd --system --user-group --home "/var/lib/eclipsescada" --comment "Eclipse NeoSCADA User" "eclipsescada"
fi
mkdir -p "/var/lib/eclipsescada"
chown -R "eclipsescada:eclipsescada" "/var/lib/eclipsescada"
]]></script>
</preinstallScriptlet>
<postremoveScriptlet>
<script><![CDATA[
if [ "$1" -eq "0" ]; then
# zero means this we are the last and now are gone
# so perform a complete uninstall
if which userdel >/dev/null 2>&1; then
userdel "eclipsescada" > /dev/null || true
fi
groupdel "eclipsescada" > /dev/null || true
fi
]]></script>
</postremoveScriptlet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile> <!-- rpm -->
</profiles>
</project>