upnpmonitor script added that executes a simple test program.
[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/lib</directory>
64                                                         <filemode>755</filemode>
65                                                         <username>root</username>
66                                                         <groupname>root</groupname>
67                                                         <dependency/>
68                                                 </mapping>
69                        
70                         <mapping>
71                             <directory>/etc/profile.d</directory>
72                             <username>root</username>
73                             <groupname>root</groupname>
74                             <sources>
75                                 <source>
76                                     <location>files/etc/profile.d</location>
77                                 </source>
78                             </sources>
79                         </mapping>
80         
81                         <mapping>
82                             <directory>/usr/share/doc/packages/wamblee-upnpmonitor</directory>
83                             <username>root</username>
84                             <groupname>root</groupname>
85                             <sources>
86                                 <source>
87                                     <location>files/usr/share/doc/packages/wamblee-upnpmonitor</location>
88                                 </source>
89                             </sources>
90                         </mapping>
91                         
92                     </mappings>
93                     <provides>
94                         <provide>upnpmonitor</provide>
95                     </provides>
96                     <requires>
97                         <require>java-1_6_0-sun-devel</require>
98                     </requires>
99                                         <preinstallScriptlet>
100                                            <script><![CDATA[
101                                                
102                                                if grep '^java:' /etc/passwd > /dev/null
103                                                then
104                                                  echo "User java already exists." 1>&2
105                                                else
106                                                  /usr/sbin/useradd -m java
107                                                fi
108                                                (
109                                                  echo "Make sure that user java has login enabled!"
110                                                  echo "(passwd java)"
111                                                ) 1>&2
112                                                
113                                                if [[ -r /etc/init.d/glassfish ]]
114                                                then
115                                                  echo "This RPM does not support upgrade" 1>&2
116                                                  exit 1
117                                                fi
118                                            
119                                            ]]></script>
120                                         </preinstallScriptlet>
121                     
122                     <preremoveScriptlet>
123                        <script><![CDATA[
124                           /etc/init.d/upnpmonitor stop
125                           /sbin/chkconfig upnpmonitor off
126                        ]]></script>
127                     </preremoveScriptlet>
128                 </configuration>
129             </plugin>
130         </plugins>
131     </build>
132     
133 </project>