summaryrefslogtreecommitdiff
path: root/net-im
diff options
context:
space:
mode:
authorMads Randstoft (mazzachre) <mads_randstoft@yahoo.dk>2008-10-07 08:37:20 +0000
committerMads Randstoft (mazzachre) <mads_randstoft@yahoo.dk>2008-10-07 08:37:20 +0000
commit04869ceb23b964d738ad91d342732bffda639b75 (patch)
tree1e596aaa6d4d7b7da7a571d6c024f8136b890ac9 /net-im
parentdev-java/tigase-utils: New EBuild for Tigase Utils (diff)
downloadsunrise-04869ceb23b964d738ad91d342732bffda639b75.tar.gz
sunrise-04869ceb23b964d738ad91d342732bffda639b75.tar.bz2
sunrise-04869ceb23b964d738ad91d342732bffda639b75.zip
net-im/tigase-server: New EBuild for Tigase Server
svn path=/sunrise/; revision=7196
Diffstat (limited to 'net-im')
-rw-r--r--net-im/tigase-server/ChangeLog10
-rw-r--r--net-im/tigase-server/Manifest7
-rw-r--r--net-im/tigase-server/files/classpaths.patch49
-rw-r--r--net-im/tigase-server/files/conf_d_tigase5
-rw-r--r--net-im/tigase-server/files/default_config.patch57
-rw-r--r--net-im/tigase-server/files/init_d_tigase41
-rw-r--r--net-im/tigase-server/metadata.xml5
-rw-r--r--net-im/tigase-server/tigase-server-9999_pre2.ebuild77
8 files changed, 251 insertions, 0 deletions
diff --git a/net-im/tigase-server/ChangeLog b/net-im/tigase-server/ChangeLog
new file mode 100644
index 000000000..ecbaeacda
--- /dev/null
+++ b/net-im/tigase-server/ChangeLog
@@ -0,0 +1,10 @@
+# ChangeLog for net-im/tigase-server
+# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+ 07 Oct 2008; Mads Randstoft (mazzachre) <mads_randstoft@yahoo.dk>
+ +tigase-server-9999_pre2.ebuild, +files/classpaths.patch,
+ +files/conf_d_tigase, +files/default_config.patch, +files/init_d_tigase,
+ +metadata.xml:
+ New EBuild for Tigase Server
+
diff --git a/net-im/tigase-server/Manifest b/net-im/tigase-server/Manifest
new file mode 100644
index 000000000..5b63f41b3
--- /dev/null
+++ b/net-im/tigase-server/Manifest
@@ -0,0 +1,7 @@
+AUX classpaths.patch 1353 RMD160 d4108e2629e309d0495e75a039d3084864b908dc SHA1 81d0f0c657af9f18a7e05b2eadff5833d54a599e SHA256 e44585d895a3d3759b4516ab6cc1808b985a270ab9668379f9ca61b591c9c99c
+AUX conf_d_tigase 187 RMD160 ae8d29f67017506298ad19235555c0fe3a844ec3 SHA1 958e0dfb910f872e6e9f89491580c388d9af562d SHA256 228b292fd577c84870871b40a555b511685afd28e60901e9b215b98b6d74bc46
+AUX default_config.patch 2698 RMD160 b0fb7e9729b0d383ee2b028a75f8255b73d11438 SHA1 0664ee0d267be3d2aa521deb750f2c9c93146342 SHA256 bbcff0a405ea98212ecd18a4b4dbf0b1ec65e455aa1a5dcb1f1262ff08059c9c
+AUX init_d_tigase 1109 RMD160 268e9f94c5472c82927e0251647eab1b8b38b0a0 SHA1 1f18338d5c9c4778659890d62644f3f7a22d62fd SHA256 55cdecc82b9d57ce776f53a0e358b2e8adf512acce2774adc6f738908647cba4
+EBUILD tigase-server-9999_pre2.ebuild 2027 RMD160 426210123e11cee7274f6d575ac2816430fb7655 SHA1 7223fd7d320b4adfec574f391a7216b8f609e2e4 SHA256 6aab5b425e6af1e4da4523fae53b39aa266cd5dcf010d685e620e2dfc3d1ad18
+MISC ChangeLog 373 RMD160 722e9fe62e2c844ec2e7612f68a547609c6fd770 SHA1 b54bd0deb66705487923a2088255e239b5c77df8 SHA256 4a2b2e251ab1e2a0e29913edee2b329a38cf9f15add19c1ebe168de433405790
+MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42
diff --git a/net-im/tigase-server/files/classpaths.patch b/net-im/tigase-server/files/classpaths.patch
new file mode 100644
index 000000000..c0e91c1c6
--- /dev/null
+++ b/net-im/tigase-server/files/classpaths.patch
@@ -0,0 +1,49 @@
+Index: build.properties
+===================================================================
+--- build.properties (revision 1113)
++++ build.properties (working copy)
+@@ -6,7 +6,8 @@
+ src.java.dir=${src}
+ build=classes
+ jars=jars
+-libs=libs
++xmltools=/usr/share/tigase-xmltools/lib/tigase-xmltools.jar
++utils=/usr/share/tigase-utils/lib/tigase-utils.jar
+ docs=docs
+ dist=dist
+ unittests=tests/unittests/src
+Index: ant-definitions.xml
+===================================================================
+--- ant-definitions.xml (revision 1113)
++++ ant-definitions.xml (working copy)
+@@ -13,13 +13,9 @@
+ destdir="${build}"
+ debug="on"
+ encoding="UTF-8"
++ classpath="${xmltools}:${utils}"
+ deprecation="@{deprecation}">
+ <compilerarg line="@{xlint}"/>
+- <classpath>
+- <fileset dir="${libs}">
+- <include name="**/*.jar"/>
+- </fileset>
+- </classpath>
+ </javac>
+ </sequential>
+ </macrodef>
+@@ -79,14 +75,8 @@
+ version="true"
+ verbose="false"
+ protected="true"
++ classpath="${xmltools};${utils}"
+ bottom="${javadoc-copyright}">
+- <link offline="true" href="http://java.sun.com/j2se/1.5.0/docs/api/"
+- packagelistLoc="package-list"/>
+- <classpath>
+- <fileset dir="${libs}">
+- <include name="**/*.jar"/>
+- </fileset>
+- </classpath>
+ </javadoc>
+ </sequential>
+ </macrodef>
diff --git a/net-im/tigase-server/files/conf_d_tigase b/net-im/tigase-server/files/conf_d_tigase
new file mode 100644
index 000000000..141f5bfef
--- /dev/null
+++ b/net-im/tigase-server/files/conf_d_tigase
@@ -0,0 +1,5 @@
+JAVA_OPTIONS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -server -Xms100M"
+CLASSPATH=
+TIGASE_USER=tigase
+TIGASE_CONFIG=/etc/tigase-config.xml
+TIGASE_OPTIONS=
diff --git a/net-im/tigase-server/files/default_config.patch b/net-im/tigase-server/files/default_config.patch
new file mode 100644
index 000000000..598c29f1a
--- /dev/null
+++ b/net-im/tigase-server/files/default_config.patch
@@ -0,0 +1,57 @@
+Index: src/main/java/tigase/conf/Configurable.java
+===================================================================
+--- src/main/java/tigase/conf/Configurable.java (revision 1113)
++++ src/main/java/tigase/conf/Configurable.java (working copy)
+@@ -122,7 +122,7 @@
+ public static final String LIBRESOURCE_REPO_CLASS_PROP_VAL =
+ "tigase.db.jdbc.LibreSourceAuth";
+
+- public static final String XML_REPO_URL_PROP_VAL = "user-repository.xml";
++ public static final String XML_REPO_URL_PROP_VAL = "/var/lib/tigase/user-repository.xml";
+ public static final String MYSQL_REPO_URL_PROP_VAL =
+ "jdbc:mysql://localhost/tigase?user=root&password=mypass";
+ public static final String PGSQL_REPO_URL_PROP_VAL =
+Index: src/main/java/tigase/conf/Configurator.java
+===================================================================
+--- src/main/java/tigase/conf/Configurator.java (revision 1113)
++++ src/main/java/tigase/conf/Configurator.java (working copy)
+@@ -328,7 +328,7 @@
+ "tigase.util.LogFormatter");
+ defaults.put(LOGGING_KEY + "java.util.logging.FileHandler.limit", "10000000");
+ defaults.put(LOGGING_KEY + "java.util.logging.FileHandler.pattern",
+- "logs/tigase.log");
++ "/var/log/tigase.log");
+ defaults.put(LOGGING_KEY + "tigase.useParentHandlers", "true");
+ if (params.get(GEN_DEBUG) != null) {
+ defaults.put(LOGGING_KEY + ".level", "INFO");
+Index: src/main/java/tigase/io/SSLContextContainerIfc.java
+===================================================================
+--- src/main/java/tigase/io/SSLContextContainerIfc.java (revision 1113)
++++ src/main/java/tigase/io/SSLContextContainerIfc.java (working copy)
+@@ -70,7 +70,7 @@
+ * JKS keystore file.
+ */
+ public static final String JKS_KEYSTORE_FILE_VAL =
+- "certs" + File.separator + "rsa-keystore";
++ "/var/lib/tigase/certificates" + File.separator + "rsa-keystore";
+ /**
+ * Constant <code>JKS_KEYSTORE_PWD_KEY</code> is a key pointing to a private
+ * key password,
+@@ -90,7 +90,7 @@
+ * Constant <code>TRUSTSTORE_FILE_VAL</code> is a default truststore file.
+ */
+ public static final String TRUSTSTORE_FILE_VAL =
+- "certs" + File.separator + "truststore";
++ "/var/lib/tigase/certificates" + File.separator + "truststore";
+ /**
+ * Constant <code>TRUSTSTORE_PWD_KEY</code> is a key pointing to a trustore
+ * file password.
+@@ -118,7 +118,7 @@
+ * where all certificate files are stored.
+ *
+ */
+- public static final String SERVER_CERTS_DIR_VAL = "certs/";
++ public static final String SERVER_CERTS_DIR_VAL = "/var/lib/tigase/certificates";
+ /**
+ * Constant <code>TRUSTED_CERTS_DIR_KEY</code> is a key pointing to a configuration
+ * parameter where all trusted certificates are stored.
diff --git a/net-im/tigase-server/files/init_d_tigase b/net-im/tigase-server/files/init_d_tigase
new file mode 100644
index 000000000..d47e07334
--- /dev/null
+++ b/net-im/tigase-server/files/init_d_tigase
@@ -0,0 +1,41 @@
+#!/sbin/runscript
+
+depend() {
+ need net
+ use dns logger
+}
+
+checkconfig() {
+ if [ ! -e ${TIGASE_CONFIG} ] ; then
+ eerror "No config file!"
+ eerror "Stop the server and edit config file ${TIGASE_CONFIG} to your needs before running the service"
+ fi
+}
+
+start() {
+ source /etc/conf.d/tigase
+ checkconfig
+
+ ebegin "Starting Tigase"
+
+ start-stop-daemon --user ${TIGASE_USER} --start --quiet --background --pidfile /var/run/tigase --make-pidfile --exec /usr/bin/java -- ${JAVA_OPTIONS} -classpath ${CLASSPATH} tigase.server.XMPPServer -c ${TIGASE_CONFIG} ${TIGASE_OPTIONS}
+ eend $?
+}
+
+stop () {
+ ebegin "Stopping Tigase"
+ start-stop-daemon -u tigase --stop --quiet --pidfile /var/run/tigase
+ sleep 2
+ eend $?
+}
+
+svc_restart () {
+ source /etc/conf.d/tigase
+
+ ebegin "Restarting Tigase"
+
+ start-stop-daemon -u tigase --stop --quiet --pidfile /var/run/tigase
+ sleep 5
+ start-stop-daemon --user ${TIGASE_USER} --start --quiet --background --pidfile /var/run/tigase --make-pidfile --exec /usr/bin/java -- ${JAVA_OPTIONS} -classpath ${CLASSPATH} tigase.server.XMPPServer -c ${TIGASE_CONFIG} ${TIGASE_OPTIONS}
+ eend $?
+}
diff --git a/net-im/tigase-server/metadata.xml b/net-im/tigase-server/metadata.xml
new file mode 100644
index 000000000..7e3286984
--- /dev/null
+++ b/net-im/tigase-server/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>maintainer-wanted</herd>
+</pkgmetadata>
diff --git a/net-im/tigase-server/tigase-server-9999_pre2.ebuild b/net-im/tigase-server/tigase-server-9999_pre2.ebuild
new file mode 100644
index 000000000..4901264df
--- /dev/null
+++ b/net-im/tigase-server/tigase-server-9999_pre2.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+JAVA_PKG_IUSE="doc source"
+
+ESVN_REPO_URI="https://svn.tigase.org/reps/tigase-server/trunk"
+
+inherit subversion java-pkg-2 eutils
+
+DESCRIPTION="Tigase XMPP server"
+HOMEPAGE="http://www.tigase.org"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+DEPEND=">=dev-java/ant-1.7
+ >=dev-java/tigase-xmltools-3.0
+ >=dev-java/tigase-utils-3.1
+ >=virtual/jdk-1.6.0"
+
+RDEPEND=">=dev-java/tigase-xmltools-3.0
+ >=dev-java/tigase-utils-3.1
+ >=virtual/jre-1.6.0"
+
+src_unpack() {
+ subversion_src_unpack
+ cd "${S}"
+ ant clean-all
+
+ EPATCH_OPTIONS="--ignore-whitespace"
+
+ #Edit classpaths for ant to fit gentoo way
+ epatch "${FILESDIR}/classpaths.patch"
+
+ sed -i -e "s:libs=libs:xmltoolsjar=$(java-pkg_getjar tigase-xmltools tigase-xmltools.jar)\nutilsjar=$(java-pkg_getjar tigase-utils tigase-utils.jar):" build.properties || die "Failed to patch build properties with correct jar locations"
+
+ #Make default config more gentoo'ish
+ epatch "${FILESDIR}/default_config.patch"
+}
+
+src_compile() {
+ ant jar || die "Compile failed"
+ if use doc; then
+ ant docs || die "Docs failed"
+ fi
+}
+
+src_install() {
+ java-pkg_dojar jars/*.jar
+
+ use doc && java-pkg_dojavadoc docs-tigase-server/api
+ use source && java-pkg_dosrc src/main/java/
+
+ newconfd "${FILESDIR}/conf_d_tigase" tigase
+ newinitd "${FILESDIR}/init_d_tigase" tigase
+
+ insinto /var/lib/tigase/certificates
+ insopts -m0600
+ doins certs/*
+}
+
+pkg_preinst() {
+ enewgroup tigase
+ enewuser tigase -1 -1 /dev/null tigase
+
+ fowners -R tigase:tigase /var/lib/tigase
+}
+
+pkg_postinst() {
+ sed -i -e "s|CLASSPATH=.*|&:$(java-pkg_getjar tigase-xmltools tigase-xmltools.jar):$(java-pkg_getjar tigase-utils tigase-utils.jar):$(java-pkg_getjar tigase-server tigase-server.jar)|" /etc/conf.d/tigase || die "Failed to configure conf.d file"
+ elog "Remember to change config file and conf.d file to your needs."
+ elog "Config file is default generated by server is not present."
+ elog ""
+}