completed setup for installation, fixed robustness problem.
[upnpmonitor] / wamblee-upnpmonitor / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd ">
4     
5     <parent>
6     <groupId>org.wamblee.upnpmonitor</groupId>
7     <artifactId>root</artifactId>
8     <version>0.1-SNAPSHOT</version>
9   </parent>
10     
11     <modelVersion>4.0.0</modelVersion>
12     <artifactId>wamblee-upnpmonitor</artifactId>
13         <packaging>rpm</packaging>
14     <name>/wamblee-upnpmonitor</name>
15         
16         <dependencies>
17             <dependency>
18                     <groupId>org.wamblee.upnpmonitor</groupId>
19                         <artifactId>monitor</artifactId>
20                         <version>0.1-SNAPSHOT</version>
21                 </dependency>
22         </dependencies>
23
24     <build>
25         <plugins>
26             <plugin>
27                 <groupId>org.codehaus.mojo</groupId>
28                 <artifactId>rpm-maven-plugin</artifactId>
29                 <version>2.1-alpha-1</version>
30                 <extensions>true</extensions>
31                 <configuration>
32                     <changelogFile>CHANGELOG</changelogFile>
33                     <copyright>Apache License 2.0, 2010</copyright>
34                     <group>org.wamblee.server</group>
35                     <packager>Erik Brakkee</packager>
36                     
37                     <mappings>
38                         <mapping>
39                             <directory>/etc/init.d</directory>
40                             <filemode>755</filemode>
41                             <username>root</username>
42                             <groupname>root</groupname>
43                             <sources>
44                                 <source>
45                                     <location>files/etc/init.d</location>
46                                 </source>
47                             </sources>
48                         </mapping>
49                                                 
50                                                 <mapping>
51                             <directory>/opt/upnpmonitor/bin</directory>
52                             <username>root</username>
53                             <groupname>root</groupname>
54                                                         <filemode>755</filemode>
55                             <sources>
56                                 <source>
57                                     <location>files/opt/upnpmonitor/bin</location>
58                                 </source>
59                             </sources>
60                         </mapping>
61                                                 
62                                                 <mapping>
63                             <directory>/opt/upnpmonitor/etc</directory>
64                             <username>root</username>
65                             <groupname>root</groupname>                                                 
66                             <sources>
67                                 <source>
68                                     <location>files/opt/upnpmonitor/etc</location>
69                                 </source>
70                             </sources>
71                         </mapping>
72                                                 
73                                                 <mapping>
74                                                     <directory>/opt/upnpmonitor/lib</directory>
75                                                         <filemode>755</filemode>
76                                                         <username>root</username>
77                                                         <groupname>root</groupname>
78                                                         <dependency/>
79                                                 </mapping>
80                                                 
81                                                 <mapping>
82                             <directory>/etc/sysconfig</directory>
83                             <username>root</username>
84                             <groupname>root</groupname>
85                                                         <directoryIncluded>false</directoryIncluded>
86                             <configuration>noreplace</configuration>
87                             <sources>
88                                 <source>
89                                     <location>files/etc/sysconfig</location>
90                                 </source>
91                             </sources>
92                         </mapping>
93         
94                         <mapping>
95                             <directory>/usr/share/doc/packages/wamblee-upnpmonitor</directory>
96                             <username>root</username>
97                             <groupname>root</groupname>
98                             <sources>
99                                 <source>
100                                     <location>files/usr/share/doc/packages/wamblee-upnpmonitor</location>
101                                 </source>
102                             </sources>
103                         </mapping>
104                         
105                     </mappings>
106                     <provides>
107                         <provide>upnpmonitor</provide>
108                     </provides>
109                     <requires>
110                         <require>java</require>
111                     </requires>
112                                         <preinstallScriptlet>
113                                            <script><![CDATA[
114                                                
115                                                if grep '^upnpmonitor:' /etc/passwd > /dev/null
116                                                then
117                                                  echo "User upnpmonitor already exists." 1>&2
118                                                else
119                                                  /usr/sbin/useradd upnpmonitor
120                                                fi
121
122                                            ]]></script>
123                                         </preinstallScriptlet>
124                     
125                     <preremoveScriptlet>
126                        <script><![CDATA[
127                           /etc/init.d/upnpmonitor stop
128                           /sbin/chkconfig upnpmonitor off
129                        ]]></script>
130                     </preremoveScriptlet>
131                 </configuration>
132             </plugin>
133         </plugins>
134     </build>
135     
136 </project>