Subject: [alpine-devel] New aport: OpenXCAP Presence Server plus dependencies

From: Francesco <[email-masked]>
Date: Wed, 19 May 2010 16:32:13 +0200

As we talk yesterday about presence server, this is the new aport.
OpenXCAP needs some packages, new, for compiling.
Attached there are also these new aports.

Surely need to be reviewed and tested.

Other that, python-application need to be updated to 1.2.4 and twisted at
10.0.0 version.

Thanks.

:: Francesco Colista
:: Email : [email-masked]
:: Jabber: [email-masked]
From af29fda50e97e291455c83267ed2668e6f838c83 Mon Sep 17 00:00:00 2001
From: Francesco Colista <[email-masked]>
Date: Wed, 19 May 2010 14:06:11 +0000
Subject: [PATCH] OpenXCAP Presence Server

---
 testing/openxcap/APKBUILD              |   40 +++++++++++
 testing/openxcap/config.ini            |  118 ++++++++++++++++++++++++++++++++
 testing/openxcap/openxcap.initd        |   23 ++++++
 testing/openxcap/openxcap.post-install |    5 ++
 testing/openxcap/openxcap.pre-install  |    5 ++
 5 files changed, 191 insertions(+), 0 deletions(-)
 create mode 100644 testing/openxcap/APKBUILD
 create mode 100644 testing/openxcap/config.ini
 create mode 100644 testing/openxcap/openxcap.initd
 create mode 100755 testing/openxcap/openxcap.post-install
 create mode 100755 testing/openxcap/openxcap.pre-install

diff --git a/testing/openxcap/APKBUILD b/testing/openxcap/APKBUILD
new file mode 100644
index 0000000..a1263c5
--- /dev/null
+++ b/testing/openxcap/APKBUILD
@@ -0,0 +1,40 @@
+# Contributor: Francesco Colista <[email-masked]>
+# Maintainer: Francesco Colista <[email-masked]>
+
+pkgname=openxcap
+pkgver=1.2.0
+pkgrel=2
+pkgdesc="Open source fully featured XCAP server "
+url="http://openxcap.org"
+pkgusers="openxcap"
+pkggroups="openxcap"
+license="GPL"
+depends="python python-application python-gnutls twisted twisted-web2 python-imaging python-lxml python-mysqldb"
+makedepends=""
+install="$pkgname.pre-install $pkgname.post-install"
+source="http://download.ag-projects.com/XCAP/$pkgname-$pkgver.tar.gz
+	config.ini
+	openxcap.initd
+"
+# append extra dependencies to -dev subpackage
+# remove if not used.
+# depends_dev="somepackage-dev"
+
+build() {
+	cd "$srcdir"/$pkgname-$pkgver
+
+	mkdir -p "$pkgdir"/usr/lib/python2.6/site-packages
+	
+	python setup.py install --root="$pkgdir" || return 1
+	
+	echo "/usr/lib/python2.6/site-packages/$pkgname-$pkgver-py2.6.egg" \
+		> "$pkgdir"/usr/lib/python2.6/site-packages/$pkgname.pth
+
+	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+        install -d -o openxcap "$pkgdir"/var/run/openxcap
+
+}
+
+md5sums="ec34570deee2019a1ebf9a012a476c26  openxcap-1.2.0.tar.gz
+7a18872843586717eaf3879444cc13d2  config.ini
+dad5f337c29c9e245846d9991d057b6e  openxcap.initd"
diff --git a/testing/openxcap/config.ini b/testing/openxcap/config.ini
new file mode 100644
index 0000000..bcf5b22
--- /dev/null
+++ b/testing/openxcap/config.ini
@@ -0,0 +1,118 @@
+;
+; Configuration file for OpenXCAP
+;
+; The values in the commented lines represent the defaults built in the
+; server software
+;
+[Server]
+
+; IP address to listen for requests
+; 0.0.0.0 means any address of this host
+
+; address = 0.0.0.0
+
+; This is a comma separated list of XCAP root URIs. The first is the
+; primary XCAP root URI, while the others (if specified) are aliases.
+; The primary root URI is used when generating xcap-diff
+; If the scheme is https, then the server will listen for requests in TLS mode.
+
+root = http://xcap.example.com/xcap-root
+
+; The backend to be used for storage and authentication. Current supported
+; values are Database and OpenSIPS. OpenSIPS backend inherits all the settings
+; from the Database backend but performs extra actions related to the
+; integration with OpenSIPS for which it read the settings from [OpenSIPS]
+; section
+
+backend = OpenSIPS
+
+; Validate XCAP documents against XML schemas
+
+; document_validation = Yes
+
+
+[Logging]
+
+; Start, stop and major server error messages are always logged to syslog.
+
+; This section can be used to log more details about XCAP clients accessing
+; the server. The values in the commented lines represent the defaults built 
+; in the server software
+
+; Directory where to write access.log file that will contain requests and/or
+; responses to OpenXCAP server in Apache style. If set to an empty string,
+; access logs will be printed to stdout if the server runs in no-fork mode
+; or to syslog if the server runs in the background
+
+; directory=/var/log/openxcap 
+
+; The following parameters control what kind of information (like
+; stacktrace, body or headers) is logged for which response codes. The
+; values must be a comma-separated list of HTTP response codes or the  
+; keyword 'any' that matches all response codes.
+
+; log_stacktrace=500
+; log_response_headers=500
+; log_response_body=500
+; log_request_headers=500
+; log_request_body=500
+
+
+[Authentication]
+
+; The HTTP authentication type, this can be either 'basic' or 'digest'. The
+; standard states 'digest' as the mandatory, however it can be changed to
+; basic
+
+; type = digest
+
+; Specify if the passwords are stored as plain text - Yes
+; or in a hashed format MD5('username:domain:password') - No
+; cleartext_passwords = Yes
+
+; The default authentication realm, if none indicated in the HTTP request
+; URI
+default_realm = example.com
+
+; A comma-separated list of hosts or networks to trust.
+; The elements can be an IP address in CIDR format, a
+; hostname or an IP address (in the latter 2 a mask of 32
+; is assumed), or the special keywords 'any' and 'none'
+; (being equivalent to 0.0.0.0/0 and 0.0.0.0/32
+; respectively).
+; trusted_peers =
+
+
+[TLS]
+
+; Location of X509 certificate and private key that identify this server.
+; The path is relative to /etc/openxcap, or it can be given as an absolute
+; path.
+
+; Server X509 certificate
+; certificate =
+
+; Server X509 private key
+; private_key =
+
+
+[Database]
+
+; The database connection URI for the datase with subscriber accounts
+authentication_db_uri = pgsql://username:password@db/opensips
+
+; The database connection URI for the database that stores the XCAP documents
+storage_db_uri = mysql://username:password@db/opensips
+
+; Authentication and storage tables
+; subscriber_table = subscriber
+; xcap_table = xcap
+
+
+[OpenSIPS]
+
+; The address and port of the xml-rpc management interface
+xmlrpc_url = http://sip.example.com:8080
+
+; Publish xcap-diff event via OpenSIPS management interface 
+; enable_publish_xcapdiff = yes
diff --git a/testing/openxcap/openxcap.initd b/testing/openxcap/openxcap.initd
new file mode 100644
index 0000000..e58a779
--- /dev/null
+++ b/testing/openxcap/openxcap.initd
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+#
+
+daemon=/usr/bin/openxcap
+pidfile=/var/run/openxcap/openxcap.pid"
+
+depend() {
+	 need net
+	 after firewall
+}
+
+start() {
+    	ebegin "Starting OpenXCAP Presence Server"
+	start-stop-daemon --start --quiet --pidfile $pidfile --exec $daemon
+	eend $?
+}
+
+stop() {
+   	ebegin "Stopping OpenXCAP Presence Server"
+	start-stop-daemon --stop --quiet --signal 15 --pidfile $pidfile
+	eend $?
+}
+
diff --git a/testing/openxcap/openxcap.post-install b/testing/openxcap/openxcap.post-install
new file mode 100755
index 0000000..b3dff42
--- /dev/null
+++ b/testing/openxcap/openxcap.post-install
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+chown -R openxcap:openxcap /var/run/openxcap
+chgrp openxcap /etc/openxcap/config.ini
+exit 0
diff --git a/testing/openxcap/openxcap.pre-install b/testing/openxcap/openxcap.pre-install
new file mode 100755
index 0000000..cc2b529
--- /dev/null
+++ b/testing/openxcap/openxcap.pre-install
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+addgroup openxcap 2>/dev/null
+adduser -G openxcap -h /var/run/openxcap -s /bin/false -S -D -H openxcap 2>/dev/null
+exit 0
-- 
1.6.6.1

From 4bc82e6acad5e7ac8af35a35161f9ef67b96d6f7 Mon Sep 17 00:00:00 2001
From: Francesco Colista <[email-masked]>
Date: Wed, 19 May 2010 14:19:59 +0000
Subject: [PATCH] python-imaging library

---
 testing/python-imaging/APKBUILD |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
 create mode 100644 testing/python-imaging/APKBUILD

diff --git a/testing/python-imaging/APKBUILD b/testing/python-imaging/APKBUILD
new file mode 100644
index 0000000..301919f
--- /dev/null
+++ b/testing/python-imaging/APKBUILD
@@ -0,0 +1,22 @@
+# Contributor: Francesco Colista <[email-masked]>
+# Maintainer: Francesco Colista <[email-masked]>
+
+pkgname=python-imaging
+pkgver=1.1.7
+pkgrel=0
+pkgdesc="Python image manipulation library"
+url="http://pypi.python.org/pypi/PLI"
+license="PSF"
+depends="python"
+makedepends="python-dev"
+install=
+subpackages=""
+source="http://effbot.org/downloads/Imaging-$pkgver.tar.gz"
+build() {
+	cd "$srcdir"/Imaging-$pkgver
+	mkdir -p "$pkgdir"/usr/lib/python2.6/site-packages
+	python setup.py install --root="$pkgdir"
+
+}
+
+md5sums="fc14a54e1ce02a0225be8854bfba478e  Imaging-1.1.7.tar.gz"
-- 
1.6.6.1

From d66a76586a4b02e2f90f82ec515552c0d094b57d Mon Sep 17 00:00:00 2001
From: Francesco Colista <[email-masked]>
Date: Wed, 19 May 2010 14:20:57 +0000
Subject: [PATCH] python-lxml library

---
 testing/python-lxml/APKBUILD |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
 create mode 100644 testing/python-lxml/APKBUILD

diff --git a/testing/python-lxml/APKBUILD b/testing/python-lxml/APKBUILD
new file mode 100644
index 0000000..39c096e
--- /dev/null
+++ b/testing/python-lxml/APKBUILD
@@ -0,0 +1,30 @@
+# Contributor: Francesco Colista <[email-masked]>
+# Maintainer: Francesco Colista <[email-masked]>
+
+pkgname=python-lxml
+_pkgname=lxml
+pkgver=2.2.6
+pkgrel=0
+pkgdesc="Python LXML Library"
+url="http://codespeak.net/lxml"
+license="GPL"
+depends="libxml2 libxslt"
+makedepends="libxml2-dev libxslt-dev python26-setuptools"
+install=
+#subpackages="$pkgname-dev $pkgname-doc"
+source="http://codespeak.net/lxml/$_pkgname-$pkgver.tgz"
+
+build() {
+	cd "$srcdir"/$_pkgname-$pkgver
+
+	mkdir -p "$pkgdir"/usr/lib/python2.6/site-packages
+	
+	python setup.py install --root="$pkgdir"
+	
+	echo "/usr/lib/python2.6/site-packages/$pkgname-$pkgver-py2.6.egg" > "$pkgdir"/usr/lib/python2.6/site-packages/$pkgname.pth
+
+
+
+}
+
+md5sums="b1f700fb22d7ee9b977ee3eceb65b20c  lxml-2.2.6.tgz"
-- 
1.6.6.1

From 1893101ad05d591e992515a4b3f1fb30d38b6152 Mon Sep 17 00:00:00 2001
From: Francesco Colista <[email-masked]>
Date: Wed, 19 May 2010 14:21:55 +0000
Subject: [PATCH] twisted-web2 for twisted framework

---
 testing/twisted-web2/APKBUILD |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
 create mode 100644 testing/twisted-web2/APKBUILD

diff --git a/testing/twisted-web2/APKBUILD b/testing/twisted-web2/APKBUILD
new file mode 100644
index 0000000..c8afb9c
--- /dev/null
+++ b/testing/twisted-web2/APKBUILD
@@ -0,0 +1,19 @@
+# Contributor: Francesco Colista <[email-masked]>
+# Maintainer: Francesco Colista <[email-masked]>
+
+pkgname=twisted-web2
+pkgver=8.1.0
+pkgrel=0
+pkgdesc="The twisted.web2 package in Twisted."
+url="http://twistedmatrix.com/"
+license="GPL"
+depends="twisted"
+source="http://tmrc.mit.edu/mirror/twisted/Web2/8.1/TwistedWeb2-$pkgver.tar.bz2"
+
+build() {
+    cd $srcdir/TwistedWeb2-8.1.0/
+        python setup.py install --prefix=/usr --root=$pkgdir || return 1
+}
+
+
+md5sums="e34b48edf6fef075bd41ddbd215aed32  TwistedWeb2-8.1.0.tar.bz2"
-- 
1.6.6.1

From 86d2e7c643254fdb9929f55689753ba78257add3 Mon Sep 17 00:00:00 2001
From: Francesco Colista <[email-masked]>
Date: Wed, 19 May 2010 14:23:28 +0000
Subject: [PATCH] python MySQL library

---
 testing/python-mysqldb/APKBUILD |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
 create mode 100644 testing/python-mysqldb/APKBUILD

diff --git a/testing/python-mysqldb/APKBUILD b/testing/python-mysqldb/APKBUILD
new file mode 100644
index 0000000..9fa3910
--- /dev/null
+++ b/testing/python-mysqldb/APKBUILD
@@ -0,0 +1,28 @@
+# Contributor: 
+# Maintainer: 
+pkgname=python-mysqldb
+pkgver=1.2.3c1
+pkgrel=0
+pkgdesc="MySQL Module for python"
+url="http://sourceforge.net/projects/mysql-python/"
+license="GPL"
+depends="python libmysqlclient"
+makedepends="python26-setuptools mysql-dev"
+install=
+source="http://downloads.sourceforge.net/mysql-python/MySQL-python-${pkgver}.tar.gz"
+
+build() {
+	cd "$srcdir"/MySQL-python-$pkgver
+
+	mkdir -p "$pkgdir"/usr/lib/python2.6/site-packages
+
+	python setup.py install --root="$pkgdir"
+
+	echo "/usr/lib/python2.6/site-packages/$pkgname-$pkgver-py2.6.egg" \
+	        > "$pkgdir"/usr/lib/python2.6/site-packages/$pkgname.pth
+
+
+}
+
+
+md5sums="310dd856e439d070b59ece6dd7a0734d  MySQL-python-1.2.3c1.tar.gz"
-- 
1.6.6.1

---

From: Natanael Copa <[email-masked]>
Date: Wed, 19 May 2010 17:36:49 +0200

> Surely need to be reviewed and tested.

cool! thanks!

I wonder if we may want python packages prefixed with py- so we have
py-twisted, py-mysql, py-lxml etc...

we prefix perl modules with perl-* and lua modules with lua-*. Makes
it easy to search for available modules: apk search 'lua-*'

I think I'll apply them as is for now though

> Other that, python-application need to be updated to 1.2.4 and twisted at

Will look at that too.

Thanks!

-- 
Natanael Copa

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Leonardo Arena <[email-masked]>
Date: Thu, 20 May 2010 14:14:27 +0200

> Other that, python-application need to be updated to 1.2.4 and twisted at

Openxcap and twisted-web2 where missing "python-dev" in makedepends.
Python-imaging needed also freetype.
I've fixed them and pushed.

Nice work! Thanks!
leo

---