Changeset 6130 for SRUAggregator


Ignore:
Timestamp:
04/07/15 12:45:21 (9 years ago)
Author:
ccoltekin@gmail.com
Message:

Redhat/Debian? packagin setup.

Location:
SRUAggregator/trunk
Files:
16 added
1 edited

Legend:

Unmodified
Added
Removed
  • SRUAggregator/trunk/pom.xml

    r6124 r6130  
    77
    88        <groupId>eu.clarin.sru.fcs</groupId>
    9         <artifactId>Aggregator2</artifactId>
     9        <artifactId>aggregator</artifactId>
    1010        <version>2.0.0-beta-32</version>
    1111        <name>FCS Aggregator</name>
     
    1414                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    1515                <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
     16        <serviceUser>aggregator</serviceUser>
     17        <serviceGroup>aggregator</serviceGroup>
    1618        </properties>
    1719
     
    190192                                </executions>
    191193                        </plugin>
     194            <plugin>
     195                <groupId>org.codehaus.mojo</groupId>
     196                <artifactId>rpm-maven-plugin</artifactId>
     197                <version>2.1-alpha-4</version>
     198                <extensions>true</extensions>
     199                <configuration>
     200                    <group>Applications/System</group>
     201                    <name>${project.artifactId}</name>
     202                    <release>${buildNumber}</release>
     203                    <mappings>
     204                        <mapping>
     205                            <directory>/usr/share/${project.artifactId}/</directory>
     206                            <sources>
     207                                <source>
     208                                    <location>${project.build.directory}/${project.artifactId}-${project.version}.jar</location>
     209                                    <destination>${project.artifactId}.jar</destination>
     210                                </source>
     211                            </sources>
     212                        </mapping>
     213                        <mapping>
     214                            <directory>/var/lib/${project.artifactId}/</directory>
     215                            <filemode>700</filemode>
     216                            <username>${serviceUser}</username>
     217                            <groupname>${serviceGroup}</groupname>
     218                        </mapping>
     219                        <mapping>
     220                            <directory>/var/log/${project.artifactId}/</directory>
     221                            <filemode>700</filemode>
     222                            <username>${serviceUser}</username>
     223                            <groupname>${serviceGroup}</groupname>
     224                        </mapping>
     225                        <mapping>
     226                            <directory>/usr/bin</directory>
     227                            <directoryIncluded>false</directoryIncluded>
     228                            <filemode>755</filemode>
     229                            <sources>
     230                                <source>
     231                                    <location>src/assembly/bin/service.sh</location>
     232                                    <destination>${project.artifactId}</destination>
     233                                </source>
     234                            </sources>
     235                        </mapping>
     236                        <mapping>
     237                            <directory>/etc/init.d</directory>
     238                            <directoryIncluded>false</directoryIncluded>
     239                            <filemode>755</filemode>
     240                            <sources>
     241                                <source>
     242                                    <location>src/assembly/init-scripts/redhat</location>
     243                                    <destination>${project.artifactId}</destination>
     244                                </source>
     245                            </sources>
     246                        </mapping>
     247                        <mapping>
     248                            <directory>/etc/default</directory>
     249                            <directoryIncluded>false</directoryIncluded>
     250                            <configuration>true</configuration>
     251                            <sources>
     252                                <source>
     253                                    <location>src/assembly/conf/etc.default</location>
     254                                    <destination>${project.artifactId}</destination>
     255                                </source>
     256                            </sources>
     257                        </mapping>
     258                        <mapping>
     259                            <directory>/etc/clarind</directory>
     260                            <directoryIncluded>false</directoryIncluded>
     261                            <configuration>true</configuration>
     262                            <sources>
     263                                <source>
     264                                    <location>src/assembly/conf/${project.artifactId}.yaml</location>
     265                                    <destination>${project.artifactId}.yaml</destination>
     266                                </source>
     267                            </sources>
     268                        </mapping>
     269                    </mappings>
     270                    <preinstallScriptlet>
     271                        <script>
     272                            /usr/bin/getent group ${serviceGroup} &gt; /dev/null || /usr/sbin/groupadd ${project.artifactId}
     273                            /usr/bin/getent passwd ${serviceUser} &gt; /dev/null || /usr/sbin/useradd -r -d /var/lib/${project.artifactId} -m -g ${serviceGroup} ${serviceUser}
     274                        </script>
     275                    </preinstallScriptlet>
     276                    <postinstallScriptlet>
     277                        <script>
     278                            chkconfig --add ${project.artifactId};
     279                            chkconfig ${project.artifactId} on;
     280                            if [ $1 -eq 0 ]; then
     281                                /sbin/service ${project.artifactId} start
     282                            elif [ $1 -ge 1 ]; then
     283                                /sbin/service ${project.artifactId} restart
     284                            fi
     285                        </script>
     286                    </postinstallScriptlet>
     287                    <preremoveScriptlet>
     288                        <script>
     289                            if [ $1 -eq 0 ] ; then
     290                            /sbin/service ${project.artifactId} stop;chkconfig --del ${project.artifactId}
     291                            fi
     292                        </script>
     293                    </preremoveScriptlet>
     294                </configuration>
     295            </plugin>
     296            <plugin>
     297                <artifactId>jdeb</artifactId>
     298                <groupId>org.vafer</groupId>
     299                <version>1.3</version>
     300                    <configuration>
     301                        <dataSet>
     302                            <data>
     303                              <src>${project.build.directory}/${project.artifactId}-${project.version}.jar</src>
     304                              <type>file</type>
     305                              <dst>/usr/share/${project.artifactId}/${project.artifactId}.jar</dst>
     306                            </data>
     307                            <data>
     308                                <src>${project.basedir}/src/assembly/bin/service.sh</src>
     309                              <dst>/usr/bin/${project.artifactId}</dst>
     310                              <type>file</type>
     311                              <mapper>
     312                                    <type>perm</type>
     313                                    <filemode>755</filemode>
     314                              </mapper>
     315                            </data>
     316                            <data>
     317                              <src>${project.basedir}/src/assembly/init-scripts/ubuntu</src>
     318                              <dst>/etc/init.d/${project.artifactId}</dst>
     319                              <type>file</type>
     320                              <mapper>
     321                                    <type>perm</type>
     322                                    <filemode>755</filemode>
     323                              </mapper>
     324                            </data>
     325                            <data>
     326                                <src>${project.basedir}/src/assembly/conf/${project.artifactId}.yaml</src>
     327                              <dst>/etc/clarind/${project.artifactId}.yaml</dst>
     328                              <type>file</type>
     329                              <conffile>true</conffile>
     330                            </data>
     331                            <data>
     332                              <src>${project.basedir}/src/assembly/conf/etc.default</src>
     333                              <dst>/etc/default/${project.artifactId}</dst>
     334                              <type>file</type>
     335                              <conffile>true</conffile>
     336                            </data>
     337                            <data>
     338                                <type>template</type>
     339                                <paths>
     340                                    <path>var/lib/${project.artifactId}</path>
     341                                    <path>var/log/${project.artifactId}</path>
     342                                </paths>
     343                                <mapper>
     344                                    <type>perm</type>
     345                                    <user>${project.artifactId}</user>
     346                                    <group>${project.artifactId}</group>
     347                                </mapper>
     348                            </data>
     349                        </dataSet>
     350                    </configuration>
     351            </plugin>
    192352                </plugins>
    193353        </build>
Note: See TracChangeset for help on using the changeset viewer.