Rename and improve SLC RPM
authorMathieu Baudier <mbaudier@argeo.org>
Sun, 6 Nov 2011 21:23:32 +0000 (21:23 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Sun, 6 Nov 2011 21:23:32 +0000 (21:23 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@4898 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

12 files changed:
dist/slc/.project [new file with mode: 0644]
dist/slc/pom.xml [new file with mode: 0644]
dist/slc/src/assembly/devel.xml [new file with mode: 0644]
dist/slc/src/assembly/dist.xml [new file with mode: 0644]
dist/slc/src/main/base/work/server/conf/config.ini [new file with mode: 0644]
dist/slc/src/main/rpm/etc/init.d/slc [new file with mode: 0644]
dist/slc/src/main/rpm/etc/slc/config.ini [new file with mode: 0644]
dist/slc/src/main/rpm/etc/slc/log4j.properties [new file with mode: 0644]
dist/slc/src/main/rpm/usr/bin/slc [new file with mode: 0644]
dist/slc/src/main/scripts/postinstall [new file with mode: 0644]
dist/slc/src/main/scripts/preinstall [new file with mode: 0644]
dist/slc/src/main/scripts/preremove [new file with mode: 0644]

diff --git a/dist/slc/.project b/dist/slc/.project
new file mode 100644 (file)
index 0000000..1f3568b
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.slc.sdk</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+       </buildSpec>
+       <natures>
+       </natures>
+</projectDescription>
diff --git a/dist/slc/pom.xml b/dist/slc/pom.xml
new file mode 100644 (file)
index 0000000..5fbb2ca
--- /dev/null
@@ -0,0 +1,194 @@
+<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/maven-v4_0_0.xsd">
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+               <groupId>org.argeo.slc</groupId>
+               <artifactId>dist</artifactId>
+               <version>0.13.1-SNAPSHOT</version>
+       </parent>
+       <groupId>org.argeo.slc.dist</groupId>
+       <artifactId>slc</artifactId>
+       <packaging>pom</packaging>
+       <name>SLC Node (zip, rpm)</name>
+       <build>
+               <plugins>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-dependency-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <id>copy-dependencies</id>
+                                               <phase>process-resources</phase>
+                                               <goals>
+                                                       <goal>copy-dependencies</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <includeTypes>jar</includeTypes>
+                                                       <outputDirectory>${project.build.directory}/lib</outputDirectory>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+                       <plugin>
+                               <artifactId>maven-resources-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <id>filter-base</id>
+                                               <phase>process-resources</phase>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <outputDirectory>${basedir}/target/base</outputDirectory>
+                                                       <resources>
+                                                               <resource>
+                                                                       <directory>src/main/base</directory>
+                                                                       <filtering>true</filtering>
+                                                               </resource>
+                                                       </resources>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+               </plugins>
+       </build>
+       <dependencies>
+               <dependency>
+                       <groupId>org.argeo.slc.dep</groupId>
+                       <artifactId>org.argeo.slc.dep.sdk.rap</artifactId>
+                       <version>0.13.1-SNAPSHOT</version>
+                       <exclusions>
+                               <!-- Included in osgi-boot -->
+                               <exclusion>
+                                       <groupId>org.eclipse.osgi</groupId>
+                                       <artifactId>org.eclipse.osgi</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.argeo.commons.osgi</groupId>
+                                       <artifactId>org.argeo.osgi.boot</artifactId>
+                               </exclusion>
+                       </exclusions>
+               </dependency>
+               <dependency>
+                       <groupId>org.argeo.commons.server</groupId>
+                       <artifactId>org.argeo.server.tomcat</artifactId>
+                       <version>${version.argeo-commons}</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.argeo.commons.security</groupId>
+                       <artifactId>org.argeo.security.dep.ads</artifactId>
+                       <type>pom</type>
+                       <version>${version.argeo-commons}</version>
+               </dependency>
+       </dependencies>
+       <profiles>
+               <profile>
+                       <id>rpmbuild</id>
+                       <build>
+                               <plugins>
+                                       <plugin>
+                                               <groupId>org.codehaus.mojo</groupId>
+                                               <artifactId>rpm-maven-plugin</artifactId>
+                                               <version>2.1-alpha-1</version>
+                                               <extensions>true</extensions>
+                                               <configuration>
+                                                       <version>${project.version}</version>
+                                                       <release>r${buildNumber}.argeo</release>
+                                                       <copyright>2011 Argeo</copyright>
+                                                       <distribution>argeo</distribution>
+                                                       <packager>mbaudier@argeo.org</packager>
+                                                       <group>Applications/System</group>
+                                                       <prefix>/usr</prefix>
+                                               </configuration>
+                                               <executions>
+                                                       <execution>
+                                                               <id>rpm-sdk</id>
+                                                               <phase>package</phase>
+                                                               <goals>
+                                                                       <goal>rpm</goal>
+                                                               </goals>
+                                                               <configuration>
+                                                                       <mappings>
+                                                                               <mapping>
+                                                                                       <directory>/usr/bin</directory>
+                                                                                       <username>root</username>
+                                                                                       <groupname>root</groupname>
+                                                                                       <filemode>755</filemode>
+                                                                                       <directoryIncluded>false</directoryIncluded>
+                                                                                       <sources>
+                                                                                               <source>
+                                                                                                       <location>src/main/rpm/usr/bin</location>
+                                                                                                       <includes>
+                                                                                                               <include>*</include>
+                                                                                                       </includes>
+                                                                                               </source>
+                                                                                       </sources>
+                                                                               </mapping>
+                                                                               <mapping>
+                                                                                       <directory>/etc/init.d</directory>
+                                                                                       <username>root</username>
+                                                                                       <groupname>root</groupname>
+                                                                                       <filemode>755</filemode>
+                                                                                       <directoryIncluded>false</directoryIncluded>
+                                                                                       <sources>
+                                                                                               <source>
+                                                                                                       <location>src/main/rpm/etc/init.d</location>
+                                                                                                       <includes>
+                                                                                                               <include>*</include>
+                                                                                                       </includes>
+                                                                                               </source>
+                                                                                       </sources>
+                                                                               </mapping>
+                                                                               <mapping>
+                                                                                       <directory>/etc/${project.artifactId}</directory>
+                                                                                       <username>root</username>
+                                                                                       <groupname>${project.artifactId}</groupname>
+                                                                                       <filemode>640</filemode>
+                                                                                       <configuration>noreplace</configuration>
+                                                                                       <directoryIncluded>false</directoryIncluded>
+                                                                                       <sources>
+                                                                                               <source>
+                                                                                                       <location>src/main/rpm/etc/${project.artifactId}</location>
+                                                                                                       <includes>
+                                                                                                               <include>*</include>
+                                                                                                       </includes>
+                                                                                               </source>
+                                                                                       </sources>
+                                                                               </mapping>
+                                                                               <mapping>
+                                                                                       <directory>/usr/share/${project.artifactId}/lib</directory>
+                                                                                       <username>root</username>
+                                                                                       <groupname>root</groupname>
+                                                                                       <filemode>644</filemode>
+                                                                                       <directoryIncluded>false</directoryIncluded>
+                                                                                       <sources>
+                                                                                               <source>
+                                                                                                       <location>target/lib</location>
+                                                                                                       <includes>
+                                                                                                               <include>*.jar</include>
+                                                                                                       </includes>
+                                                                                               </source>
+                                                                                       </sources>
+                                                                               </mapping>
+                                                                       </mappings>
+                                                                       <preinstallScriptlet>
+                                                                               <scriptFile>src/main/scripts/preinstall</scriptFile>
+                                                                       </preinstallScriptlet>
+                                                                       <postinstallScriptlet>
+                                                                               <scriptFile>src/main/scripts/postinstall</scriptFile>
+                                                                       </postinstallScriptlet>
+                                                                       <preremoveScriptlet>
+                                                                               <scriptFile>src/main/scripts/preremove</scriptFile>
+                                                                       </preremoveScriptlet>
+                                                                       <requires>
+                                                                               <require>osgi-boot</require>
+                                                                       </requires>
+                                                               </configuration>
+                                                       </execution>
+                                               </executions>
+                                       </plugin>
+                               </plugins>
+                       </build>
+               </profile>
+       </profiles>
+</project>
\ No newline at end of file
diff --git a/dist/slc/src/assembly/devel.xml b/dist/slc/src/assembly/devel.xml
new file mode 100644 (file)
index 0000000..1eec8ca
--- /dev/null
@@ -0,0 +1,37 @@
+<!--
+
+    Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+            http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+
+<assembly
+       xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+       <id>devel</id>
+       <baseDirectory>slc</baseDirectory>
+       <formats>
+               <format>zip</format>
+       </formats>
+       <fileSets>
+               <fileSet>
+                       <directory>target/libsrc</directory>
+                       <outputDirectory>libsrc</outputDirectory>
+                       <includes>
+                               <include>*</include>
+                       </includes>
+               </fileSet>
+       </fileSets>
+</assembly>
\ No newline at end of file
diff --git a/dist/slc/src/assembly/dist.xml b/dist/slc/src/assembly/dist.xml
new file mode 100644 (file)
index 0000000..f9ffc4c
--- /dev/null
@@ -0,0 +1,55 @@
+<!--
+
+    Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+            http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+
+<assembly
+       xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+       <id>dist</id>
+       <baseDirectory>slc</baseDirectory>
+       <formats>
+               <format>zip</format>
+       </formats>
+       <fileSets>
+               <fileSet>
+                       <directory>target/base</directory>
+                       <outputDirectory></outputDirectory>
+                       <includes>
+                               <include>**</include>
+                       </includes>
+               </fileSet>
+       </fileSets>
+       <dependencySets>
+               <dependencySet>
+                       <unpack>false</unpack>
+                       <outputFileNameMapping>${artifact.artifactId}-${artifact.baseVersion}.${artifact.extension}
+                       </outputFileNameMapping>
+                       <outputDirectory>lib</outputDirectory>
+                       <includes>
+                               <include>*:jar</include>
+                       </includes>
+               </dependencySet>
+               <dependencySet>
+                       <unpack>true</unpack>
+                       <includes>
+                               <include>org.argeo.slc.runtime:org.argeo.slc.launcher:tar.gz:base
+                               </include>
+                       </includes>
+               </dependencySet>
+       </dependencySets>
+</assembly>
\ No newline at end of file
diff --git a/dist/slc/src/main/base/work/server/conf/config.ini b/dist/slc/src/main/base/work/server/conf/config.ini
new file mode 100644 (file)
index 0000000..30d4ab2
--- /dev/null
@@ -0,0 +1,7 @@
+osgi.bundles=org.argeo.osgi.boot-${version.argeo-commons}.jar@start
+argeo.osgi.bundles=${osgi.install.area};in=*.jar
+argeo.osgi.start=org.springframework.osgi.extender,\
+       org.argeo.server.ads.server,\
+       org.argeo.slc.server.hsqldb,\
+       org.argeo.slc.server.main,\
+       org.argeo.slc.ria
diff --git a/dist/slc/src/main/rpm/etc/init.d/slc b/dist/slc/src/main/rpm/etc/init.d/slc
new file mode 100644 (file)
index 0000000..13c272c
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/bash
+#
+# slc-server   SLC Server
+#
+# chkconfig: 3 92 92
+# description: SLC Server
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+RETVAL=0
+
+start() {
+       /usr/sbin/osgi-service slc start
+       action $"Start SLC" /bin/true
+       return $RETVAL
+}
+
+stop() {
+       /usr/sbin/osgi-service slc stop
+       action $"Stop SLC" /bin/true
+       return $RETVAL
+}
+
+# See how we were called.
+case "$1" in
+  start)
+        start
+        ;;
+  stop)
+        stop
+        ;;
+  restart)
+        stop
+        start
+        RETVAL=$?
+        ;;
+  status)
+               /usr/sbin/osgi-service slc-server status
+        ;;
+  *)
+        echo $"Usage: $0 {start|stop|restart|status}"
+        exit 1
+esac
+
+exit $RETVAL
diff --git a/dist/slc/src/main/rpm/etc/slc/config.ini b/dist/slc/src/main/rpm/etc/slc/config.ini
new file mode 100644 (file)
index 0000000..71d861e
--- /dev/null
@@ -0,0 +1,43 @@
+argeo.osgi.start=\
+org.springframework.osgi.extender,\
+org.argeo.node.repofactory.jackrabbit,\
+org.argeo.node.repo.jackrabbit,\
+org.argeo.security.dao.ldap,\
+org.argeo.slc.node.jackrabbit,\
+org.argeo.eclipse.ui,\
+org.eclipse.core.runtime,\
+org.eclipse.equinox.common,\
+org.eclipse.equinox.http.registry,\
+org.eclipse.equinox.launcher,\
+org.argeo.dep.osgi.catalina.start,\
+org.argeo.server.rap.webapp,\
+org.argeo.jackrabbit.webapp,\
+org.argeo.security.equinox,\
+org.argeo.security.ui,\
+org.argeo.security.ui.rap,\
+org.argeo.server.ads.server,\
+org.argeo.slc.server.repo,\
+org.argeo.slc.server.repo.webapp,\
+org.argeo.slc.client.ui,\
+org.argeo.slc.client.rap,\
+org.argeo.slc.agent,\
+org.argeo.slc.agent.jcr,\
+org.springframework.osgi.web.extender,\
+
+org.argeo.security.ui.initialPerspective=org.argeo.jcr.ui.explorer.perspective
+
+# TOMCAT PORTS
+argeo.server.port.http=7080
+argeo.server.port.https=7083
+argeo.server.port.ajp=7089
+
+# LDAP (Apache DS)
+#argeo.ads.init.ldif=osgibundle:init-argeo.ldif
+org.osgi.framework.bootdelegation=com.sun.jndi.ldap
+
+# OSGi MANAGEMENT
+osgi.console=3030
+
+# RAP SPECIFIC
+eclipse.ignoreApp=true
+osgi.noShutdown=true
diff --git a/dist/slc/src/main/rpm/etc/slc/log4j.properties b/dist/slc/src/main/rpm/etc/slc/log4j.properties
new file mode 100644 (file)
index 0000000..7edc3f2
--- /dev/null
@@ -0,0 +1,25 @@
+log4j.rootLogger=WARN, file
+#log4j.rootLogger=WARN, console
+
+## Levels
+log4j.logger.org.argeo=INFO
+#log4j.logger.org.springframework=DEBUG
+#log4j.logger.org.hibernate=DEBUG
+#log4j.logger.org.apache.activemq=DEBUG
+
+log4j.logger.org.springframework.web.servlet.PageNotFound=ERROR
+log4j.logger.org.apache.directory.server.core.schema.SchemaService=ERROR
+log4j.logger.org.springframework.security.SpringSecurityMessageSource=ERROR
+
+log4j.logger.org.apache.directory.server.core.partition=ERROR
+log4j.logger.org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry=ERROR
+
+## Appenders
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} [%15.15t] %m - %c%n - %t
+
+log4j.appender.file=org.apache.log4j.RollingFileAppender
+log4j.appender.file.File=/var/log/slc/slc.log
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern= %-5p %d{ISO8601} [%15.15t] %m - %c%n
diff --git a/dist/slc/src/main/rpm/usr/bin/slc b/dist/slc/src/main/rpm/usr/bin/slc
new file mode 100644 (file)
index 0000000..5f72472
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+if [ -d ./lib ];then
+       OSGI_INSTALL_AREA=`pwd`/lib
+else
+       OSGI_INSTALL_AREA=/usr/share/osgi
+fi
+
+
+java $JAVA_OPTS -jar $OSGI_INSTALL_AREA/org.eclipse.osgi.jar \
+       -clean \
+       -configuration conf \
+       -data data \
+       "$@"
diff --git a/dist/slc/src/main/scripts/postinstall b/dist/slc/src/main/scripts/postinstall
new file mode 100644 (file)
index 0000000..6a343ad
--- /dev/null
@@ -0,0 +1,5 @@
+if [ $1 = "1" ];then
+       APP=%{name}
+       /sbin/chkconfig --add $APP
+       /sbin/chkconfig --level 3 $APP on
+fi
\ No newline at end of file
diff --git a/dist/slc/src/main/scripts/preinstall b/dist/slc/src/main/scripts/preinstall
new file mode 100644 (file)
index 0000000..fdfcdf5
--- /dev/null
@@ -0,0 +1,8 @@
+if [ $1 = "1" ];then
+       APP=%{name}
+       useradd --system --home-dir /var/lib/$APP --shell /sbin/nologin --user-group --create-home $APP
+       # give read access to group on home
+       chmod g+r /var/lib/$APP
+       mkdir -p /var/lib/$APP/{conf,data}
+       chown $APP.$APP /var/lib/$APP/{conf,data}
+fi
\ No newline at end of file
diff --git a/dist/slc/src/main/scripts/preremove b/dist/slc/src/main/scripts/preremove
new file mode 100644 (file)
index 0000000..5152c72
--- /dev/null
@@ -0,0 +1,6 @@
+if [ $1 = "0" ];then
+#      APP=%{name} => doesn't work
+       APP=slc
+       /sbin/chkconfig --del $APP
+       userdel $APP
+fi