Improve packaging
authorMathieu Baudier <mbaudier@argeo.org>
Mon, 17 Apr 2017 15:53:52 +0000 (17:53 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Mon, 17 Apr 2017 15:53:52 +0000 (17:53 +0200)
25 files changed:
demo/slc_localrepo.properties
dist/slc/pom.xml
dist/slc/rpm/etc/init.d/slc [new file with mode: 0644]
dist/slc/rpm/etc/slc-cl/config.ini [new file with mode: 0644]
dist/slc/rpm/etc/slc-cl/log4j.properties [new file with mode: 0644]
dist/slc/rpm/etc/slc/config.ini [new file with mode: 0644]
dist/slc/rpm/etc/slc/log4j.properties [new file with mode: 0644]
dist/slc/rpm/scripts/postinstall [new file with mode: 0644]
dist/slc/rpm/scripts/preinstall [new file with mode: 0644]
dist/slc/rpm/scripts/preremove [new file with mode: 0644]
dist/slc/rpm/usr/bin/slc [new file with mode: 0644]
dist/slc/rpm/usr/lib/systemd/system/slcd.service [new file with mode: 0644]
dist/slc/rpm/usr/sbin/slcd [new file with mode: 0644]
dist/slc/src/main/rpm/etc/init.d/slc [deleted file]
dist/slc/src/main/rpm/etc/slc-cl/config.ini [deleted file]
dist/slc/src/main/rpm/etc/slc-cl/log4j.properties [deleted file]
dist/slc/src/main/rpm/etc/slc/config.ini [deleted file]
dist/slc/src/main/rpm/etc/slc/log4j.properties [deleted file]
dist/slc/src/main/rpm/usr/bin/slc [deleted file]
dist/slc/src/main/rpm/var/lib/slc/.m2/settings.xml [deleted file]
dist/slc/src/main/scripts/postinstall [deleted file]
dist/slc/src/main/scripts/preinstall [deleted file]
dist/slc/src/main/scripts/preremove [deleted file]
org.argeo.slc.launcher/src/org/argeo/slc/cli/SlcMain.java
pom.xml

index bf1314eefb883c4cf262efbaae185d00c06fb9c0..9e34647a0c6f435b9c7ad689058c072cdf41b29a 100644 (file)
@@ -23,8 +23,10 @@ org.argeo.tp.factory.extras,\
 org.argeo.tp.factory.rcp
 
 argeo.node.repo.type=localfs
+argeo.node.useradmin.uris=ipa:///
 
-org.osgi.framework.security=osgi
+#org.osgi.framework.security=osgi
+java.security.manager=
 java.security.policy=file:../../all.policy
  
 org.osgi.service.http.port=7080
index b96cf81240d5b0672823cf99ec657e2e15781a2d..938b3503e8a8028a59f8eb15627540763453757e 100644 (file)
                                                                                        <directoryIncluded>false</directoryIncluded>
                                                                                        <sources>
                                                                                                <source>
-                                                                                                       <location>src/main/rpm/usr/bin</location>
+                                                                                                       <location>rpm/usr/bin</location>
                                                                                                </source>
                                                                                        </sources>
                                                                                </mapping>
+                                                                               <!-- <mapping> -->
+                                                                               <!-- <directory>/usr/sbin</directory> -->
+                                                                               <!-- <username>root</username> -->
+                                                                               <!-- <groupname>root</groupname> -->
+                                                                               <!-- <filemode>755</filemode> -->
+                                                                               <!-- <directoryIncluded>false</directoryIncluded> -->
+                                                                               <!-- <sources> -->
+                                                                               <!-- <source> -->
+                                                                               <!-- <location>rpm/usr/sbin</location> -->
+                                                                               <!-- </source> -->
+                                                                               <!-- </sources> -->
+                                                                               <!-- </mapping> -->
+                                                                               <!-- <mapping> -->
+                                                                               <!-- <directory>/usr/lib/systemd/system</directory> -->
+                                                                               <!-- <username>root</username> -->
+                                                                               <!-- <groupname>root</groupname> -->
+                                                                               <!-- <filemode>644</filemode> -->
+                                                                               <!-- <directoryIncluded>false</directoryIncluded> -->
+                                                                               <!-- <sources> -->
+                                                                               <!-- <source> -->
+                                                                               <!-- <location>rpm/usr/lib/systemd/system</location> -->
+                                                                               <!-- </source> -->
+                                                                               <!-- </sources> -->
+                                                                               <!-- </mapping> -->
                                                                                <mapping>
                                                                                        <directory>/etc/init.d</directory>
                                                                                        <username>root</username>
                                                                                        <directoryIncluded>false</directoryIncluded>
                                                                                        <sources>
                                                                                                <source>
-                                                                                                       <location>src/main/rpm/etc/init.d</location>
+                                                                                                       <location>rpm/etc/init.d</location>
                                                                                                </source>
                                                                                        </sources>
                                                                                </mapping>
                                                                                        <directoryIncluded>false</directoryIncluded>
                                                                                        <sources>
                                                                                                <source>
-                                                                                                       <location>src/main/rpm/etc/slc</location>
+                                                                                                       <location>rpm/etc/slc</location>
                                                                                                </source>
                                                                                        </sources>
                                                                                </mapping>
                                                                                        <directoryIncluded>false</directoryIncluded>
                                                                                        <sources>
                                                                                                <source>
-                                                                                                       <location>src/main/rpm/etc/slc-cl</location>
+                                                                                                       <location>rpm/etc/slc-cl</location>
                                                                                                </source>
                                                                                        </sources>
                                                                                </mapping>
                                                                                        </sources>
                                                                                </mapping>
                                                                                <!-- Maven (even if not installed) -->
-                                                                               <mapping>
-                                                                                       <directory>/var/lib/slc/.m2</directory>
-                                                                                       <username>slc</username>
-                                                                                       <groupname>slc</groupname>
-                                                                                       <filemode>600</filemode>
-                                                                                       <directoryIncluded>false</directoryIncluded>
-                                                                                       <sources>
-                                                                                               <source>
-                                                                                                       <location>src/main/rpm/var/lib/slc/.m2</location>
-                                                                                               </source>
-                                                                                       </sources>
-                                                                               </mapping>
+                                                                               <!-- <mapping> -->
+                                                                               <!-- <directory>/var/lib/slc/.m2</directory> -->
+                                                                               <!-- <username>slc</username> -->
+                                                                               <!-- <groupname>slc</groupname> -->
+                                                                               <!-- <filemode>600</filemode> -->
+                                                                               <!-- <directoryIncluded>false</directoryIncluded> -->
+                                                                               <!-- <sources> -->
+                                                                               <!-- <source> -->
+                                                                               <!-- <location>rpm/var/lib/slc/.m2</location> -->
+                                                                               <!-- </source> -->
+                                                                               <!-- </sources> -->
+                                                                               <!-- </mapping> -->
                                                                        </mappings>
                                                                        <preinstallScriptlet>
-                                                                               <scriptFile>src/main/scripts/preinstall</scriptFile>
+                                                                               <scriptFile>rpm/scripts/preinstall</scriptFile>
                                                                        </preinstallScriptlet>
                                                                        <postinstallScriptlet>
-                                                                               <scriptFile>src/main/scripts/postinstall</scriptFile>
+                                                                               <scriptFile>rpm/scripts/postinstall</scriptFile>
                                                                        </postinstallScriptlet>
                                                                        <preremoveScriptlet>
-                                                                               <scriptFile>src/main/scripts/preremove</scriptFile>
+                                                                               <scriptFile>rpm/scripts/preremove</scriptFile>
                                                                        </preremoveScriptlet>
                                                                        <requires>
                                                                                <require>slc-platform</require>
                                                                                <require>osgi-boot</require>
                                                                                <!-- do not require java so that it can be installed on Ubuntu -->
-                                                                               <!-- <require>java-1.6.0-openjdk</require> -->
                                                                        </requires>
                                                                </configuration>
                                                        </execution>
diff --git a/dist/slc/rpm/etc/init.d/slc b/dist/slc/rpm/etc/init.d/slc
new file mode 100644 (file)
index 0000000..ef7534e
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/bash
+#
+# slc  Argeo SLC
+#
+# chkconfig: 3 92 92
+# description: Argeo SLC (http://www.argeo.org)
+
+# Source function library.
+. /etc/osgiboot/osgi-service-init-functions.sh
+
+# Application id (must be in line with header)
+APP=slc
+
+# main
+case "$1" in
+  start)
+        osgi_service_start $APP
+        ;;
+  stop)
+        osgi_service_stop $APP
+        ;;
+  restart)
+        osgi_service_stop $APP
+        osgi_service_start $APP
+        RETVAL=$?
+        ;;
+  status)
+        osgi_service_status $APP
+        ;;
+  *)
+        echo $"Usage: $0 {start|stop|restart|status}"
+        exit 1
+esac
+
+exit $RETVAL
diff --git a/dist/slc/rpm/etc/slc-cl/config.ini b/dist/slc/rpm/etc/slc-cl/config.ini
new file mode 100644 (file)
index 0000000..31e805a
--- /dev/null
@@ -0,0 +1,16 @@
+argeo.osgi.start=\
+org.eclipse.equinox.cm,\
+org.argeo.cms,\
+org.eclipse.gemini.blueprint.extender,\
+org.argeo.slc.agent,\
+org.argeo.slc.agent.jcr,\
+
+argeo.node.repo.type=localfs
+
+# DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING
+
+argeo.osgi.bundles=\
+${user.home}/.slc/modules;in=**;ex=**/.git/**;ex=**/.svn/**,\
+/etc/slc-cl/modules;in=**;ex=**/.git/**;ex=**/.svn/**,\
+/usr/local/share/osgi;in=**/*.jar,\
+/usr/share/osgi;in=**/*.jar
diff --git a/dist/slc/rpm/etc/slc-cl/log4j.properties b/dist/slc/rpm/etc/slc-cl/log4j.properties
new file mode 100644 (file)
index 0000000..42b2038
--- /dev/null
@@ -0,0 +1,15 @@
+#log4j.rootLogger=WARN, file
+log4j.rootLogger=WARN, console
+
+## Levels
+log4j.logger.org.argeo=INFO
+
+## 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/rpm/etc/slc/config.ini b/dist/slc/rpm/etc/slc/config.ini
new file mode 100644 (file)
index 0000000..5ee8536
--- /dev/null
@@ -0,0 +1,55 @@
+argeo.osgi.start.2.http=\
+org.eclipse.equinox.http.servlet,\
+org.eclipse.equinox.http.jetty,\
+org.eclipse.equinox.cm,\
+org.eclipse.rap.rwt.osgi
+
+argeo.osgi.start.3.node=\
+org.argeo.cms
+
+argeo.osgi.start.4.apps=\
+org.eclipse.gemini.blueprint.extender
+
+argeo.osgi.start.4.workbench=\
+org.eclipse.equinox.http.registry,\
+
+argeo.osgi.start.5.slc=\
+org.argeo.slc.node.jackrabbit,\
+org.argeo.slc.agent,\
+org.argeo.slc.agent.jcr,\
+org.argeo.slc.server.repo,\
+argeo.node.repo.type=localfs
+
+org.osgi.service.http.port=8080
+org.eclipse.equinox.http.jetty.log.stderr.threshold=info
+
+slc.executionModules=org.argeo.slc.demo.ant,\
+org.argeo.slc.demo.basic,\
+org.argeo.slc.demo.minimal,\
+
+org.argeo.security.ui.initialPerspective=org.argeo.slc.client.ui.dist.distributionPerspective
+
+# OSGi MANAGEMENT
+osgi.console=2323
+
+# DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING
+osgi.bundles=org.argeo.osgi.boot.jar@start
+argeo.osgi.baseUrl=file:///usr/share/osgi/
+argeo.osgi.distributionUrl=org/argeo/slc/org.argeo.slc.dep.backend/2.1.*/org.argeo.slc.dep.backend-2.1.*.jar
+argeo.osgi.bundles=\
+/etc/slc/modules;in=*,\
+/usr/local/share/osgi;in=**/*.jar
+#/usr/share/osgi;in=**/*.jar,\
+
+org.osgi.framework.bootdelegation=com.sun.jndi.ldap,\
+com.sun.jndi.ldap.sasl,\
+com.sun.security.jgss,\
+com.sun.jndi.dns,\
+com.sun.nio.file,\
+com.sun.nio.sctp
+
+eclipse.ignoreApp=true
+osgi.noShutdown=true
+org.eclipse.equinox.http.jetty.autostart=false
+org.eclipse.rap.workbenchAutostart=false
diff --git a/dist/slc/rpm/etc/slc/log4j.properties b/dist/slc/rpm/etc/slc/log4j.properties
new file mode 100644 (file)
index 0000000..2c130cb
--- /dev/null
@@ -0,0 +1,25 @@
+log4j.rootLogger=WARN, file
+#log4j.rootLogger=WARN, console
+
+## Levels
+log4j.logger.org.argeo=INFO
+log4j.logger.org.argeo.jackrabbit.remote.ExtendedDispatcherServlet=ERROR
+log4j.logger.org.springframework.web.servlet.PageNotFound=ERROR
+log4j.logger.org.argeo.server.webextender.TomcatDeployer=WARN
+
+log4j.logger.org.apache.coyote=INFO
+log4j.logger.org.apache.catalina.core.ContainerBase=INFO
+log4j.logger.org.apache.directory.server=ERROR
+log4j.logger.org.apache.jackrabbit.core.query.lucene=ERROR
+log4j.logger.org.apache.jackrabbit.core.config.ConfigurationErrorHandler=ERROR
+log4j.logger.org.apache.jackrabbit.core.util.db.DbUtility=FATAL
+
+## 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/rpm/scripts/postinstall b/dist/slc/rpm/scripts/postinstall
new file mode 100644 (file)
index 0000000..29e5822
--- /dev/null
@@ -0,0 +1,8 @@
+if [ $1 = "1" ];then
+       APP=%{name}
+       /sbin/chkconfig --add $APP
+       /sbin/chkconfig --level 3 $APP on
+fi
+
+# Workaround until we find a way to do it in the spec file
+chown -f slc.slc /var/lib/slc/.m2
diff --git a/dist/slc/rpm/scripts/preinstall b/dist/slc/rpm/scripts/preinstall
new file mode 100644 (file)
index 0000000..9aa8464
--- /dev/null
@@ -0,0 +1,16 @@
+if [ $1 = "1" ];then
+       APP=%{name}
+       
+       # check if user exists
+       /bin/id $APP 2>/dev/null
+       if [ $? -ne 0 ];then
+               # create application user (EL6)
+               echo Create user $APP...
+               useradd --system --home-dir /var/lib/$APP --shell /sbin/nologin --user-group --create-home $APP
+       fi
+       
+       # 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/rpm/scripts/preremove b/dist/slc/rpm/scripts/preremove
new file mode 100644 (file)
index 0000000..b79d261
--- /dev/null
@@ -0,0 +1,10 @@
+if [ $1 = "0" ];then
+       #APP=%{name} => doesn't work
+       APP=slc
+       /sbin/chkconfig --del $APP
+
+       # Maven
+       rm -rf /var/lib/$APP/.m2/repository
+
+       #userdel $APP
+fi
diff --git a/dist/slc/rpm/usr/bin/slc b/dist/slc/rpm/usr/bin/slc
new file mode 100644 (file)
index 0000000..706b4fa
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+JAVA_CMD=java
+JAVA_OPTS="-client -Xmx128m"
+
+SLC_HOME_DIR=${HOME}/.local/share/slc/
+if [ -f $SLC_HOME_DIR/settings.sh ];then
+       . $SLC_HOME_DIR/settings.sh
+fi
+
+OSGI_INSTALL_AREA=/usr/share/osgi/boot
+
+ARGEO_OSGI_BUNDLES="$SLC_HOME_DIR/modules;in=**;ex=**/.git/**;ex=**/.svn/**,/etc/slc-cl/modules;in=**;ex=**/.git/**;ex=**/.svn/**,/usr/share/osgi;in=*.jar"
+
+for i in "${OSGI_INSTALL_AREA}"/*.jar
+       do
+       CLASSPATH="$CLASSPATH:$i"
+       done
+
+$JAVA_CMD $JAVA_OPTS \
+ "-Dargeo.osgi.bundles=$ARGEO_OSGI_BUNDLES" \
+ -Djava.security.manager= \
+ -Djava.security.policy="file:/etc/osgiboot/all.policy" \
+ -cp "$CLASSPATH" \
+ org.argeo.slc.cli.SlcMain "$@"
\ No newline at end of file
diff --git a/dist/slc/rpm/usr/lib/systemd/system/slcd.service b/dist/slc/rpm/usr/lib/systemd/system/slcd.service
new file mode 100644 (file)
index 0000000..e748089
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=Argeo SLC daemon
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/slcd start
+ExecStop=/usr/sbin/slcd stop
+Type=forking
+PIDFile=/var/run/slcd.pid
+
+[Install]
+WantedBy=default.target
\ No newline at end of file
diff --git a/dist/slc/rpm/usr/sbin/slcd b/dist/slc/rpm/usr/sbin/slcd
new file mode 100644 (file)
index 0000000..d956108
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+. /etc/osgiboot/osgi-service-init-functions.sh
+
+APP=slc
+
+case "$1" in
+  start)
+        osgi_service_start $APP
+        ;;
+  stop)
+        osgi_service_stop $APP
+        ;;
+  restart)
+        osgi_service_stop $APP
+        osgi_service_start $APP
+        RETVAL=$?
+        ;;
+  status)
+        osgi_service_status $APP
+        ;;
+  *)
+        echo $"Usage: $0 {start|stop|restart|status}"
+        exit 1
+esac
+
+exit $RETVAL
diff --git a/dist/slc/src/main/rpm/etc/init.d/slc b/dist/slc/src/main/rpm/etc/init.d/slc
deleted file mode 100644 (file)
index ef7534e..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-#
-# slc  Argeo SLC
-#
-# chkconfig: 3 92 92
-# description: Argeo SLC (http://www.argeo.org)
-
-# Source function library.
-. /etc/osgiboot/osgi-service-init-functions.sh
-
-# Application id (must be in line with header)
-APP=slc
-
-# main
-case "$1" in
-  start)
-        osgi_service_start $APP
-        ;;
-  stop)
-        osgi_service_stop $APP
-        ;;
-  restart)
-        osgi_service_stop $APP
-        osgi_service_start $APP
-        RETVAL=$?
-        ;;
-  status)
-        osgi_service_status $APP
-        ;;
-  *)
-        echo $"Usage: $0 {start|stop|restart|status}"
-        exit 1
-esac
-
-exit $RETVAL
diff --git a/dist/slc/src/main/rpm/etc/slc-cl/config.ini b/dist/slc/src/main/rpm/etc/slc-cl/config.ini
deleted file mode 100644 (file)
index 31e805a..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-argeo.osgi.start=\
-org.eclipse.equinox.cm,\
-org.argeo.cms,\
-org.eclipse.gemini.blueprint.extender,\
-org.argeo.slc.agent,\
-org.argeo.slc.agent.jcr,\
-
-argeo.node.repo.type=localfs
-
-# DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING
-
-argeo.osgi.bundles=\
-${user.home}/.slc/modules;in=**;ex=**/.git/**;ex=**/.svn/**,\
-/etc/slc-cl/modules;in=**;ex=**/.git/**;ex=**/.svn/**,\
-/usr/local/share/osgi;in=**/*.jar,\
-/usr/share/osgi;in=**/*.jar
diff --git a/dist/slc/src/main/rpm/etc/slc-cl/log4j.properties b/dist/slc/src/main/rpm/etc/slc-cl/log4j.properties
deleted file mode 100644 (file)
index 42b2038..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#log4j.rootLogger=WARN, file
-log4j.rootLogger=WARN, console
-
-## Levels
-log4j.logger.org.argeo=INFO
-
-## 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/etc/slc/config.ini b/dist/slc/src/main/rpm/etc/slc/config.ini
deleted file mode 100644 (file)
index 5ee8536..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-argeo.osgi.start.2.http=\
-org.eclipse.equinox.http.servlet,\
-org.eclipse.equinox.http.jetty,\
-org.eclipse.equinox.cm,\
-org.eclipse.rap.rwt.osgi
-
-argeo.osgi.start.3.node=\
-org.argeo.cms
-
-argeo.osgi.start.4.apps=\
-org.eclipse.gemini.blueprint.extender
-
-argeo.osgi.start.4.workbench=\
-org.eclipse.equinox.http.registry,\
-
-argeo.osgi.start.5.slc=\
-org.argeo.slc.node.jackrabbit,\
-org.argeo.slc.agent,\
-org.argeo.slc.agent.jcr,\
-org.argeo.slc.server.repo,\
-argeo.node.repo.type=localfs
-
-org.osgi.service.http.port=8080
-org.eclipse.equinox.http.jetty.log.stderr.threshold=info
-
-slc.executionModules=org.argeo.slc.demo.ant,\
-org.argeo.slc.demo.basic,\
-org.argeo.slc.demo.minimal,\
-
-org.argeo.security.ui.initialPerspective=org.argeo.slc.client.ui.dist.distributionPerspective
-
-# OSGi MANAGEMENT
-osgi.console=2323
-
-# DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING
-osgi.bundles=org.argeo.osgi.boot.jar@start
-argeo.osgi.baseUrl=file:///usr/share/osgi/
-argeo.osgi.distributionUrl=org/argeo/slc/org.argeo.slc.dep.backend/2.1.*/org.argeo.slc.dep.backend-2.1.*.jar
-argeo.osgi.bundles=\
-/etc/slc/modules;in=*,\
-/usr/local/share/osgi;in=**/*.jar
-#/usr/share/osgi;in=**/*.jar,\
-
-org.osgi.framework.bootdelegation=com.sun.jndi.ldap,\
-com.sun.jndi.ldap.sasl,\
-com.sun.security.jgss,\
-com.sun.jndi.dns,\
-com.sun.nio.file,\
-com.sun.nio.sctp
-
-eclipse.ignoreApp=true
-osgi.noShutdown=true
-org.eclipse.equinox.http.jetty.autostart=false
-org.eclipse.rap.workbenchAutostart=false
diff --git a/dist/slc/src/main/rpm/etc/slc/log4j.properties b/dist/slc/src/main/rpm/etc/slc/log4j.properties
deleted file mode 100644 (file)
index 2c130cb..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-log4j.rootLogger=WARN, file
-#log4j.rootLogger=WARN, console
-
-## Levels
-log4j.logger.org.argeo=INFO
-log4j.logger.org.argeo.jackrabbit.remote.ExtendedDispatcherServlet=ERROR
-log4j.logger.org.springframework.web.servlet.PageNotFound=ERROR
-log4j.logger.org.argeo.server.webextender.TomcatDeployer=WARN
-
-log4j.logger.org.apache.coyote=INFO
-log4j.logger.org.apache.catalina.core.ContainerBase=INFO
-log4j.logger.org.apache.directory.server=ERROR
-log4j.logger.org.apache.jackrabbit.core.query.lucene=ERROR
-log4j.logger.org.apache.jackrabbit.core.config.ConfigurationErrorHandler=ERROR
-log4j.logger.org.apache.jackrabbit.core.util.db.DbUtility=FATAL
-
-## 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
deleted file mode 100644 (file)
index 2ffee58..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-JAVA_CMD=/usr/lib/jvm/java-1.8.0/bin/java
-JAVA_OPTS="-client -Xmx256m"
-
-SLC_HOME_DIR=${HOME}/.local/share/slc/
-if [ -f $SLC_HOME_DIR/settings.sh ];then
-       . $SLC_HOME_DIR/settings.sh
-fi
-
-OSGI_INSTALL_AREA=/usr/share/osgi/boot
-
-ARGEO_OSGI_BUNDLES="$SLC_HOME_DIR/modules;in=**;ex=**/.git/**;ex=**/.svn/**,/etc/slc-cl/modules;in=**;ex=**/.git/**;ex=**/.svn/**,/usr/share/osgi;in=*.jar"
-
-for i in "${OSGI_INSTALL_AREA}"/*.jar
-       do
-       CLASSPATH="$CLASSPATH:$i"
-       done
-
-$JAVA_CMD $JAVA_OPTS \
- "-Dargeo.osgi.bundles=$ARGEO_OSGI_BUNDLES" \
- -Dorg.osgi.framework.security=osgi \
- -Djava.security.policy="file:/etc/osgiboot/all.policy" \
- -cp "$CLASSPATH" \
- org.argeo.slc.cli.SlcMain "$@"
\ No newline at end of file
diff --git a/dist/slc/src/main/rpm/var/lib/slc/.m2/settings.xml b/dist/slc/src/main/rpm/var/lib/slc/.m2/settings.xml
deleted file mode 100644 (file)
index 270f623..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<!--
-
-    Copyright (C) 2007-2012 Argeo GmbH
-
-    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.
-
--->
-<settings 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/settings-1.0.0.xsd">
-       <mirrors>
-               <mirror>
-                       <id>slc-repo</id>
-                       <name>SLC Repository</name>
-                       <url>http://localhost:7080/org.argeo.slc.repo.webapp/maven</url>
-                       <mirrorOf>*</mirrorOf>
-               </mirror>
-       </mirrors>
-       <servers>
-               <server>
-                       <id>slc-repo</id>
-                       <username>root</username>
-                       <password>demo</password>
-               </server>
-               <server>
-                       <id>localrepo</id>
-                       <username>root</username>
-                       <password>demo</password>
-               </server>
-               <server>
-                       <id>localrepo.snapshots</id>
-                       <username>root</username>
-                       <password>demo</password>
-               </server>
-       </servers>
-</settings>
-
diff --git a/dist/slc/src/main/scripts/postinstall b/dist/slc/src/main/scripts/postinstall
deleted file mode 100644 (file)
index 29e5822..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-if [ $1 = "1" ];then
-       APP=%{name}
-       /sbin/chkconfig --add $APP
-       /sbin/chkconfig --level 3 $APP on
-fi
-
-# Workaround until we find a way to do it in the spec file
-chown -f slc.slc /var/lib/slc/.m2
diff --git a/dist/slc/src/main/scripts/preinstall b/dist/slc/src/main/scripts/preinstall
deleted file mode 100644 (file)
index 9aa8464..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-if [ $1 = "1" ];then
-       APP=%{name}
-       
-       # check if user exists
-       /bin/id $APP 2>/dev/null
-       if [ $? -ne 0 ];then
-               # create application user (EL6)
-               echo Create user $APP...
-               useradd --system --home-dir /var/lib/$APP --shell /sbin/nologin --user-group --create-home $APP
-       fi
-       
-       # 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
deleted file mode 100644 (file)
index b79d261..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-if [ $1 = "0" ];then
-       #APP=%{name} => doesn't work
-       APP=slc
-       /sbin/chkconfig --del $APP
-
-       # Maven
-       rm -rf /var/lib/$APP/.m2/repository
-
-       #userdel $APP
-fi
index d7bd977f7de7ff7df7a0b18aa9363ceaa70e07d0..a4bf3cd6554ede5788c69838a82c9c2b933c26ee 100644 (file)
@@ -72,14 +72,21 @@ public class SlcMain implements PrivilegedAction<String> {
                this.confDir = confDir;
                this.dataDir = dataDir;
                this.modulesDir = modulesDir;
-               bundlesToStart.add("org.springframework.osgi.extender");
-               bundlesToStart.add("org.argeo.node.repo.jackrabbit");
-               bundlesToStart.add("org.argeo.security.dao.os");
-               bundlesToStart.add("org.argeo.slc.node.jackrabbit");
+
+               bundlesToStart.add("org.eclipse.equinox.cm");
+               bundlesToStart.add("org.argeo.cms");
+               bundlesToStart.add("org.eclipse.gemini.blueprint.extender");
                bundlesToStart.add("org.argeo.slc.agent");
                bundlesToStart.add("org.argeo.slc.agent.jcr");
-               if (args.length == 0)
-                       bundlesToStart.add("org.argeo.slc.support.equinox");
+
+               // bundlesToStart.add("org.springframework.osgi.extender");
+               // bundlesToStart.add("org.argeo.node.repo.jackrabbit");
+               // bundlesToStart.add("org.argeo.security.dao.os");
+               // bundlesToStart.add("org.argeo.slc.node.jackrabbit");
+               // bundlesToStart.add("org.argeo.slc.agent");
+               // bundlesToStart.add("org.argeo.slc.agent.jcr");
+               // if (args.length == 0)
+               // bundlesToStart.add("org.argeo.slc.support.equinox");
                // bundlesToStart.add("org.argeo.slc.agent.cli");
        }
 
@@ -92,12 +99,10 @@ public class SlcMain implements PrivilegedAction<String> {
                        info("## Data : " + dataDir.getCanonicalPath());
 
                        // Start Equinox
-                       ServiceLoader<FrameworkFactory> ff = ServiceLoader
-                                       .load(FrameworkFactory.class);
+                       ServiceLoader<FrameworkFactory> ff = ServiceLoader.load(FrameworkFactory.class);
                        FrameworkFactory frameworkFactory = ff.iterator().next();
                        Map<String, String> configuration = new HashMap<String, String>();
-                       configuration.put("osgi.configuration.area",
-                                       confDir.getCanonicalPath());
+                       configuration.put("osgi.configuration.area", confDir.getCanonicalPath());
                        configuration.put("osgi.instance.area", dataDir.getCanonicalPath());
                        // Do clean
                        configuration.put("osgi.clean", "true");
@@ -117,16 +122,13 @@ public class SlcMain implements PrivilegedAction<String> {
 
                        // working copy modules
                        if (modulesDir.exists())
-                               osgiBoot.installUrls(osgiBoot.getBundlesUrls(modulesDir
-                                               .getCanonicalPath() + ";in=*;ex=.gitignore"));
+                               osgiBoot.installUrls(osgiBoot.getBundlesUrls(modulesDir.getCanonicalPath() + ";in=*;ex=.gitignore"));
 
                        // system modules
                        if (System.getProperty(OsgiBoot.PROP_ARGEO_OSGI_BUNDLES) != null)
-                               osgiBoot.installUrls(osgiBoot.getBundlesUrls(System
-                                               .getProperty(OsgiBoot.PROP_ARGEO_OSGI_BUNDLES)));
+                               osgiBoot.installUrls(osgiBoot.getBundlesUrls(System.getProperty(OsgiBoot.PROP_ARGEO_OSGI_BUNDLES)));
                        else
-                               osgiBoot.installUrls(osgiBoot.getBundlesUrls(System
-                                               .getProperty("user.home") + "/.slc/modules/;in=**"));
+                               osgiBoot.installUrls(osgiBoot.getBundlesUrls(System.getProperty("user.home") + "/.slc/modules/;in=**"));
 
                        // Start runtime
                        osgiBoot.startBundles(bundlesToStart);
@@ -134,8 +136,7 @@ public class SlcMain implements PrivilegedAction<String> {
                        // Find SLC Agent
                        ServiceReference sr = null;
                        while (sr == null) {
-                               sr = bundleContext
-                                               .getServiceReference("org.argeo.slc.execution.SlcAgentCli");
+                               sr = bundleContext.getServiceReference("org.argeo.slc.execution.SlcAgentCli");
                                if (System.currentTimeMillis() - begin > timeout)
                                        throw new RuntimeException("Cannot find SLC agent CLI");
                                Thread.sleep(100);
@@ -144,8 +145,7 @@ public class SlcMain implements PrivilegedAction<String> {
 
                        // Initialization completed
                        long duration = System.currentTimeMillis() - begin;
-                       info("[[ Initialized in " + (duration / 1000) + "s "
-                                       + (duration % 1000) + "ms ]]");
+                       info("[[ Initialized in " + (duration / 1000) + "s " + (duration % 1000) + "ms ]]");
 
                        if (args.length == 0)
                                return null;// console mode
@@ -153,8 +153,7 @@ public class SlcMain implements PrivilegedAction<String> {
                        // Subject.doAs(Subject.getSubject(AccessController.getContext()),
                        // new AgentCliCall(agentCli));
                        Class<?>[] parameterTypes = { String[].class };
-                       Method method = agentCli.getClass().getMethod("process",
-                                       parameterTypes);
+                       Method method = agentCli.getClass().getMethod("process", parameterTypes);
                        Object[] methodArgs = { args };
                        Object ret = method.invoke(agentCli, methodArgs);
 
@@ -184,13 +183,10 @@ public class SlcMain implements PrivilegedAction<String> {
                        File slcDir;
                        Boolean isTransient = false;
                        if (isTransient) {
-                               File tempDir = new File(System.getProperty("java.io.tmpdir")
-                                               + "/" + System.getProperty("user.name"));
-                               slcDir = new File(tempDir, "slc-"
-                                               + UUID.randomUUID().toString());
+                               File tempDir = new File(System.getProperty("java.io.tmpdir") + "/" + System.getProperty("user.name"));
+                               slcDir = new File(tempDir, "slc-" + UUID.randomUUID().toString());
                                slcDir.mkdirs();
-                               System.setProperty("argeo.node.repo.configuration",
-                                               "osgibundle:repository-memory.xml");
+                               System.setProperty("argeo.node.repo.configuration", "osgibundle:repository-memory.xml");
                        } else {
                                slcDir = findSlcDir(executionDir);
                                if (slcDir == null) {
@@ -211,28 +207,27 @@ public class SlcMain implements PrivilegedAction<String> {
                        File modulesDir = new File(slcDir, "modules");
 
                        // JAAS
-//                     File jaasFile = new File(confDir, "jaas.config");
-//                     if (!jaasFile.exists())
-//                             copyResource("/org/argeo/slc/cli/jaas.config", jaasFile);
-//                     System.setProperty("java.security.auth.login.config",
-//                                     jaasFile.getCanonicalPath());
+                       // File jaasFile = new File(confDir, "jaas.config");
+                       // if (!jaasFile.exists())
+                       // copyResource("/org/argeo/slc/cli/jaas.config", jaasFile);
+                       // System.setProperty("java.security.auth.login.config",
+                       // jaasFile.getCanonicalPath());
 
                        // log4j
                        File log4jFile = new File(confDir, "log4j.properties");
                        if (!log4jFile.exists())
                                copyResource("/org/argeo/slc/cli/log4j.properties", log4jFile);
-                       System.setProperty("log4j.configuration",
-                                       "file://" + log4jFile.getCanonicalPath());
+                       System.setProperty("log4j.configuration", "file://" + log4jFile.getCanonicalPath());
                        // Run as a privileged action
-//                     LoginContext lc = new LoginContext(os);
-//                     lc.login();
-//
-//                     Subject subject = Subject.getSubject(AccessController.getContext());
-//                     Subject.doAs(subject, new SlcMain(args, confDir, dataDir,
-//                                     modulesDir));
-SlcMain slcMain =  new SlcMain(args, confDir, dataDir,
-               modulesDir);
-slcMain.run();
+                       // LoginContext lc = new LoginContext(os);
+                       // lc.login();
+                       //
+                       // Subject subject =
+                       // Subject.getSubject(AccessController.getContext());
+                       // Subject.doAs(subject, new SlcMain(args, confDir, dataDir,
+                       // modulesDir));
+                       SlcMain slcMain = new SlcMain(args, confDir, dataDir, modulesDir);
+                       slcMain.run();
                        if (args.length != 0)
                                System.exit(0);
                } catch (Exception e) {
@@ -277,8 +272,7 @@ slcMain.run();
                                output.write(buf, 0, length);
                        }
                } catch (Exception e) {
-                       throw new RuntimeException("Cannot write " + resource + " file to "
-                                       + targetFile, e);
+                       throw new RuntimeException("Cannot write " + resource + " file to " + targetFile, e);
                } finally {
                        try {
                                input.close();
@@ -342,4 +336,3 @@ slcMain.run();
 // }
 //
 // }
-
diff --git a/pom.xml b/pom.xml
index 1a61a057684675d8c37f20cad9c3e257a5b862a7..1c1e23b6994fb6a53f3b4dfe2c24e4231c98900e 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
        <parent>
                <groupId>org.argeo.commons</groupId>
                <artifactId>argeo-commons</artifactId>
-               <version>2.1.69-SNAPSHOT</version>
+               <version>2.1.69</version>
        </parent>
        <groupId>org.argeo.slc</groupId>
        <artifactId>argeo-slc</artifactId>