diff options
Diffstat (limited to 'testing')
74 files changed, 4670 insertions, 0 deletions
diff --git a/testing/bzr/PKGBUILD b/testing/bzr/PKGBUILD new file mode 100644 index 000000000..655bba6dd --- /dev/null +++ b/testing/bzr/PKGBUILD @@ -0,0 +1,33 @@ +# $Id: PKGBUILD 168834 2012-10-16 11:53:33Z allan $ +# Maintainer : +# Contributor: Hugo Doria <hugo@archlinux.org> + +pkgname=bzr +pkgver=2.5.1 +pkgrel=2 +pkgdesc="A decentralized revision control system (bazaar)" +arch=('i686' 'x86_64') +url="http://bazaar.canonical.com/en/" +license=('GPL') +depends=('python2') +optdepends=('python2-paramiko: for sftp support') +source=("http://launchpad.net/${pkgname}/${pkgver%.*}/${pkgver}/+download/${pkgname}-${pkgver}.tar.gz"{,.sig}) +md5sums=('ac5079858364a046071000d5cdccb67b' + 'c83dd08dd2c3e27edbab873500d7d6eb') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + sed -i 's|man/man1|share/man/man1|' setup.py + sed -i 's|/usr/bin/env python|/usr/bin/env python2|' \ + bzrlib/{plugins/bash_completion/bashcomp.py,tests/ssl_certs/create_ssls.py,patiencediff.py,_patiencediff_py.py} + python2 setup.py build +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + python2 setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 + + # bash-completion + install -D -m644 contrib/bash/bzr \ + "${pkgdir}/usr/share/bash-completion/completions/bzr" +} diff --git a/testing/gnome-python-desktop/PKGBUILD b/testing/gnome-python-desktop/PKGBUILD new file mode 100644 index 000000000..2c0833284 --- /dev/null +++ b/testing/gnome-python-desktop/PKGBUILD @@ -0,0 +1,107 @@ +# $Id: PKGBUILD 168837 2012-10-16 11:53:40Z allan $ +# Maintainer: Jan de Groot <jgc@archlinux.org> +# Contributor: Arjan Timmerman <arjan@soulfly.nl> +# Contributor: Wael Nasreddine <gandalf@siemens-mobiles.org> + +pkgbase=gnome-python-desktop +pkgname=('gnome-python-desktop' 'python2-gnomedesktop' 'python2-gnomekeyring' 'python2-gtop' 'python2-metacity' 'python2-rsvg' 'python2-totem-plparser' 'python2-wnck') +pkgver=2.32.0 +pkgrel=11 +arch=(i686 x86_64) +license=('GPL' 'LGPL') +options=('!libtool') +makedepends=('intltool' 'pkg-config' 'gnome-python' 'libgtop' 'totem-plparser' 'gnome-desktop2' 'metacity' 'librsvg' 'libwnck') +url="http://www.gnome.org" +source=(http://ftp.gnome.org/pub/gnome/sources/${pkgbase}/2.32/${pkgbase}-${pkgver}.tar.bz2 + gnome-python-desktop-2.32.0-metacity-build.patch) +sha256sums=('09dbd580bf3b0ef60f91b090eafe6d08ddcc50a609e2b425a7f8eca46d4e0ee9' + 'f012f9bd2f9baa527f07ad2f6e312c875bb6f2d3204270a1b053278a3a0c86b3') + +build() { + cd "${srcdir}/${pkgbase}-${pkgver}" + patch -p1 -i ../gnome-python-desktop-2.32.0-metacity-build.patch + PYTHON=/usr/bin/python2 ./configure --prefix=/usr --enable-metacity + make +} + +package_gnome-python-desktop() { + depends=('python2-gnomedesktop' 'python2-gnomekeyring' 'python2-gtop' 'python2-metacity' 'python2-rsvg' 'python2-totem-plparser' 'python2-wnck' 'gnome2-python') + pkgdesc="Python bindings for the GNOME desktop environment" + + cd "${srcdir}/${pkgbase}-${pkgver}" + make install-pkgconfigDATA DESTDIR="${pkgdir}" +} + +package_python2-gnomedesktop() { + depends=('pygtk' 'gnome-desktop2' 'python2-gnomevfs') + pkgdesc="Python bindings for gnome-desktop 2.x" + conflicts=('python-gnomedesktop<=2.32.0-10') + replaces=('python-gnomedesktop<=2.32.0-10') + + cd "${srcdir}/${pkgbase}-${pkgver}" + make -C gnomedesktop install DESTDIR="${pkgdir}" +} + +package_python2-gnomekeyring() { + depends=('pygtk' 'libgnome-keyring') + pkgdesc="Python bindings for libgnome-keyring" + conflicts=('python-gnomekeyring<=2.32.0-10') + replaces=('python-gnomekeyring<=2.32.0-10') + + cd "${srcdir}/${pkgbase}-${pkgver}" + make -C gnomekeyring install DESTDIR="${pkgdir}" +} + +package_python2-gtop() { + depends=('pygtk' 'libgtop') + pkgdesc="Python bindings for libgtop" + conflicts=('python-gtop<=2.32.0-10') + replaces=('python-gtop<=2.32.0-10') + + cd "${srcdir}/${pkgbase}-${pkgver}" + make -C gtop install DESTDIR="${pkgdir}" +} + +package_python2-metacity() { + depends=('pygtk' 'metacity') + pkgdesc="Python bindings for metacity" + conflicts=('python-metacity<=2.32.0-10') + replaces=('python-metacity<=2.32.0-10') + + cd "${srcdir}/${pkgbase}-${pkgver}" + make -C metacity install DESTDIR="${pkgdir}" +} + +package_python2-rsvg() { + depends=('pygtk' 'librsvg') + pkgdesc="Python bindings for librsvg" + conflicts=('python-rsvg<=2.32.0-10') + replaces=('python-rsvg<=2.32.0-10') + + cd "${srcdir}/${pkgbase}-${pkgver}" + make -C rsvg install DESTDIR="${pkgdir}" + install -m755 -d "${pkgdir}/usr/share/pygtk/2.0/defs" + install -m644 rsvg/rsvg.defs "${pkgdir}/usr/share/pygtk/2.0/defs/" +} + +package_python2-totem-plparser() { + depends=('pygtk' 'totem-plparser' 'python2-gnomevfs') + pkgdesc="Python bindings for totem-plparser" + conflicts=('python-totem-plparser<=2.32.0-10') + replaces=('python-totem-plparser<=2.32.0-10') + + cd "${srcdir}/${pkgbase}-${pkgver}" + make -C totem install DESTDIR="${pkgdir}" + install -m755 -d "${pkgdir}/usr/share/pygtk/2.0/defs" + install -m644 totem/plparser.defs "${pkgdir}/usr/share/pygtk/2.0/defs/" +} + +package_python2-wnck() { + depends=('pygtk' 'libwnck') + pkgdesc="Python bindings for libwnck" + conflicts=('python-wnck<=2.32.0-10') + replaces=('python-wnck<=2.32.0-10') + + cd "${srcdir}/${pkgbase}-${pkgver}" + make -C wnck install DESTDIR="${pkgdir}" +} diff --git a/testing/gnome-python-desktop/gnome-python-desktop-2.32.0-metacity-build.patch b/testing/gnome-python-desktop/gnome-python-desktop-2.32.0-metacity-build.patch new file mode 100644 index 000000000..5054dd2bd --- /dev/null +++ b/testing/gnome-python-desktop/gnome-python-desktop-2.32.0-metacity-build.patch @@ -0,0 +1,42 @@ +From: Daniel Drake <dsd@laptop.org> + +Fix build against metacity-2.34.2. The port to GSettings +removed these constants from the codebase. + +Index: gnome-python-desktop-2.32.0/metacity/metacity.defs +=================================================================== +--- gnome-python-desktop-2.32.0.orig/metacity/metacity.defs ++++ gnome-python-desktop-2.32.0/metacity/metacity.defs +@@ -120,32 +120,6 @@ + ) + ) + +-(define-enum FocusMode +- (in-module "Meta") +- (c-name "MetaFocusMode") +-; (gtype-id "META_TYPE_FOCUS_MODE") +- (values +- '("click" "META_FOCUS_MODE_CLICK") +- '("sloppy" "META_FOCUS_MODE_SLOPPY") +- '("mouse" "META_FOCUS_MODE_MOUSE") +- ) +-) +- +-(define-enum ActionTitlebar +- (in-module "Meta") +- (c-name "MetaActionTitlebar") +-; (gtype-id "META_TYPE_ACTION_TITLEBAR") +- (values +- '("toggle-shade" "META_ACTION_TITLEBAR_TOGGLE_SHADE") +- '("toggle-maximize" "META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE") +- '("minimize" "META_ACTION_TITLEBAR_MINIMIZE") +- '("none" "META_ACTION_TITLEBAR_NONE") +- '("lower" "META_ACTION_TITLEBAR_LOWER") +- '("menu" "META_ACTION_TITLEBAR_MENU") +- '("last" "META_ACTION_TITLEBAR_LAST") +- ) +-) +- + (define-enum FrameType + (in-module "Meta") + (c-name "MetaFrameType") diff --git a/testing/kdebase-workspace/kdm.logrotate b/testing/kdebase-workspace/kdm.logrotate new file mode 100644 index 000000000..34331feae --- /dev/null +++ b/testing/kdebase-workspace/kdm.logrotate @@ -0,0 +1,6 @@ +/var/log/kdm.log { + maxage 365 + size=+1024k + notifempty + missingok +} diff --git a/testing/kdebindings-python/pyqt495.patch b/testing/kdebindings-python/pyqt495.patch new file mode 100644 index 000000000..b8a9df258 --- /dev/null +++ b/testing/kdebindings-python/pyqt495.patch @@ -0,0 +1,95 @@ +From: Luca Beltrame <lbeltrame@kde.org> +Date: Mon, 01 Oct 2012 18:47:56 +0000 +Subject: Remove duplicated QVector<int> definition, since it's in PyQt now. +X-Git-Url: http://quickgit.kde.org/?p=pykde4.git&a=commitdiff&h=017822bd0dfc83fe9a7a483ecc33f4aab839a3c6 +--- +Remove duplicated QVector<int> definition, since it's in PyQt now. +Simon, if you have time, please review if everything is OK. + +CCMAIL: simon@simonzone.com +--- + + +--- a/sip/kdecore/typedefs.sip ++++ b/sip/kdecore/typedefs.sip +@@ -951,78 +951,4 @@ + %End + }; + +-%MappedType QVector<int> +-{ +-%TypeHeaderCode +-#include <qvector.h> +-%End +- +-%ConvertFromTypeCode +- // Create the list. +- PyObject *l; +- +- if ((l = PyList_New(sipCpp->size())) == NULL) +- return NULL; +- +- // Set the list elements. +- for (int i = 0; i < sipCpp->size(); ++i) +- { +- int t = (sipCpp->at(i)); +- +-#if PY_MAJOR_VERSION >= 3 +- PyObject *tobj = PyLong_FromLong(t); +-#else +- PyObject *tobj = PyInt_FromLong(t); +-#endif +- +- PyList_SET_ITEM(l, i, tobj); +- } +- +- return l; +-%End +- +-%ConvertToTypeCode +- // Check the type if that is all that is required. +- if (sipIsErr == NULL) +- { +- if (!PyList_Check(sipPy)) +- return 0; +- +- for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) { +- PyObject *tobj = PyList_GET_ITEM(sipPy, i); +-#if PY_MAJOR_VERSION >= 3 +- if (!PyNumber_Check(tobj)) +-#else +- if (!PyInt_Check(tobj)) +-#endif +- return 0; +- } +- return 1; +- } +- +- QVector<int> *qv = new QVector<int>; +- +- for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) +- { +- PyObject *tobj = PyList_GET_ITEM(sipPy, i); +- #if PY_MAJOR_VERSION >= 3 +- int t = PyLong_AsLong (tobj); +-#else +- int t = PyInt_AS_LONG (tobj); +-#endif +- +- if (*sipIsErr) +- { +- delete qv; +- return 0; +- } +- +- qv->append(t); +- } +- +- *sipCppPtr = qv; +- +- return sipGetState(sipTransferObj); +-%End +-}; +- ++ + diff --git a/testing/konversation/PKGBUILD b/testing/konversation/PKGBUILD new file mode 100644 index 000000000..6bd3741cd --- /dev/null +++ b/testing/konversation/PKGBUILD @@ -0,0 +1,41 @@ +# $Id: PKGBUILD 168841 2012-10-16 11:53:50Z allan $ +# Maintainer: Stéphane Gaudreault <stephane@archlinux.org> +# Contributor: Andrea Scarpino <andrea@archlinux.org> +# Contributor: James Rayner <iphitus@gmail.com> +# Contributor: Sergio Jovani Guzman <moret@paretux.org> + +pkgname=konversation +pkgver=1.4 +pkgrel=3 +pkgdesc="A user friendly IRC client for KDE" +arch=('i686' 'x86_64') +url="http://konversation.kde.org" +depends=('kdebase-runtime' 'kdepimlibs') +makedepends=('automoc4' 'cmake' 'pkgconfig' 'docbook-xml') +optdepends=('python: python scripting support') +license=('GPL2' 'FDL') +install=${pkgname}.install +options=('!makeflags') +source=("http://download.kde.org/stable/${pkgname}/${pkgver}/src/${pkgname}-${pkgver}.tar.xz") +sha1sums=('90741721f68a02d4345b9006a8ae53bc49ef3777') + +build() { + cd "${srcdir}" + mkdir build + cd build + cmake ../${pkgname}-${pkgver} \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_SKIP_RPATH=ON \ + -DCMAKE_INSTALL_PREFIX=/usr + make +} + +package() { + cd "${srcdir}"/build + make DESTDIR="${pkgdir}" install + + # Remove a bunch of symlinks pointing to non-existant files + for _lang in pt_BR uk sv et de en nl; do + rm "${pkgdir}"/usr/share/doc/kde/html/${_lang}/konversation/common + done +} diff --git a/testing/konversation/konversation.install b/testing/konversation/konversation.install new file mode 100644 index 000000000..8834e059a --- /dev/null +++ b/testing/konversation/konversation.install @@ -0,0 +1,12 @@ +post_install() { + xdg-icon-resource forceupdate --theme hicolor &> /dev/null + update-desktop-database -q +} + +post_upgrade() { + post_install +} + +post_remove() { + post_install +} diff --git a/testing/mod_wsgi/PKGBUILD b/testing/mod_wsgi/PKGBUILD new file mode 100644 index 000000000..24c2d0767 --- /dev/null +++ b/testing/mod_wsgi/PKGBUILD @@ -0,0 +1,28 @@ +# $Id: PKGBUILD 168687 2012-10-14 04:16:02Z eric $ +# Maintainer: Andrea Scarpino <andrea@archlinux.org> +# Contributor: Ryan Coyner <rcoyner@gmail.com> + +pkgname=mod_wsgi +pkgver=3.4 +pkgrel=1 +pkgdesc="Python WSGI adapter module for Apache" +arch=('i686' 'x86_64') +url="http://www.modwsgi.org/" +license=('APACHE') +depends=('apache' 'python2') +install=mod_wsgi.install +source=("http://modwsgi.googlecode.com/files/${pkgname}-${pkgver}.tar.gz") +md5sums=('f42d69190ea0c337ef259cbe8d94d985') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + ./configure --prefix=/usr \ + --with-apxs=/usr/sbin/apxs \ + --with-python=/usr/bin/python2 + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install +} diff --git a/testing/mod_wsgi/mod_wsgi.install b/testing/mod_wsgi/mod_wsgi.install new file mode 100644 index 000000000..d26d61631 --- /dev/null +++ b/testing/mod_wsgi/mod_wsgi.install @@ -0,0 +1,14 @@ +post_install() { +/bin/cat << ENDOFMESSAGE +==> +==> +==> To install mod_wsgi, add the following line in +==> /etc/httpd/conf/httpd.conf file : +==> +==> LoadModule wsgi_module modules/mod_wsgi.so +==> +==> and restart/reload Apache. +==> +==> +ENDOFMESSAGE +} diff --git a/testing/nfs-utils/PKGBUILD b/testing/nfs-utils/PKGBUILD new file mode 100644 index 000000000..2392879c2 --- /dev/null +++ b/testing/nfs-utils/PKGBUILD @@ -0,0 +1,105 @@ +# $Id: PKGBUILD 168633 2012-10-13 16:48:28Z thomas $ +# Maintainer: Tobias Powalowski <tpowa@archlinux.org> +# Contributor: John Proctor <jproctor@prium.net> +# Contributor: dibblethewrecker <dibblethewrecker.at.jiwe.org> +# Contributor: abelstr <abel@pinklf.eu> +# Contributor: Marco Lima <cipparello gmail com> + +pkgname=nfs-utils +pkgver=1.2.6 +pkgrel=2 +pkgdesc="Support programs for Network File Systems" +arch=('i686' 'x86_64') +url='http://nfs.sourceforge.net' +license=('GPL') +backup=(etc/{exports,idmapd.conf,nfsmount.conf} etc/conf.d/{nfs-common.conf,nfs-server.conf}) +depends=('glibc' 'e2fsprogs' 'rpcbind' 'libtirpc>=0.2.1' 'librpcsecgss>=0.19-2' 'nfsidmap' 'libevent>=2.0.10' 'libgssglue' 'device-mapper') +makedepends=('pkgconfig' 'autoconf' 'automake') +source=(http://downloads.sourceforge.net/project/nfs/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.bz2 + nfs-common + nfs-common.conf + nfs-server + nfs-server.conf + exports + idmapd.conf + start-statd.patch + nfs + nfs-utils-1.1.4-mtab-sym.patch + nfs-utils-1.1.4-no-exec.patch + rpc-gssd.service + rpc-mountd.service + rpc-svcgssd.service + rpc-idmapd.service + rpc-statd.service + nfsd.service + var-lib-nfs-rpc_pipefs.mount + proc-fs-nfsd.mount + blkmapd.service + nfs-utils.conf) +install=nfs-utils.install +md5sums=('8be543ca270c2234ff18f8c8d35e0d37' + 'dd0d65fc6e8f422fa12520813098264b' + 'f73f197a16b02c3e248488ec35c4cf43' + 'e619f18354ff958ed624d05d08853d8f' + '9cef69bc686cc5dcac23fbb51450747d' + 'ff585faf410a62c4333a027c50b56bae' + 'eb4f4027fab6fc1201f1ca04f5954c76' + 'e9144277a89a620d9bc80413158a7d27' + 'f5e7bba09a46c5c5d7007cac6eff9df5' + '7674106eaaa4c149bccd4f05fe3604e9' + '4f4827dfc93008dfadd0a530ad0872b2' + '3694619813cebc5b4502b58f1992b442' + '965311784d49a7d126d512cadbe91deb' + 'e05705d9ccccaeaeb1ecaee20adc05bc' + '359d84a85f8781dc3f45f4cf1dbe4b53' + 'c82ef7b238efe62af3d5e263e1ba1c5c' + '5d33d2e754fd37280365b287603bac90' + '1cd65909fa0983047f3f06a3ab352401' + '02a34835aa077146a90eb7d191e612d0' + '8ffc2ebe932d29efe17d6f3f23d5b975' + '8ac484023d786766d287ccbe878ae4ba') + +build() { + cd $srcdir/${pkgname}-${pkgver} + patch -Np1 -i ../nfs-utils-1.1.4-mtab-sym.patch + #patch -Np1 -i ../nfs-utils-1.1.4-no-exec.patch + # arch specific patch + patch -Np0 -i $srcdir/start-statd.patch + + ./configure --prefix=/usr --enable-nfsv4 --enable-nfsv41 --enable-gss \ + --without-tcp-wrappers --with-statedir=/var/lib/nfs \ + --enable-ipv6 --sysconfdir=/etc --enable-libmount-mount \ + --enable-mountconfig + + make +} + +package() { + cd $srcdir/${pkgname}-${pkgver} + # fix make install + mkdir -p $pkgdir/sbin + make DESTDIR=$pkgdir install + + # support python2 (FS#25120) + sed -i '1s/python$/python2/' "$pkgdir"/usr/sbin/{nfsiostat,mountstats} + + # NFS & NFSv4 init scripts + install -D -m 755 ../nfs-common "$pkgdir/"etc/rc.d/nfs-common + install -D -m 755 ../nfs-server "$pkgdir/"etc/rc.d/nfs-server + # Configuration + install -D -m 644 ../exports "$pkgdir/"etc/exports + install -D -m 644 ../idmapd.conf "$pkgdir/"etc/idmapd.conf + install -D -m 644 ../nfs-common.conf "$pkgdir/"etc/conf.d/nfs-common.conf + install -D -m 644 ../nfs-server.conf "$pkgdir/"etc/conf.d/nfs-server.conf + install -D -m 644 ../nfs "$pkgdir/"etc/conf.d/nfs + install -D -m 644 utils/mount/nfsmount.conf "$pkgdir/"etc/nfsmount.conf + # systemd files + for i in ${srcdir}/*.{service,mount}; do + install -D -m 644 $i "$pkgdir/usr/lib/systemd/system/${i##*/}" + done + install -D -m 644 ../nfs-utils.conf "$pkgdir/"usr/lib/modules-load.d/nfs-utils.conf + # directories + mkdir "$pkgdir/"etc/exports.d + mkdir "$pkgdir/"var/lib/nfs/rpc_pipefs + mkdir "$pkgdir/"var/lib/nfs/v4recovery +} diff --git a/testing/nfs-utils/blkmapd.service b/testing/nfs-utils/blkmapd.service new file mode 100644 index 000000000..16cb68bbb --- /dev/null +++ b/testing/nfs-utils/blkmapd.service @@ -0,0 +1,11 @@ +[Unit] +Description=pNFS block layout mapping daemon +After=var-lib-nfs-rpc_pipefs.mount nfsd.service +Requires=var-lib-nfs-rpc_pipefs.mount + +[Service] +Type=forking +ExecStart=/usr/sbin/blkmapd + +[Install] +WantedBy=multi-user.target diff --git a/testing/nfs-utils/exports b/testing/nfs-utils/exports new file mode 100644 index 000000000..8f4aac598 --- /dev/null +++ b/testing/nfs-utils/exports @@ -0,0 +1,15 @@ +# /etc/exports +# +# List of directories exported to NFS clients. See exports(5). +# Use exportfs -arv to reread. +# +# Example for NFSv2 and NFSv3: +# /srv/home hostname1(rw,sync) hostname2(ro,sync) +# +# Example for NFSv4: +# /srv/nfs4 hostname1(rw,sync,fsid=0) +# /srv/nfs4/home hostname1(rw,sync,nohide) +# Using Kerberos and integrity checking: +# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt) +# /srv/nfs4/home gss/krb5i(rw,sync,nohide) +# diff --git a/testing/nfs-utils/idmapd.conf b/testing/nfs-utils/idmapd.conf new file mode 100644 index 000000000..b1b23afe9 --- /dev/null +++ b/testing/nfs-utils/idmapd.conf @@ -0,0 +1,14 @@ +[General] + +Verbosity = 0 +Pipefs-Directory = /var/lib/nfs/rpc_pipefs +Domain = localdomain + +[Mapping] + +Nobody-User = nobody +Nobody-Group = nobody + +[Translation] + +Method = nsswitch diff --git a/testing/nfs-utils/nfs b/testing/nfs-utils/nfs new file mode 100644 index 000000000..2d33cf3d4 --- /dev/null +++ b/testing/nfs-utils/nfs @@ -0,0 +1,40 @@ +# +# Optinal options passed to rquotad +RPCRQUOTADOPTS="" +# +# Optional arguments passed to in-kernel lockd +#LOCKDARG= +# TCP port rpc.lockd should listen on. +#LOCKD_TCPPORT=32803 +# UDP port rpc.lockd should listen on. +#LOCKD_UDPPORT=32769 +# +# Optional arguments passed to rpc.nfsd. See rpc.nfsd(8) +RPCNFSDARGS="" +# Number of nfs server processes to be started. +# The default is 8. +RPCNFSDCOUNT=8 +# Set V4 grace period in seconds +#NFSD_V4_GRACE=90 +# +# Optional arguments passed to rpc.mountd. See rpc.mountd(8) +RPCMOUNTDOPTS="" +# +# Optional arguments passed to rpc.statd. See rpc.statd(8) +STATDARG="" +# +# Optional arguments passed to rpc.idmapd. See rpc.idmapd(8) +RPCIDMAPDARGS="" +# +# Optional arguments passed to rpc.gssd. See rpc.gssd(8) +RPCGSSDARGS="" +# +# Optional arguments passed to rpc.svcgssd. See rpc.svcgssd(8) +RPCSVCGSSDARGS="" +# +# To enable RDMA support on the server by setting this to +# the port the server should listen on +#RDMA_PORT=20049 +# +# Optional arguments passed to blkmapd. See blkmapd(8) +BLKMAPDARGS="" diff --git a/testing/nfs-utils/nfs-common b/testing/nfs-utils/nfs-common new file mode 100644 index 000000000..7b16b4b3c --- /dev/null +++ b/testing/nfs-utils/nfs-common @@ -0,0 +1,315 @@ +#!/bin/bash + +daemon_name=nfs-common + +NEED_STATD= +STATD_OPTS= +NEED_IDMAPD= +IDMAPD_OPTS= +NEED_GSSD= +GSSD_OPTS= +PIPEFS_MOUNTPOINT= +PIPEFS_MOUNTOPTS= + +# rpc.statd daemon & binary location +STATD_DAEMON_NAME=rpc.statd +STATD="/usr/sbin/rpc.statd" + +# rpc.idmapd daemon & binary location +IDMAPD_DAEMON_NAME=rpc.idmapd +IDMAPD="/usr/sbin/rpc.idmapd" + +# rpc.gssd daemon & binary location +GSSD_DAEMON_NAME=rpc.gssd +GSSD="/usr/sbin/rpc.gssd" + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/$daemon_name.conf + +# Default mountpoint and options for rpc_pipefs filesystem +[ -z "$PIPEFS_MOUNTPOINT" ] && PIPEFS_MOUNTPOINT="/var/lib/nfs/rpc_pipefs" +[ -z "$PIPEFS_MOUNTOPTS" ] && PIPEFS_MOUNTOPTS="defaults" + +# Parse the fstab file, and determine whether we need idmapd and gssd. (The +# /etc/conf.d/nfs-common settings, if any, will override our autodetection.) +AUTO_NEED_IDMAPD=no +AUTO_NEED_GSSD=no + +if [ -f /etc/fstab ]; then + exec 9<&0 </etc/fstab + + while read DEV MTPT FSTYPE OPTS REST; do + if [ "$FSTYPE" = "nfs4" ]; then + AUTO_NEED_IDMAPD=yes + fi + case "$OPTS" in + sec=krb5|*,sec=krb5|sec=krb5,*|*,sec=krb5i,*|sec=krb5i|*,sec=krb5i|sec=krb5i,*|*,sec=krb5i,*|sec=krb5p|*,sec=krb5p|sec=krb5p,*|*,sec=krb5p,*) + AUTO_NEED_GSSD=yes + ;; + esac + done + + exec 0<&9 9<&- +fi + +# We also need idmapd if we run an NFSv4 server. It's fairly difficult +# to autodetect whether there are NFSv4 exports or not, and idmapd is not a +# particularily heavy daemon, so we auto-enable it if we find an /etc/exports +# file. This does not mean that there are NFSv4 or other mounts active (or +# even that nfs-kernel-server is installed), but it matches what the "start" +# condition in nfs-kernel-server's init script does, which has a value in +# itself. +if [ -f /etc/exports ] && grep -q '^[[:space:]]*[^#]*/' /etc/exports; then + AUTO_NEED_IDMAPD=yes +fi + +case "$NEED_STATD" in + yes|no) + ;; + *) + NEED_STATD=yes + ;; +esac + +case "$NEED_IDMAPD" in + yes|no) + ;; + *) + NEED_IDMAPD=$AUTO_NEED_IDMAPD + ;; +esac + +case "$NEED_GSSD" in + yes|no) + ;; + *) + NEED_GSSD=$AUTO_NEED_GSSD + ;; +esac + +do_modprobe() { + if [ -x /sbin/modprobe -a -f /proc/modules ]; then + modprobe -q "$1" || true + fi +} + +do_mount() { + if ! grep -E "$1\$" /proc/filesystems &> /dev/null ; then + return 1 + fi + + if grep -vw "$1" /proc/mounts &> /dev/null ; then + if ! mountpoint -q "$2" ; then + mount -t "$1" "$1" "$2" -o "$3" + return + fi + fi + return 0 +} + +do_umount() { + if mountpoint -q "$1" ; then + umount "$1" + fi + return 0 +} + +get_pid() { + pidof -o %PPID "$1" +} + +case "$1" in + start) + ck_daemon rpcbind && { echo -n "Start rpcbind first." >&2; stat_die; } + rc=0 + if [ "$NEED_STATD" = yes ]; then + stat_busy "Starting $STATD_DAEMON_NAME daemon" + PID=$(get_pid $STATD) + if [ -z "$PID" ]; then + [ -f /var/run/$STATD_DAEMON_NAME.pid ] && rm -f /var/run/$STATD_DAEMON_NAME.pid + # RUN + $STATD $STATD_OPTS + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + echo $(get_pid $STATD) > /var/run/$STATD_DAEMON_NAME.pid + stat_done + fi + else + stat_fail + exit 1 + fi + # Run sm-notify + /usr/sbin/sm-notify $SMNOTIFY_OPTS + fi + + if [ "$NEED_IDMAPD" = yes ] || [ "$NEED_GSSD" = yes ]; then + stat_busy "Mounting pipefs filesystem" + do_modprobe sunrpc + do_modprobe nfs + do_modprobe nfsd + do_mount rpc_pipefs "$PIPEFS_MOUNTPOINT" "$PIPEFS_MOUNTOPTS" + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + stat_done + fi + + if [ "$NEED_IDMAPD" = yes ]; then + stat_busy "Starting $IDMAPD_DAEMON_NAME daemon" + PID=$(get_pid $IDMAPD) + if [ -z "$PID" ]; then + [ -f /var/run/$IDMAPD_DAEMON_NAME.pid ] && rm -f /var/run/$IDMAPD_DAEMON_NAME.pid + # RUN + $IDMAPD $IDMAPD_OPTS + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + echo $(get_pid $IDMAPD) > /var/run/$IDMAPD_DAEMON_NAME.pid + stat_done + fi + else + stat_fail + exit 1 + fi + fi + + if [ "$NEED_GSSD" = yes ]; then + do_modprobe rpcsec_gss_krb5 + stat_busy "Starting $GSSD_DAEMON_NAME daemon" + PID=$(get_pid $GSSD) + if [ -z "$PID" ]; then + [ -f /var/run/$GSSD_DAEMON_NAME.pid ] && rm -f /var/run/$GSSD_DAEMON_NAME.pid + # RUN + $GSSD $GSSD_OPTS + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + echo $(get_pid $GSSD) > /var/run/$GSSD_DAEMON_NAME.pid + stat_done + fi + else + stat_fail + exit 1 + fi + fi + fi + + add_daemon $daemon_name + ;; + + stop) + rc=0 + if [ "$NEED_IDMAPD" = yes ] || [ "$NEED_GSSD" = yes ]; then + + if [ "$NEED_GSSD" = yes ]; then + stat_busy "Stopping $GSSD_DAEMON_NAME daemon" + PID=$(get_pid $GSSD) + # KILL + [ ! -z "$PID" ] && kill $PID &> /dev/null + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + rm -f /var/run/$GSSD_DAEMON_NAME.pid &> /dev/null + stat_done + fi + fi + + if [ "$NEED_IDMAPD" = yes ]; then + stat_busy "Stopping $IDMAPD_DAEMON_NAME daemon" + PID=$(get_pid $IDMAPD) + # KILL + [ ! -z "$PID" ] && kill $PID &> /dev/null + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + rm -f /var/run/$IDMAPD_DAEMON_NAME.pid &> /dev/null + stat_done + fi + fi + do_umount "$PIPEFS_MOUNTPOINT" 2>/dev/null || true + fi + + if [ "$NEED_STATD" = yes ]; then + stat_busy "Stopping $STATD_DAEMON_NAME daemon" + PID=$(get_pid $STATD) + # KILL + [ ! -z "$PID" ] && kill $PID &> /dev/null + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + rm -f /var/run/$STATD_DAEMON_NAME.pid &> /dev/null + stat_done + fi + fi + + rm_daemon $daemon_name + ;; + + status) + stat_busy "Checking $daemon_name status"; + ck_status $daemon_name + + if [ "$NEED_STATD" = yes ]; then + stat_busy "Daemon $STATD_DAEMON_NAME running" + PID=$(get_pid $STATD) + if [ -z "$PID" ]; then + stat_fail + else + stat_done + fi + fi + + if [ "$NEED_GSSD" = yes ]; then + stat_busy "Daemon $GSSD_DAEMON_NAME running" + PID=$(get_pid $GSSD) + if [ -z "$PID" ]; then + stat_fail + else + stat_done + fi + fi + + if [ "$NEED_IDMAPD" = yes ]; then + stat_busy "Daemon $IDMAPD_DAEMON_NAME running" + PID=$(get_pid $IDMAPD) + if [ -z "$PID" ]; then + stat_fail + else + stat_done + fi + fi + echo + ;; + + restart) + $0 stop + sleep 3 + $0 start + ;; + *) + echo "usage: $0 {start|stop|status|restart}" +esac +exit 0 + diff --git a/testing/nfs-utils/nfs-common.conf b/testing/nfs-utils/nfs-common.conf new file mode 100644 index 000000000..12466b3e5 --- /dev/null +++ b/testing/nfs-utils/nfs-common.conf @@ -0,0 +1,40 @@ +# Parameters to be passed to nfs-common (nfs clients & server) init script. +# + +# If you do not set values for the NEED_ options, they will be attempted +# autodetected; this should be sufficient for most people. Valid alternatives +# for the NEED_ options are "yes" and "no". + +# Do you want to start the statd daemon? It is not needed for NFSv4. +NEED_STATD="" + +# Options to pass to rpc.statd. +# See rpc.statd(8) for more details. +# N.B. statd normally runs on both client and server, and run-time +# options should be specified accordingly. +# STATD_OPTS="-p 32765 -o 32766" +STATD_OPTS="" + +# Options to pass to sm-notify +# e.g. SMNOTIFY_OPTS="-p 32764" +SMNOTIFY_OPTS="" + +# Do you want to start the idmapd daemon? It is only needed for NFSv4. +NEED_IDMAPD="" + +# Options to pass to rpc.idmapd. +# See rpc.idmapd(8) for more details. +IDMAPD_OPTS="" + +# Do you want to start the gssd daemon? It is required for Kerberos mounts. +NEED_GSSD="" + +# Options to pass to rpc.gssd. +# See rpc.gssd(8) for more details. +GSSD_OPTS="" + +# Where to mount rpc_pipefs filesystem; the default is "/var/lib/nfs/rpc_pipefs". +PIPEFS_MOUNTPOINT="" + +# Options used to mount rpc_pipefs filesystem; the default is "defaults". +PIPEFS_MOUNTOPTS="" diff --git a/testing/nfs-utils/nfs-server b/testing/nfs-utils/nfs-server new file mode 100644 index 000000000..6aa609d8c --- /dev/null +++ b/testing/nfs-utils/nfs-server @@ -0,0 +1,299 @@ +#!/bin/bash + +daemon_name=nfs-server + +NFSD_COUNT= +NFSD_OPTS= +NEED_SVCGSSD= +SVCGSSD_OPTS= +MOUNTD_OPTS= +PROCNFSD_MOUNTPOINT= +PROCNFSD_MOUNTOPTS= + +# rpc.nfsd daemon & binary location +NFSD_PROCESS_NAME=nfsd +NFSD_DAEMON_NAME=rpc.nfsd +NFSD="/usr/sbin/rpc.nfsd" + +# rpc.svcgssd daemon & binary location +SVCGSSD_DAEMON_NAME=rpc.svcgssd +SVCGSSD="/usr/sbin/rpc.svcgssd" + +# rpc.idmapd daemon & binary location +IDMAPD_DAEMON_NAME=rpc.idmapd +IDMAPD="/usr/sbin/rpc.idmapd" + +# rpc.mountd daemon & binary location +MOUNTD_DAEMON_NAME=rpc.mountd +MOUNTD="/usr/sbin/rpc.mountd" + +# exortfs binary location +EXPORTFS="/usr/sbin/exportfs" + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/$daemon_name.conf + +# Default number of nfsd servers +[ -z "$NFSD_COUNT" ] && NFSD_COUNT=8 + +# Default mountpoint and options for nfsd filesystem +[ -z "$PROCNFSD_MOUNTPOINT" ] && PROCNFSD_MOUNTPOINT="/proc/fs/nfsd" +[ -z "$PROCNFSD_MOUNTOPTS" ] && PROCNFSD_MOUNTOPTS="rw,nodev,noexec,nosuid" + +case "$NEED_SVCGSSD" in + yes|no) + ;; + *) + NEED_SVCGSSD=no + ;; +esac + +do_modprobe() { + if [ -x /sbin/modprobe -a -f /proc/modules ]; then + modprobe -q "$1" || true + fi +} + +do_mount() { + if ! grep -E "$1\$" /proc/filesystems &> /dev/null ; then + return 1 + fi + + if grep -vw "$1" /proc/mounts &> /dev/null ; then + if ! mountpoint -q "$2" ; then + mount -t "$1" "$1" "$2" -o "$3" + return + fi + fi + return 0 +} + +do_umount() { + if mountpoint -q "$1" ; then + umount "$1" + fi + return 0 +} + +get_pid() { + pidof -o %PPID "$1" +} + +case "$1" in + start) + ck_daemon nfs-common && { echo -n "Start nfs-common first." >&2; stat_die; } + rc=0 + stat_busy "Mounting nfsd filesystem" + do_modprobe nfsd + do_mount nfsd "$PROCNFSD_MOUNTPOINT" "$PROCNFSD_MOUNTOPTS" + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + stat_done + fi + + stat_busy "Exporting all directories" + $EXPORTFS -r + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + stat_done + fi + + stat_busy "Starting $NFSD_DAEMON_NAME daemon" + PID=$(get_pid $NFSD_PROCESS_NAME) + if [ -z "$PID" ]; then + [ -f /var/run/$NFSD_DAEMON_NAME.pid ] && rm -f /var/run/$NFSD_DAEMON_NAME.pid + # RUN + $NFSD $NFSD_OPTS $NFSD_COUNT + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + echo $(get_pid $NFSD_PROCESS_NAME) > /var/run/$NFSD_DAEMON_NAME.pid + stat_done + fi + else + stat_fail + exit 1 + fi + + if [ "$NEED_SVCGSSD" = yes ]; then + do_modprobe rpcsec_gss_krb5 + stat_busy "Starting $SVCGSSD_DAEMON_NAME daemon" + PID=$(get_pid $SVCGSSD) + if [ -z "$PID" ]; then + [ -f /var/run/$SVCGSSD_DAEMON_NAME.pid ] && rm -f /var/run/$SVCGSSD_DAEMON_NAME.pid + # RUN + $SVCGSSD $SVCGSSD_OPTS + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + echo $(get_pid $SVCGSSD) > /var/run/$SVCGSSD_DAEMON_NAME.pid + stat_done + fi + else + stat_fail + exit 1 + fi + fi + + PID=$(get_pid $IDMAPD) + [ ! -z "$PID" ] && kill -SIGHUP $IDMAPD_DAEMON_NAME &> /dev/null + + stat_busy "Starting $MOUNTD_DAEMON_NAME daemon" + PID=$(get_pid $MOUNTD) + if [ -z "$PID" ]; then + [ -f /var/run/$MOUNTD_DAEMON_NAME.pid ] && rm -f /var/run/$MOUNTD_DAEMON_NAME.pid + # RUN + $MOUNTD $MOUNTD_OPTS + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + echo $(get_pid $MOUNTD) > /var/run/$MOUNTD_DAEMON_NAME.pid + stat_done + fi + else + stat_fail + exit 1 + fi + + add_daemon $daemon_name + ;; + + stop) + rc=0 + stat_busy "Stopping $MOUNTD_DAEMON_NAME daemon" + PID=$(get_pid $MOUNTD) + # KILL + [ ! -z "$PID" ] && kill $PID &> /dev/null + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + rm -f /var/run/$MOUNTD_DAEMON_NAME.pid &> /dev/null + stat_done + fi + + if [ "$NEED_SVCGSSD" = yes ]; then + stat_busy "Stopping $SVCGSSD_DAEMON_NAME daemon" + PID=$(get_pid $SVCGSSD) + # KILL + [ ! -z "$PID" ] && kill $PID &> /dev/null + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + rm -f /var/run/$SVCGSSD_DAEMON_NAME.pid &> /dev/null + stat_done + fi + fi + + stat_busy "Stopping $NFSD_DAEMON_NAME daemon" + PID=$(get_pid $NFSD_PROCESS_NAME) + # KILL (SIGINT) + [ ! -z "$PID" ] && kill -2 $PID &> /dev/null + # + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + sleep 1 + PID=$(get_pid $NFSD_PROCESS_NAME) + # KILL (KILL) - just to be sure + [ ! -z "$PID" ] && kill -9 $PID &> /dev/null + # + rm -f /var/run/$NFSD_DAEMON_NAME.pid &> /dev/null + stat_done + fi + + stat_busy "Unexporting all directories" + $EXPORTFS -au + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + stat_done + fi + + # flush everything out of the kernels export table + if mountpoint -q "$PROCNFSD_MOUNTPOINT" ; then + $EXPORTFS -f + fi + do_umount "$PROCNFSD_MOUNTPOINT" 2>/dev/null || true + rm_daemon $daemon_name + ;; + + status) + stat_busy "Checking $daemon_name status"; + ck_status $daemon_name + + stat_busy "Daemon $NFSD_DAEMON_NAME running" + PID=$(get_pid $NFSD_PROCESS_NAME) + if [ -z "$PID" ]; then + stat_fail + else + stat_done + fi + + stat_busy "Daemon $MOUNTD_DAEMON_NAME running" + PID=$(get_pid $MOUNTD) + if [ -z "$PID" ]; then + stat_fail + else + stat_done + fi + + if [ "$NEED_SVCGSSD" = yes ]; then + stat_busy "Daemon $SVCGSSD_DAEMON_NAME running" + PID=$(get_pid $SVCGSSD) + if [ -z "$PID" ]; then + stat_fail + else + stat_done + fi + fi + echo + ;; + + reload) + rc=0 + stat_busy "Re-exporting all directories" + $EXPORTFS -r + rc=$(($rc+$?)) + if [ $rc -gt 0 ]; then + stat_fail + exit $rc + else + stat_done + fi + ;; + + restart) + $0 stop + sleep 3 + $0 start + ;; + *) + echo "usage: $0 {start|stop|status|reload|restart}" +esac +exit 0 diff --git a/testing/nfs-utils/nfs-server.conf b/testing/nfs-utils/nfs-server.conf new file mode 100644 index 000000000..581e26350 --- /dev/null +++ b/testing/nfs-utils/nfs-server.conf @@ -0,0 +1,29 @@ +# Parameters to be passed to nfs-server init script. +# + +# Options to pass to rpc.nfsd. +# See rpc.nfsd(8) for more details. +NFSD_OPTS="" + +# Number of servers to start up; the default is 8 servers. +NFSD_COUNT="" + +# Where to mount nfsd filesystem; the default is "/proc/fs/nfsd". +PROCNFSD_MOUNTPOINT="" + +# Options used to mount nfsd filesystem; the default is "rw,nodev,noexec,nosuid". +PROCNFSD_MOUNTOPTS="" + +# Options for rpc.mountd. +# If you have a port-based firewall, you might want to set up +# a fixed port here using the --port option. +# See rpc.mountd(8) for more details. +MOUNTD_OPTS="" + +# Do you want to start the svcgssd daemon? It is only required for Kerberos +# exports. Valid alternatives are "yes" and "no"; the default is "no". +NEED_SVCGSSD="" + +# Options to pass to rpc.svcgssd. +# See rpc.svcgssd(8) for more details. +SVCGSSD_OPTS="" diff --git a/testing/nfs-utils/nfs-utils-1.1.4-mtab-sym.patch b/testing/nfs-utils/nfs-utils-1.1.4-mtab-sym.patch new file mode 100644 index 000000000..c9e60afc7 --- /dev/null +++ b/testing/nfs-utils/nfs-utils-1.1.4-mtab-sym.patch @@ -0,0 +1,39 @@ +ripped from Debian + +--- nfs-utils-1.1.4/utils/mount/fstab.c ++++ nfs-utils-1.1.4/utils/mount/fstab.c +@@ -57,7 +57,7 @@ mtab_does_not_exist(void) { + return var_mtab_does_not_exist; + } + +-static int ++int + mtab_is_a_symlink(void) { + get_mtab_info(); + return var_mtab_is_a_symlink; +--- nfs-utils-1.1.4/utils/mount/fstab.h ++++ nfs-utils-1.1.4/utils/mount/fstab.h +@@ -7,6 +7,7 @@ + #define _PATH_FSTAB "/etc/fstab" + #endif + ++int mtab_is_a_symlink(void); + int mtab_is_writable(void); + int mtab_does_not_exist(void); + void reset_mtab_info(void); +--- nfs-utils-1.1.4/utils/mount/mount.c ++++ nfs-utils-1.1.4/utils/mount/mount.c +@@ -230,6 +230,13 @@ create_mtab (void) { + int flags; + mntFILE *mfp; + ++ /* Avoid writing if the mtab is a symlink to /proc/mounts, since ++ that would create a file /proc/mounts in case the proc filesystem ++ is not mounted, and the fchmod below would also fail. */ ++ if (mtab_is_a_symlink()) { ++ return EX_SUCCESS; ++ } ++ + lock_mtab(); + + mfp = nfs_setmntent (MOUNTED, "a+"); diff --git a/testing/nfs-utils/nfs-utils-1.1.4-no-exec.patch b/testing/nfs-utils/nfs-utils-1.1.4-no-exec.patch new file mode 100644 index 000000000..ea50a21d8 --- /dev/null +++ b/testing/nfs-utils/nfs-utils-1.1.4-no-exec.patch @@ -0,0 +1,15 @@ +ripped from Debian + +--- nfs-utils-1.1.2/utils/mount/mount.c ++++ nfs-utils-1.1.2/utils/mount/mount.c +@@ -381,10 +381,6 @@ + mount_error(NULL, mount_point, ENOTDIR); + return 1; + } +- if (access(mount_point, X_OK) < 0) { +- mount_error(NULL, mount_point, errno); +- return 1; +- } + + return 0; + } diff --git a/testing/nfs-utils/nfs-utils.conf b/testing/nfs-utils/nfs-utils.conf new file mode 100644 index 000000000..33c97b838 --- /dev/null +++ b/testing/nfs-utils/nfs-utils.conf @@ -0,0 +1 @@ +nfs diff --git a/testing/nfs-utils/nfs-utils.install b/testing/nfs-utils/nfs-utils.install new file mode 100644 index 000000000..7dcdf9575 --- /dev/null +++ b/testing/nfs-utils/nfs-utils.install @@ -0,0 +1,32 @@ +## arg 1: the new package version +post_install() { +cat << 'EOM' + ==> PLEASE NOTE: + ==> Extended configuration options for NFS (clients & server) are available in + ==> /etc/conf.d/nfs-common.conf and in /etc/conf.d/nfs-server.conf + ==> + ==> Please refer to http://wiki.archlinux.org/index.php/Nfs + ==> for further information on NFS; for NFSv4, refer to + ==> http://wiki.archlinux.org/index.php/NFSv4 +EOM +} + +## arg 1: the new package version +## arg 2: the old package version +post_upgrade() { + if [ "$(vercmp $2 1.2.0-2)" -lt 0 ]; then +cat << 'EOM' + ==> IMPORTANT NFS UTILS CHANGES: + ==> This is a rather important upgrade, you are going to have to change config files. + ==> /etc/rc.conf daemons changes: + ==> Change portmap to rpcbind + ==> Change nfslock to nfs-common + ==> Change nfsd to nfs-server + ==> + ==> Extended configuration options for NFS (clients & server) are available in: + ==> /etc/conf.d/nfs-common + ==> /etc/conf.d/nfs-server + ==> Please change them to your needs. +EOM + fi +} diff --git a/testing/nfs-utils/nfsd.service b/testing/nfs-utils/nfsd.service new file mode 100644 index 000000000..e5481c3d1 --- /dev/null +++ b/testing/nfs-utils/nfsd.service @@ -0,0 +1,16 @@ +[Unit] +Description=NFS server +After=rpcbind.service +Requires=rpcbind.service + +[Service] +Type=oneshot +EnvironmentFile=/etc/conf.d/nfs-server.conf +ExecStart=/usr/sbin/rpc.nfsd $NFSD_OPTS $NFSD_COUNT +ExecStartPost=/usr/sbin/exportfs -a +ExecStop=/usr/sbin/rpc.nfsd 0 +ExecStopPost=/usr/sbin/exportfs -a -u +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/testing/nfs-utils/proc-fs-nfsd.mount b/testing/nfs-utils/proc-fs-nfsd.mount new file mode 100644 index 000000000..f8664a8be --- /dev/null +++ b/testing/nfs-utils/proc-fs-nfsd.mount @@ -0,0 +1,8 @@ +[Unit] +Description=RPC Pipe File System +DefaultDependencies=no + +[Mount] +What=sunrpc +Where=/proc/fs/nfsd +Type=rpc_pipefs diff --git a/testing/nfs-utils/rpc-gssd.service b/testing/nfs-utils/rpc-gssd.service new file mode 100644 index 000000000..da4c71307 --- /dev/null +++ b/testing/nfs-utils/rpc-gssd.service @@ -0,0 +1,13 @@ +[Unit] +Description=RPC GSS-API client-side daemon +After=rpcbind.service var-lib-nfs-rpc_pipefs.mount +Requires=rpcbind.service var-lib-nfs-rpc_pipefs.mount +Before=remote-fs-pre.target + +[Service] +Type=forking +EnvironmentFile=/etc/conf.d/nfs-common.conf +ExecStart=/usr/sbin/rpc.gssd $GSSD_OPTS + +[Install] +WantedBy=multi-user.target diff --git a/testing/nfs-utils/rpc-idmapd.service b/testing/nfs-utils/rpc-idmapd.service new file mode 100644 index 000000000..7785c1bd5 --- /dev/null +++ b/testing/nfs-utils/rpc-idmapd.service @@ -0,0 +1,13 @@ +[Unit] +Description=NFSv4 ID-name mapping daemon +After=var-lib-nfs-rpc_pipefs.mount nfsd.service +Requires=var-lib-nfs-rpc_pipefs.mount +Before=remote-fs-pre.target + +[Service] +Type=forking +EnvironmentFile=/etc/conf.d/nfs-common.conf +ExecStart=/usr/sbin/rpc.idmapd $IDMAPD_OPTS + +[Install] +WantedBy=multi-user.target diff --git a/testing/nfs-utils/rpc-mountd.service b/testing/nfs-utils/rpc-mountd.service new file mode 100644 index 000000000..edd8c851d --- /dev/null +++ b/testing/nfs-utils/rpc-mountd.service @@ -0,0 +1,12 @@ +[Unit] +Description=NFS Mount Daemon +After=rpcbind.service nfsd.service +Requires=rpcbind.service nfsd.service + +[Service] +Type=forking +EnvironmentFile=/etc/conf.d/nfs-server.conf +ExecStart=/usr/sbin/rpc.mountd $MOUNTD_OPTS + +[Install] +WantedBy=multi-user.target diff --git a/testing/nfs-utils/rpc-statd.service b/testing/nfs-utils/rpc-statd.service new file mode 100644 index 000000000..97d397faf --- /dev/null +++ b/testing/nfs-utils/rpc-statd.service @@ -0,0 +1,13 @@ +[Unit] +Description=NFSv2/3 Network Status Monitor Daemon +After=rpcbind.service +Requires=rpcbind.service +Before=remote-fs-pre.service + +[Service] +Type=forking +EnvironmentFile=/etc/conf.d/nfs-common.conf +ExecStart=/usr/sbin/rpc.statd $STATD_OPTS + +[Install] +WantedBy=multi-user.target diff --git a/testing/nfs-utils/rpc-svcgssd.service b/testing/nfs-utils/rpc-svcgssd.service new file mode 100644 index 000000000..8152e8338 --- /dev/null +++ b/testing/nfs-utils/rpc-svcgssd.service @@ -0,0 +1,12 @@ +[Unit] +Description=RPC GSS-API server-side daemon +After=rpcbind.service +Requires=rpcbind.service + +[Service] +Type=forking +EnvironmentFile=/etc/conf.d/nfs-server.conf +ExecStart=/usr/sbin/rpc.svcgssd $SVCGSSD_OPTS + +[Install] +WantedBy=multi-user.target diff --git a/testing/nfs-utils/start-statd.patch b/testing/nfs-utils/start-statd.patch new file mode 100644 index 000000000..5d73b6e35 --- /dev/null +++ b/testing/nfs-utils/start-statd.patch @@ -0,0 +1,22 @@ +--- utils/statd/start-statd 2007-05-11 04:40:57.000000000 +0100 ++++ utils/statd/start-statd.new 2007-09-21 17:11:34.000000000 +0100 +@@ -1,9 +1,16 @@ +-#!/bin/bash -p ++#!/bin/sh ++ ++# Original script provided by the NFS project ++# Modified for Arch Linux by Tom Killian ++ + # nfsmount calls this script when mounting a filesystem with locking + # enabled, but when statd does not seem to be running (based on + # /var/run/rpc.statd.pid). + # It should run statd with whatever flags are apropriate for this + # site. +-PATH=/sbin:/usr/sbin +-exec rpc.statd --no-notify ++ ++# source application-specific settings ++[ -f /etc/conf.d/nfs-common.conf ] && . /etc/conf.d/nfs-common.conf ++ ++exec /usr/sbin/rpc.statd $STATD_OPTS + diff --git a/testing/nfs-utils/var-lib-nfs-rpc_pipefs.mount b/testing/nfs-utils/var-lib-nfs-rpc_pipefs.mount new file mode 100644 index 000000000..4bd440f24 --- /dev/null +++ b/testing/nfs-utils/var-lib-nfs-rpc_pipefs.mount @@ -0,0 +1,7 @@ +[Unit] +Description=RPC pipe filesystem + +[Mount] +What=rpc_pipefs +Where=/var/lib/nfs/rpc_pipefs +Type=rpc_pipefs diff --git a/testing/postgresql/postgresql-run-socket.patch b/testing/postgresql/postgresql-run-socket.patch new file mode 100644 index 000000000..b558c7b74 --- /dev/null +++ b/testing/postgresql/postgresql-run-socket.patch @@ -0,0 +1,12 @@ +diff -Naur postgresql-9.2.0.sockets/src/include/pg_config_manual.h postgresql-9.2.0/src/include/pg_config_manual.h +--- postgresql-9.2.0.sockets/src/include/pg_config_manual.h 2012-09-06 17:26:17.000000000 -0400 ++++ postgresql-9.2.0/src/include/pg_config_manual.h 2012-09-06 18:13:18.183092471 -0400 +@@ -144,7 +144,7 @@ + * here's where to twiddle it. You can also override this at runtime + * with the postmaster's -k switch. + */ +-#define DEFAULT_PGSOCKET_DIR "/tmp" ++#define DEFAULT_PGSOCKET_DIR "/run/postgresql" + + /* + * The random() function is expected to yield values between 0 and diff --git a/testing/postgresql/postgresql.tmpfiles.conf b/testing/postgresql/postgresql.tmpfiles.conf new file mode 100644 index 000000000..6c48e34ed --- /dev/null +++ b/testing/postgresql/postgresql.tmpfiles.conf @@ -0,0 +1 @@ +d /run/postgresql 0755 postgres postgres - diff --git a/testing/ppp/ipv6-down b/testing/ppp/ipv6-down new file mode 100644 index 000000000..d3b9e28b3 --- /dev/null +++ b/testing/ppp/ipv6-down @@ -0,0 +1,12 @@ +#!/bin/sh +# +# This script is run by pppd after the connection has ended. +# + +# Execute all scripts in /etc/ppp/ipv6-down.d/ +for ipdown in /etc/ppp/ipv6-down.d/*.sh; do + if [ -x $ipdown ]; then + # Parameters: interface-name tty-device speed local-link-local-address remote-link-local-address ipparam + $ipdown "$@" + fi +done diff --git a/testing/ppp/ipv6-up b/testing/ppp/ipv6-up new file mode 100644 index 000000000..b294aafdc --- /dev/null +++ b/testing/ppp/ipv6-up @@ -0,0 +1,12 @@ +#!/bin/sh +# +# This script is run by pppd when there's a successful ppp connection. +# + +# Execute all scripts in /etc/ppp/ipv6-up.d/ +for ipup in /etc/ppp/ipv6-up.d/*.sh; do + if [ -x $ipup ]; then + # Parameters: interface-name tty-device speed local-link-local-address remote-link-local-address ipparam + $ipup "$@" + fi +done diff --git a/testing/ppp/ipv6-up.d.iface-config.sh b/testing/ppp/ipv6-up.d.iface-config.sh new file mode 100644 index 000000000..b23d6f61d --- /dev/null +++ b/testing/ppp/ipv6-up.d.iface-config.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +echo 0 > /proc/sys/net/ipv6/conf/$1/use_tempaddr +echo 2 > /proc/sys/net/ipv6/conf/$1/accept_ra diff --git a/testing/pyalpm/PKGBUILD b/testing/pyalpm/PKGBUILD new file mode 100644 index 000000000..c9d420471 --- /dev/null +++ b/testing/pyalpm/PKGBUILD @@ -0,0 +1,23 @@ +# Maintainer : Rémy Oudompheng <remy@archlinux.org> + +pkgname=pyalpm +pkgver=0.5.3 +pkgrel=2 +pkgdesc="Libalpm bindings for Python 3" +arch=('i686' 'x86_64') +url="http://projects.archlinux.org/users/remy/pyalpm.git/" +license=('GPL') +depends=('python>=3.2' 'pacman>=4') +source=("ftp://ftp.archlinux.org/other/pyalpm/$pkgname-$pkgver.tar.gz") +md5sums=('a76019106d17de3a5933c773013a63d1') + +build() { + cd ${srcdir}/${pkgname}-${pkgver} + python setup.py build +} + +package() { + cd ${srcdir}/${pkgname}-${pkgver} + python setup.py install --root=${pkgdir} +} + diff --git a/testing/pycrypto/PKGBUILD b/testing/pycrypto/PKGBUILD new file mode 100644 index 000000000..8199704f1 --- /dev/null +++ b/testing/pycrypto/PKGBUILD @@ -0,0 +1,52 @@ +# $Id: PKGBUILD 168845 2012-10-16 11:53:59Z allan $ +# Maintainer: Jan de Groot <jgc@archlinux.org> +# Contributor: Kritoke <kritoke@gamebox.net> + +pkgbase=pycrypto +pkgname=('python2-crypto' 'python-crypto') +pkgver=2.6 +pkgrel=3 +arch=('i686' 'x86_64') +makedepends=('python2' 'python') +url="http://www.dlitz.net/software/pycrypto/" +license=('custom') +source=("http://ftp.dlitz.net/pub/dlitz/crypto/${pkgbase}/${pkgbase}-${pkgver}.tar.gz") +sha256sums=('7293c9d7e8af2e44a82f86eb9c3b058880f4bcc884bf3ad6c8a34b64986edde8') + +build() { + cd "${srcdir}" + find ${pkgbase}-${pkgver}/LEGAL -type f -exec chmod 644 {} \; + find ${pkgbase}-${pkgver}/LEGAL -type d -exec chmod 755 {} \; + + cp -r ${pkgbase}-${pkgver} ${pkgbase}-${pkgver}-py3 + cd "${srcdir}/${pkgbase}-${pkgver}" + python2 setup.py build + + cd "${srcdir}/${pkgbase}-${pkgver}-py3" + python setup.py build +} + +package_python2-crypto() { + pkgdesc="Collection of cryptographic algorithms and protocols, implemented for use from Python 2." + depends=('python2') + replaces=('pycrypto') + conflicts=('pycrypto') + provides=("pycrypto=${pkgver}") + + cd "${srcdir}/${pkgbase}-${pkgver}" + python2 setup.py install --root="${pkgdir}" --optimize=1 + install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}" + install -m644 COPYRIGHT "${pkgdir}/usr/share/licenses/${pkgname}/" + cp -r LEGAL "${pkgdir}/usr/share/licenses/${pkgname}/" +} + +package_python-crypto() { + pkgdesc="Collection of cryptographic algorithms and protocols, implemented for use from Python 3." + depends=('python') + + cd "${srcdir}/${pkgbase}-${pkgver}-py3" + python setup.py install --root="${pkgdir}" --optimize=1 + install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}" + install -m644 COPYRIGHT "${pkgdir}/usr/share/licenses/${pkgname}/" + cp -r LEGAL "${pkgdir}/usr/share/licenses/${pkgname}/" +} diff --git a/testing/pygobject/PKGBUILD b/testing/pygobject/PKGBUILD new file mode 100644 index 000000000..ba46a1a38 --- /dev/null +++ b/testing/pygobject/PKGBUILD @@ -0,0 +1,58 @@ +# $Id: PKGBUILD 168846 2012-10-16 11:54:03Z allan $ +# Maintainer: Ionut Biru <ibiru@archlinux.org> + +pkgbase=pygobject +pkgname=(python-gobject python2-gobject pygobject-devel) +pkgver=3.2.2 +pkgrel=2 +arch=('i686' 'x86_64') +url="https://live.gnome.org/PyGObject" +license=('LGPL') +makedepends=('python' 'python2' 'python-cairo' 'python2-cairo' 'gobject-introspection') +source=(http://ftp.gnome.org/pub/gnome/sources/$pkgbase/${pkgver%.*}/$pkgbase-$pkgver.tar.xz) +options=('!libtool') +sha256sums=('4653790baaff0176fd814b88cfb5378c45906a120b25d01be2554f423b726eb0') + +build() { + cp -a "$pkgbase-$pkgver" python2-build + mkdir devel + + ( + cd python2-build + export PYTHON=/usr/bin/python2 + ./configure --prefix=/usr + make + ) + + ( + cd "$pkgbase-$pkgver" + ./configure --prefix=/usr + make + ) +} + +package_python-gobject() { + pkgdesc="Python 3 bindings for GObject" + depends=('gobject-introspection' 'python-cairo' "pygobject-devel=$pkgver") + + cd "$pkgbase-$pkgver" + make DESTDIR="$pkgdir" install + rm -r "$pkgdir"/usr/{include,lib/pkgconfig} +} + +package_python2-gobject() { + pkgdesc="Python 2 bindings for GObject" + depends=('gobject-introspection' 'python2-cairo' "pygobject-devel=$pkgver") + + cd "python2-build" + make DESTDIR="$pkgdir" install + mv "$pkgdir"/usr/{include,lib/pkgconfig} "$srcdir/devel" +} + +package_pygobject-devel() { + pkgdesc="Development files for the pygobject bindings" + cd "devel" + mkdir -p "$pkgdir"/usr/{include,lib} + mv include "$pkgdir/usr/" + mv pkgconfig "$pkgdir/usr/lib/" +} diff --git a/testing/pygobject2/PKGBUILD b/testing/pygobject2/PKGBUILD new file mode 100644 index 000000000..2aaa967e3 --- /dev/null +++ b/testing/pygobject2/PKGBUILD @@ -0,0 +1,86 @@ +# $Id: PKGBUILD 168847 2012-10-16 11:54:08Z allan $ +# Maintainer: Jan de Groot <jgc@archlinux.org> + +pkgbase=pygobject2 +pkgname=(python-gobject2 python2-gobject2 pygobject2-devel) +pkgver=2.28.6 +pkgrel=7 +arch=('i686' 'x86_64') +url="http://www.pygtk.org/" +license=('LGPL') +makedepends=('python' 'python2') +source=(http://ftp.gnome.org/pub/gnome/sources/pygobject/${pkgver%.*}/pygobject-${pkgver}.tar.xz + python2-fix-type.patch + python3-fix-build.patch + python3-fix-maketrans.patch) +options=('!libtool') +sha256sums=('fb8a1d4f665130a125011659bd347c7339c944232163dbb9a34fd0686577adb8' + 'b7b415499ffc0817cf551edf76a3fe47938db2c9f6240046eae681e6ef9b37ea' + 'feafd4664f8455edf0bf8407ac45e219bb550df806ce0d601baae951e8c188ca' + '4bff9adcea13a824c45d14ec501c927df47d23c22507a2456d8b5ec885924c0a') + +build() { + cd "${srcdir}" + cp -a "pygobject-${pkgver}" python2-build + mkdir devel + + ( + cd python2-build + export PYTHON=/usr/bin/python2 + ./configure --prefix=/usr --disable-introspection + make + ) + + ( + cd "pygobject-${pkgver}" + #patches available in 2.28 branch but unreleased. + patch -Np1 -i "${srcdir}/python2-fix-type.patch" + patch -Np1 -i "${srcdir}/python3-fix-build.patch" + patch -Np1 -i "${srcdir}/python3-fix-maketrans.patch" + + ./configure --prefix=/usr --disable-introspection + make + ) +} + +package_python-gobject2() { + pkgdesc="Python 3 bindings for GObject2" + depends=('glib2' 'pygobject2-devel' 'python') + replaces=('py3gobject') + provides=("py3gobject=$pkgver") + + cd "${srcdir}/pygobject-${pkgver}" + make DESTDIR="${pkgdir}" install + + # Delete devel stuff + rm -r "$pkgdir"/usr/{bin,include,lib/pkgconfig,share/{gtk-doc,pygobject/{2.0/codegen,xsl}}} +} + +package_python2-gobject2() { + pkgdesc="Python 2 bindings for GObject2" + depends=('glib2' 'pygobject2-devel' 'python2') + replaces=('pygobject') + provides=("pygobject=$pkgver") + + cd "${srcdir}/python2-build" + make DESTDIR="${pkgdir}" install + + find "$pkgdir"/usr/share/pygobject -name '*.py' | \ + xargs sed -i "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" + + # Split devel stuff + mv "$pkgdir"/usr/{include,lib/pkgconfig,share/{gtk-doc,pygobject/xsl}} \ + "$srcdir/devel/" +} + +package_pygobject2-devel() { + pkgdesc="Development files for the pygobject bindings" + + cd "${srcdir}/devel" + mkdir -p "$pkgdir"/usr/{include,lib,share/pygobject} + + mv include "$pkgdir/usr/" + mv pkgconfig "$pkgdir/usr/lib/" + mv gtk-doc "$pkgdir/usr/share/" + mv xsl "$pkgdir/usr/share/pygobject/" +} diff --git a/testing/pygobject2/python2-fix-type.patch b/testing/pygobject2/python2-fix-type.patch new file mode 100644 index 000000000..78e7ddfd5 --- /dev/null +++ b/testing/pygobject2/python2-fix-type.patch @@ -0,0 +1,50 @@ +From 42d01f060c5d764baa881d13c103d68897163a49 Mon Sep 17 00:00:00 2001 +From: Ryan Lortie <desrt@desrt.ca> +Date: Mon, 12 Mar 2012 16:44:14 -0400 +Subject: gio-types.defs: change some enums to flags + +These flags types were originally incorrectly handled in glib as being +enums. That bug was fixed, but they're still enums here, leading to +warnings about the mismatch. + +Change them to flags. + +https://bugzilla.gnome.org/show_bug.cgi?id=668522 +--- + gio/gio-types.defs | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/gio/gio-types.defs b/gio/gio-types.defs +index 331e0bc..7eee5c8 100644 +--- a/gio/gio-types.defs ++++ b/gio/gio-types.defs +@@ -526,7 +526,7 @@ + ) + ) + +-(define-enum MountMountFlags ++(define-flags MountMountFlags + (in-module "gio") + (c-name "GMountMountFlags") + (gtype-id "G_TYPE_MOUNT_MOUNT_FLAGS") +@@ -545,7 +545,7 @@ + ) + ) + +-(define-enum DriveStartFlags ++(define-flags DriveStartFlags + (in-module "gio") + (c-name "GDriveStartFlags") + (gtype-id "G_TYPE_DRIVE_START_FLAGS") +@@ -770,7 +770,7 @@ + ) + ) + +-(define-enum SocketMsgFlags ++(define-flags SocketMsgFlags + (in-module "gio") + (c-name "GSocketMsgFlags") + (gtype-id "G_TYPE_SOCKET_MSG_FLAGS") +-- +1.7.9.1 + diff --git a/testing/pygobject2/python3-fix-build.patch b/testing/pygobject2/python3-fix-build.patch new file mode 100644 index 000000000..4cb8cfe57 --- /dev/null +++ b/testing/pygobject2/python3-fix-build.patch @@ -0,0 +1,34 @@ +From e2dc4ac346a16b6976b92e84819c7203629beb4a Mon Sep 17 00:00:00 2001 +From: Ignacio Casal Quinteiro <icq@gnome.org> +Date: Thu, 21 Apr 2011 14:52:20 +0000 +Subject: [python3] fix build. PYcairo_IMPORT doesn't exists anymore + +--- +diff --git a/gi/pygi-foreign-cairo.c b/gi/pygi-foreign-cairo.c +index 81b9865..edf52d7 100644 +--- a/gi/pygi-foreign-cairo.c ++++ b/gi/pygi-foreign-cairo.c +@@ -30,7 +30,7 @@ + #include <pycairo/py3cairo.h> + #endif + +-Pycairo_CAPI_t *Pycairo_CAPI; ++static Pycairo_CAPI_t *Pycairo_CAPI; + + #include "pygi-foreign.h" + +@@ -117,7 +117,12 @@ cairo_surface_release (GIBaseInfo *base_info, + static PyMethodDef _gi_cairo_functions[] = {0,}; + PYGLIB_MODULE_START(_gi_cairo, "_gi_cairo") + { ++#if PY_VERSION_HEX < 0x03000000 + Pycairo_IMPORT; ++#else ++ Pycairo_CAPI = (Pycairo_CAPI_t*) PyCObject_Import("cairo", "CAPI"); ++#endif ++ + if (Pycairo_CAPI == NULL) + return PYGLIB_MODULE_ERROR_RETURN; + +-- +cgit v0.9 diff --git a/testing/pygobject2/python3-fix-maketrans.patch b/testing/pygobject2/python3-fix-maketrans.patch new file mode 100644 index 000000000..f5bc0e77c --- /dev/null +++ b/testing/pygobject2/python3-fix-maketrans.patch @@ -0,0 +1,36 @@ +From 667bec76ccbc85cc1d54a0e68977dbda241c028c Mon Sep 17 00:00:00 2001 +From: Martin Pitt <martin.pitt@ubuntu.com> +Date: Wed, 13 Jul 2011 06:42:22 +0000 +Subject: [python3] Fix maketrans import + +Python3 moved the maketrans() function from the string module to a str method. +This unbreaks gi/module.py for Python 3 again. +--- +diff --git a/gi/module.py b/gi/module.py +index 70df76c..d56bdaf 100644 +--- a/gi/module.py ++++ b/gi/module.py +@@ -24,7 +24,11 @@ from __future__ import absolute_import + + import os + import gobject +-import string ++try: ++ maketrans = ''.maketrans ++except AttributeError: ++ # fallback for Python 2 ++ from string import maketrans + + import gi + from .overrides import registry +@@ -124,7 +128,7 @@ class IntrospectionModule(object): + # Don't use upper() here to avoid locale specific + # identifier conversion (e. g. in Turkish 'i'.upper() == 'i') + # see https://bugzilla.gnome.org/show_bug.cgi?id=649165 +- ascii_upper_trans = string.maketrans( ++ ascii_upper_trans = maketrans( + 'abcdefgjhijklmnopqrstuvwxyz', + 'ABCDEFGJHIJKLMNOPQRSTUVWXYZ') + for value_info in info.get_values(): +-- +cgit v0.9 diff --git a/testing/pyopenssl/PKGBUILD b/testing/pyopenssl/PKGBUILD new file mode 100644 index 000000000..e953a7690 --- /dev/null +++ b/testing/pyopenssl/PKGBUILD @@ -0,0 +1,46 @@ +# $Id: PKGBUILD 168849 2012-10-16 11:54:13Z allan $ +# Maintainer : Ionut Biru<ibiru@archlinux.org> +# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com> + +pkgbase=pyopenssl +pkgname=('python-pyopenssl' 'python2-pyopenssl') +pkgver=0.13 +pkgrel=2 +arch=('i686' 'x86_64') +url="http://pypi.python.org/pypi/pyOpenSSL" +license=('LGPL2.1') +makedepends=('python' 'python2' 'openssl') +source=(http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-${pkgver}.tar.gz) +md5sums=('767bca18a71178ca353dff9e10941929') + +build() { + cd "${srcdir}" + cp -a "pyOpenSSL-${pkgver}"{,-python2} + + #build python 3 module + cd "pyOpenSSL-${pkgver}" + python setup.py build + + #build python 2 module + cd ../"pyOpenSSL-${pkgver}-python2" + python2 setup.py build +} + +package_python-pyopenssl(){ + pkgdesc="Python3 wrapper module around the OpenSSL library" + depends=('python>=3.3' 'openssl') + replaces=('pyopenssl') + provides=('pyopenssl') + conflicts=('pyopenssl') + + cd "${srcdir}/pyOpenSSL-${pkgver}" + python setup.py install --root "${pkgdir}" --optimize=1 +} + +package_python2-pyopenssl(){ + pkgdesc="Python2 wrapper module around the OpenSSL library" + depends=('python2>=2.7' 'openssl') + + cd "${srcdir}/pyOpenSSL-${pkgver}-python2" + python2 setup.py install --root "${pkgdir}" --optimize=1 +} diff --git a/testing/python-cairo/PKGBUILD b/testing/python-cairo/PKGBUILD new file mode 100644 index 000000000..7efdd37a4 --- /dev/null +++ b/testing/python-cairo/PKGBUILD @@ -0,0 +1,34 @@ +# $Id: PKGBUILD 168854 2012-10-16 11:54:24Z allan $ +# Maintainer: Angel Velasquez <angvp@archlinux.org> +# Maintainer: Jan de Groot <jgc@archlinux.org> + +pkgname=python-cairo +pkgver=1.10.0 +pkgrel=2 +pkgdesc="Python bindings for the cairo graphics library" +arch=('i686' 'x86_64') +license=('LGPL3') +depends=('python' 'cairo') +makedepends=('pkg-config') +options=('!libtool') +source=(http://cairographics.org/releases/pycairo-${pkgver}.tar.bz2) +url="http://www.cairographics.org/pycairo" +md5sums=('e6fd3f2f1e6a72e0db0868c4985669c5') + +build() { + cd "${srcdir}/pycairo-${pkgver}" + + # Ensure that ./waf has created the cached unpacked version + # of the wafadmin source tree. + # This will be created to a subdirectory like + # .waf3-1.5.18-a7b91e2a913ce55fa6ecdf310df95752 + python3 ./waf --version + + ./waf configure --prefix=/usr + ./waf build +} + +package() { + cd "${srcdir}/pycairo-${pkgver}" + ./waf install --destdir="${pkgdir}" +} diff --git a/testing/python-egenix-mx-base/PKGBUILD b/testing/python-egenix-mx-base/PKGBUILD new file mode 100644 index 000000000..c2e1b4fa9 --- /dev/null +++ b/testing/python-egenix-mx-base/PKGBUILD @@ -0,0 +1,33 @@ +# $Id: PKGBUILD 168902 2012-10-16 14:06:20Z allan $ +# Maintainer: Stéphane Gaudreault <stephane@archlinux.org> +# Contributor: Douglas Soares de Andrade <douglas@archlinux.org> + +pkgbase=python-egenix-mx-base +pkgname=('python2-egenix-mx-base') +_origname=egenix-mx-base +pkgver=3.2.4 +pkgrel=3 +pkgdesc="A collection of Python tools" +arch=('i686' 'x86_64') +license=('custom') +url="http://www.egenix.com/products/python/mxBase/" +makedepends=('python2') +conflicts=('python-egenix-mx-base<=3.2.4-1') +replaces=('python-egenix-mx-base<=3.2.4-1') +source=("http://downloads.egenix.com/python/${_origname}-${pkgver}.tar.gz") +sha1sums=('22d7fcbd582177f9a43245eadc3644f3b48cc9a7') + +build() { + cd "${srcdir}/${_origname}-${pkgver}" + + find . -name \*.py -exec sed -i -e "s|^#!.*python|#!/usr/bin/python2|" {} \; + + python2 setup.py build +} + +package_python2-egenix-mx-base() { + depends=('python2>=2.7') + cd "${srcdir}/${_origname}-${pkgver}" + python2 setup.py install --root="${pkgdir}" --skip-build --optimize=1 + install -D -m644 COPYRIGHT "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE +} diff --git a/testing/python-iwscan/PKGBUILD b/testing/python-iwscan/PKGBUILD new file mode 100644 index 000000000..a32038290 --- /dev/null +++ b/testing/python-iwscan/PKGBUILD @@ -0,0 +1,26 @@ +# $Id: PKGBUILD 168860 2012-10-16 11:54:37Z allan $ +# Maintainer: Daniel Isenmann <daniel@archlinux.org> + +pkgbase=python-iwscan +pkgname=python2-iwscan +pkgver=20090609 +pkgrel=4 +pkgdesc="A Python interface to iwlist, using the iwlib library" +arch=('i686' 'x86_64') +url="http://projects.otaku42.de/browser/python-iwscan" +license=('LGPL') +depends=('python2' 'wireless_tools') +conflicts=('python-iwscan<=20090609-3') +replaces=('python-iwscan<=20090609-3') +source=(ftp://ftp.archlinux.org/other/${pkgbase}/${pkgbase}-20090609.tar.gz) +md5sums=('30fbe8ad3b07e67c1c35db2de16077d8') + +build() { + cd "${srcdir}/${pkgbase}" + python2 setup.py build +} + +package_python2-iwscan() { + cd "${srcdir}/${pkgbase}" + python2 setup.py install --root="${pkgdir}" +} diff --git a/testing/python-lxml/PKGBUILD b/testing/python-lxml/PKGBUILD new file mode 100644 index 000000000..8980d9da3 --- /dev/null +++ b/testing/python-lxml/PKGBUILD @@ -0,0 +1,49 @@ +# $Id: PKGBUILD 168863 2012-10-16 11:54:46Z allan $ +# Maintainer: + +pkgname=('python-lxml' 'python2-lxml') +pkgver=3.0 +pkgrel=1 +pkgdesc="Python binding for the libxml2 and libxslt libraries" +arch=('i686' 'x86_64') +license=('BSD' 'custom') +url="http://lxml.de/" +makedepends=('python2' 'python' 'libxslt') +source=(http://pypi.python.org/packages/source/l/lxml/lxml-${pkgver}.tar.gz{,.asc}) +sha1sums=('8dbbd03a637bb563113cf07049a4d5a109369441' + 'b38447fd3f9cfb30b4d56ffe3bec42739afb2947') + +check() { + cd "${srcdir}"/lxml-$pkgver + make PYTHON=python2 test + make PYTHON=python test +} + +package_python2-lxml() { + depends=('python2' 'libxslt') + optdepends=('python2-beautifulsoup3: support for parsing not well formed HTML') + + cd "${srcdir}"/lxml-$pkgver + python2 setup.py install --root="${pkgdir}" --optimize=1 + + install -Dm644 LICENSES.txt \ + "${pkgdir}"/usr/share/licenses/$pkgname/LICENSE + install -Dm644 doc/licenses/BSD.txt \ + "${pkgdir}"/usr/share/licenses/$pkgname/BSD.txt + install -Dm644 doc/licenses/elementtree.txt \ + "${pkgdir}"/usr/share/licenses/$pkgname/elementtree.txt +} + +package_python-lxml() { + depends=('python' 'libxslt') + + cd "${srcdir}"/lxml-$pkgver + python setup.py install --root="${pkgdir}" --optimize=1 + + install -Dm644 LICENSES.txt \ + "${pkgdir}"/usr/share/licenses/$pkgname/LICENSE + install -Dm644 doc/licenses/BSD.txt \ + "${pkgdir}"/usr/share/licenses/$pkgname/BSD.txt + install -Dm644 doc/licenses/elementtree.txt \ + "${pkgdir}"/usr/share/licenses/$pkgname/elementtree.txt +} diff --git a/testing/python-markupsafe/PKGBUILD b/testing/python-markupsafe/PKGBUILD new file mode 100644 index 000000000..8de9c9363 --- /dev/null +++ b/testing/python-markupsafe/PKGBUILD @@ -0,0 +1,41 @@ +# $Id: PKGBUILD 168865 2012-10-16 11:54:52Z allan $ +# Maintainer : Ionut Biru <ibiru@archlinux.org> +# Contributor: Alex Anthony <alex.anthony28991@gmail.com> + +pkgname=('python-markupsafe' 'python2-markupsafe') +pkgver=0.15 +pkgrel=2 +pkgdesc="Implements a XML/HTML/XHTML Markup safe string for Python" +arch=('i686' 'x86_64') +url="http://pypi.python.org/pypi/MarkupSafe" +license=('custom') +makedepends=('python-distribute' 'python2-distribute') +source=("http://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-${pkgver}.tar.gz") +md5sums=('4e7c4d965fe5e033fa2d7bb7746bb186') + +build() { + cp -r MarkupSafe-${pkgver} python2-MarkupSafe-${pkgver} + cd "${srcdir}/MarkupSafe-${pkgver}" + python setup.py build + + cd "${srcdir}/python2-MarkupSafe-${pkgver}" + python2 setup.py build +} + +package_python-markupsafe() { + depends=('python') + + cd "${srcdir}/MarkupSafe-${pkgver}" + python setup.py install --root="${pkgdir}" --optimize=1 + + install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/python-markupsafe/LICENSE" +} + +package_python2-markupsafe() { + depends=('python2') + + cd "${srcdir}/python2-MarkupSafe-${pkgver}" + python2 setup.py install --root="${pkgdir}" --optimize=1 + + install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/python2-markupsafe/LICENSE" +} diff --git a/testing/python-notify/PKGBUILD b/testing/python-notify/PKGBUILD new file mode 100644 index 000000000..674fb34c1 --- /dev/null +++ b/testing/python-notify/PKGBUILD @@ -0,0 +1,43 @@ +# $Id: PKGBUILD 168868 2012-10-16 11:55:02Z allan $ +# Maintainer: Angel Velasquez <angvp@archlinux.org> + +pkgbase=python-notify +pkgname=python2-notify +pkgver=0.1.1 +pkgrel=12 +pkgdesc="Python bindings for libnotify" +arch=('i686' 'x86_64') +url="http://www.galago-project.org/" +license=('GPL') +depends=('pygtk>=2.22.0' 'libnotify>=0.7.1') +makedepends=('python2') +conflicts=('python-notify<=0.1.1-11') +replaces=('python-notify<=0.1.1-11') +options=(!libtool) +source=(http://www.galago-project.org/files/releases/source/notify-python/notify-python-${pkgver}.tar.gz + libnotify07.patch + notify-python-0.1.1-fix-GTK-symbols.patch) +md5sums=('8f0ef0939cc8edd2efd896ce5ba80cf4' + 'b40c4542575d5aef559908fe60a21634' + 'c6922028da5951e69a6a0167bdb4461c') + +build() { + cd "${srcdir}/notify-python-${pkgver}" + + patch -Np1 -i "${srcdir}/libnotify07.patch" + patch -Np1 -i "${srcdir}/notify-python-0.1.1-fix-GTK-symbols.patch" + + ./configure --prefix=/usr + + # WARNING - we touch src/pynotify.override in build because upstream did not rebuild pynotify.c + # from the input definitions, this forces pynotify.c to be regenerated, at some point this can be removed + touch src/pynotify.override + + make clean + make +} + +package_python2-notify() { + cd "${srcdir}/notify-python-${pkgver}" + make DESTDIR="${pkgdir}" install +} diff --git a/testing/python-notify/libnotify07.patch b/testing/python-notify/libnotify07.patch new file mode 100644 index 000000000..289573d50 --- /dev/null +++ b/testing/python-notify/libnotify07.patch @@ -0,0 +1,36 @@ +diff -up notify-python-0.1.1/src/pynotify.defs.notify070 notify-python-0.1.1/src/pynotify.defs +--- notify-python-0.1.1/src/pynotify.defs.notify070 2010-11-02 17:11:14.928179237 -0400 ++++ notify-python-0.1.1/src/pynotify.defs 2010-11-02 17:11:51.153180231 -0400 +@@ -38,7 +38,6 @@ + '("const-gchar*" "summary") + '("const-gchar*" "message" (null-ok) (default "NULL")) + '("const-gchar*" "icon" (null-ok) (default "NULL")) +- '("GtkWidget*" "attach" (null-ok) (default "NULL")) + ) + ) + +@@ -53,24 +52,6 @@ + ) + ) + +-(define-method attach_to_widget +- (of-object "NotifyNotification") +- (c-name "notify_notification_attach_to_widget") +- (return-type "none") +- (parameters +- '("GtkWidget*" "attach") +- ) +-) +- +-(define-method attach_to_status_icon +- (of-object "NotifyNotification") +- (c-name "notify_notification_attach_to_status_icon") +- (return-type "none") +- (parameters +- '("GtkStatusIcon*" "attach") +- ) +-) +- + (define-method show + (of-object "NotifyNotification") + (c-name "notify_notification_show") diff --git a/testing/python-notify/notify-python-0.1.1-fix-GTK-symbols.patch b/testing/python-notify/notify-python-0.1.1-fix-GTK-symbols.patch new file mode 100644 index 000000000..f985c0136 --- /dev/null +++ b/testing/python-notify/notify-python-0.1.1-fix-GTK-symbols.patch @@ -0,0 +1,25 @@ +diff -up notify-python-0.1.1/src/__init__.py.BAD notify-python-0.1.1/src/__init__.py +--- notify-python-0.1.1/src/__init__.py.BAD 2010-08-31 09:04:45.353844005 -0400 ++++ notify-python-0.1.1/src/__init__.py 2010-08-31 09:04:49.281844300 -0400 +@@ -1 +1,21 @@ ++""" ++Fedora's libnotify.so is not linked against GTK2 or GTK3. The idea ++was to support being linked against different parallel-installable ++GTK stacks. ++ ++Unfortunately, python needs to jump through some special hoops in order ++to share symbols with extension modules, specifically, pygtk, which does ++link against GTK2. ++ ++Without using sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL), ++the result is: ++libnotify-WARNING **: Missing symbol 'gdk_screen_make_display_name' ++ ++Thanks to David Malcolm for figuring out the workaround. ++""" ++import ctypes ++import sys ++sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL) ++import gtk ++ + from _pynotify import * diff --git a/testing/python-numpy/PKGBUILD b/testing/python-numpy/PKGBUILD new file mode 100755 index 000000000..e295dec87 --- /dev/null +++ b/testing/python-numpy/PKGBUILD @@ -0,0 +1,62 @@ +# $Id: PKGBUILD 168869 2012-10-16 11:55:07Z allan $ +# Maintainer: Jan de Groot <jgc@archlinux.org> +# Contributor: Douglas Soares de Andrade <dsa@aur.archlinux.org> +# Contributor: Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve> + +pkgbase=python-numpy +pkgname=('python2-numpy' 'python-numpy') +pkgver=1.7.0 +_pkgver=1.7.0b2 +pkgrel=1 +pkgdesc="Scientific tools for Python" +arch=('i686' 'x86_64') +license=('custom') +url="http://numpy.scipy.org/" +makedepends=('lapack' 'python' 'python2' 'python-distribute' 'python2-distribute' 'gcc-fortran' 'python-nose') +source=(http://downloads.sourceforge.net/numpy/numpy-${_pkgver}.tar.gz) +md5sums=('1b62cf0e34e2db58b0241b00d603df24') + +build() { + cd "${srcdir}" + cp -a numpy-${_pkgver} numpy-py2-${_pkgver} + + export Atlas=None + export LDFLAGS="$LDFLAGS -shared" + + echo "Building Python2" + cd "${srcdir}/numpy-py2-${_pkgver}" + python2 setup.py config_fc --fcompiler=gnu95 build + + echo "Building Python3" + cd "${srcdir}/numpy-${_pkgver}" + python setup.py config_fc --fcompiler=gnu95 build +} + +package_python2-numpy() { + depends=('lapack' 'python2') + optdepends=('python-nose: testsuite') + + cd "${srcdir}/numpy-py2-${_pkgver}" + python2 setup.py config_fc --fcompiler=gnu95 install --prefix=/usr --root="${pkgdir}" --optimize=1 + + install -m755 -d "${pkgdir}/usr/share/licenses/python2-numpy" + install -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/python2-numpy/" + + sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \ + -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \ + -e "s|#![ ]*/bin/env python$|#!/usr/bin/env python2|" \ + $(find ${pkgdir} -name '*.py') +} + +package_python-numpy() { + depends=('lapack' 'python') + provides=("python3-numpy=${pkgver}") + replaces=('python3-numpy') + conflicts=('python3-numpy') + + cd "${srcdir}/numpy-${_pkgver}" + python setup.py config_fc --fcompiler=gnu95 install --prefix=/usr --root="${pkgdir}" --optimize=1 + + install -m755 -d "${pkgdir}/usr/share/licenses/python3-numpy" + install -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/python3-numpy/" +} diff --git a/testing/python-numpy/numpy-1.6.2-python-3.3-build-fix.patch b/testing/python-numpy/numpy-1.6.2-python-3.3-build-fix.patch new file mode 100644 index 000000000..072afbc0e --- /dev/null +++ b/testing/python-numpy/numpy-1.6.2-python-3.3-build-fix.patch @@ -0,0 +1,92 @@ +diff --git a/numpy/core/src/multiarray/scalarapi.c b/numpy/core/src/multiarray/scalarapi.c +index 00c71f9..0afdc17 100644 +--- a/numpy/core/src/multiarray/scalarapi.c ++++ b/numpy/core/src/multiarray/scalarapi.c +@@ -641,6 +641,40 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base) + itemsize = (((itemsize - 1) >> 2) + 1) << 2; + } + } ++#if PY_VERSION_HEX >= 0x03030000 ++ if (type_num == NPY_UNICODE) { ++ PyObject *u, *args; ++ char *buffer; ++ if (swap) { ++ buffer = malloc(itemsize); ++ if (buffer == NULL) { ++ PyErr_NoMemory(); ++ return NULL; ++ } ++ memcpy(buffer, data, itemsize); ++ byte_swap_vector(buffer, itemsize >> 2, 4); ++ } else { ++ buffer = data; ++ } ++ u = PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND, buffer, ++ itemsize >> 2); ++ if (swap) { ++ free(buffer); ++ } ++ if (u == NULL) { ++ return NULL; ++ } ++ args = Py_BuildValue("(O)", u); ++ if (args == NULL) { ++ Py_DECREF(u); ++ return NULL; ++ } ++ obj = type->tp_new(type, args, NULL); ++ Py_DECREF(u); ++ Py_DECREF(args); ++ return obj; ++ } ++#endif + if (type->tp_itemsize != 0) { + /* String type */ + obj = type->tp_alloc(type, itemsize); +@@ -672,6 +706,7 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base) + memcpy(destptr, data, itemsize); + return obj; + } ++#if PY_VERSION_HEX < 0x03030000 + else if (type_num == PyArray_UNICODE) { + /* tp_alloc inherited from Python PyBaseObject_Type */ + PyUnicodeObject *uni = (PyUnicodeObject*)obj; +@@ -743,6 +778,7 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base) + #endif + return obj; + } ++#endif // PY_VERSION_HEX < 0x03030000 + else { + PyVoidScalarObject *vobj = (PyVoidScalarObject *)obj; + vobj->base = NULL; +diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src +index e547071..12745d7 100644 +--- a/numpy/core/src/multiarray/scalartypes.c.src ++++ b/numpy/core/src/multiarray/scalartypes.c.src +@@ -2592,7 +2592,11 @@ finish: + *((npy_@name@ *)dest) = *((npy_@name@ *)src); + #elif @default@ == 1 /* unicode and strings */ + if (itemsize == 0) { /* unicode */ ++#if PY_VERSION_HEX >= 0x03030000 ++ itemsize = PyUnicode_GetLength(robj) * PyUnicode_KIND(robj); ++#else + itemsize = ((PyUnicodeObject *)robj)->length * sizeof(Py_UNICODE); ++#endif + } + memcpy(dest, src, itemsize); + /* @default@ == 2 won't get here */ +diff --git a/numpy/core/src/multiarray/methods.c b/numpy/core/src/multiarray/methods.c +index c4147ef..119056c 100644 +--- a/numpy/core/src/multiarray/methods.c ++++ b/numpy/core/src/multiarray/methods.c +@@ -1587,7 +1587,7 @@ array_setstate(PyArrayObject *self, PyObject *args) + if (!PyDataType_FLAGCHK(typecode, NPY_LIST_PICKLE)) { + int swap=!PyArray_ISNOTSWAPPED(self); + self->data = datastr; +- if (!_IsAligned(self) || swap) { ++ if (!_IsAligned(self) || swap || (len <= 1000)) { + intp num = PyArray_NBYTES(self); + self->data = PyDataMem_NEW(num); + if (self->data == NULL) { +-- +1.7.12.3 diff --git a/testing/python-pyspi/PKGBUILD b/testing/python-pyspi/PKGBUILD new file mode 100644 index 000000000..0fb75b940 --- /dev/null +++ b/testing/python-pyspi/PKGBUILD @@ -0,0 +1,32 @@ +# $Id: PKGBUILD 168874 2012-10-16 11:55:20Z allan $ +# Maintainer: Jan de Groot <jgc@archlinux.org> +# Contributor: William Rea <sillywilly@gmail.com> + +pkgbase=python-pyspi +pkgname=python2-pyspi +pkgver=0.6.1 +pkgrel=1 +pkgdesc="Python AT-SPI bindings" +arch=('i686' 'x86_64') +url="http://people.redhat.com/zcerza/dogtail" +license=('LGPL') +depends=('python2' 'at-spi') +makedepends=('pyrex') +conflicts=('python-pyspi<=0.6.1-5') +conflicts=('python-pyspi<=0.6.1-5') +source=("http://dlc.sun.com/osol/jds/downloads/sources/pyspi-${pkgver}.tar.gz" + 'pyspi-build.patch') +md5sums=('def336bd566ea688a06ec03db7ccf1f4' + '721f74cbae653a258c00b83acf7dd1da') + +build() { + cd ${srcdir}/pyspi-${pkgver} + patch -Np1 -i ${srcdir}/pyspi-build.patch + # Pyrex tells us to use __cinit__ instead of __new__ + sed -i 's/__new__/__cinit__/' pyspi.pyx +} + +package_python2-pyspi() { + cd ${srcdir}/pyspi-${pkgver} + python2 setup.py install --root=${pkgdir} +} diff --git a/testing/python-pyspi/pyspi-build.patch b/testing/python-pyspi/pyspi-build.patch new file mode 100644 index 000000000..3d12c5ed5 --- /dev/null +++ b/testing/python-pyspi/pyspi-build.patch @@ -0,0 +1,1693 @@ +diff -Naur pyspi-0.6.1-old/cspi.pxd pyspi-0.6.1/cspi.pxd +--- pyspi-0.6.1-old/cspi.pxd 2006-08-04 06:27:10.000000000 +1000 ++++ pyspi-0.6.1/cspi.pxd 2009-05-09 15:24:31.000000000 +1000 +@@ -14,9 +14,7 @@ + + ctypedef struct AccessibleTextRange + ctypedef struct AccessibleKeySet +- ctypedef enum SPIBoolean: +- FALSE = 0, +- TRUE ++ ctypedef unsigned int SPIBoolean + + ctypedef struct AccessibleEvent: + char *type +diff -Naur pyspi-0.6.1-old/pyspi.pyx pyspi-0.6.1/pyspi.pyx +--- pyspi-0.6.1-old/pyspi.pyx 2006-10-03 02:46:41.000000000 +1000 ++++ pyspi-0.6.1/pyspi.pyx 2009-05-09 15:24:31.000000000 +1000 +@@ -25,9 +25,15 @@ + cdef class Event (EventBase) + cdef class DeviceEvent + +-ctypedef enum bool: ++ctypedef unsigned int bool ++ ++import __builtin__ ++try: ++ False = __builtin__.False ++ True = __builtin__.True ++except AttributeError: + False = 0 +- True ++ True = 1 + + # SPIExceptionCode values: + (SPI_EXCEPTION_UNSPECIFIED, SPI_EXCEPTION_DISCONNECT, SPI_EXCEPTION_NO_IMPL, SPI_EXCEPTION_IO, SPI_EXCEPTION_BAD_DATA)=range(5) +@@ -731,7 +737,7 @@ + Wrapper around the low-level cspi.AccessibleComponent_ functions, + giving an OO-style API. + """ +- def getExtents (self, type=0): ++ def getExtents (self, key_type=0): + """ + Wraps cspi.AccessibleComponent_getExtents, returning an + (x,y,w,h) tuple. +@@ -741,7 +747,7 @@ + cspi.AccessibleComponent_getExtents (self.__item, &x, &y, &w, &h, type) + return (x, y, w, h) + +- def getPosition (self, type = 0): ++ def getPosition (self, key_type = 0): + """ + Wraps cspi.AccessibleComponent_getPosition, returning an + (x,y) tuple. +@@ -991,11 +997,11 @@ + Wraps cspi.AccessibleHyperlink_getObject + """ + self.__checkSelf () +- cdef Accessible object +- object = Accessible () +- object.__setItem (cspi.AccessibleHyperlink_getObject (self.__item, i)) +- object.__checkSelf () +- return object ++ cdef Accessible obj ++ obj = Accessible () ++ obj.__setItem (cspi.AccessibleHyperlink_getObject (self.__item, i)) ++ obj.__checkSelf () ++ return obj + + def getURI (self, i): + """ +@@ -1032,7 +1038,7 @@ + cspi.AccessibleImage_getImageSize(self.__item, &w, &h); + return [w, h] + +- def getImagePosition (self, type=0): ++ def getImagePosition (self, key_type=0): + """ + Wraps cspi.AccessibleImage_getImagePosition, returning a (x,y) + pair +@@ -1042,7 +1048,7 @@ + cspi.AccessibleImage_getImagePosition(self.__item, &x, &y, type) + return [x, y] + +- def getImageExtents (self, type=0): ++ def getImageExtents (self, key_type=0): + """ + Wraps cspi.AccessibleImage_getImageExtents, returning a + (x,y,w,h) tuple +@@ -1551,7 +1557,7 @@ + cdef cspi.AccessibleDeviceListener *__item + cdef public object modMasks + +- def __init__ (self, callback, eventMask = cspi.SPI_KEY_PRESSED | cspi.SPI_KEY_RELEASED): ++ def __init__ (self, callback, eventMask = <int> cspi.SPI_KEY_PRESSED | <int> cspi.SPI_KEY_RELEASED): + """ + Registers a python callback function to be called. + +diff -Naur pyspi-0.6.1-old/pyspi.pyx.orig pyspi-0.6.1/pyspi.pyx.orig +--- pyspi-0.6.1-old/pyspi.pyx.orig 1970-01-01 10:00:00.000000000 +1000 ++++ pyspi-0.6.1/pyspi.pyx.orig 2006-10-03 02:46:41.000000000 +1000 +@@ -0,0 +1,1592 @@ ++# Authors: ++# Zack Cerza <zcerza@redhat.com> ++# Chris Lee <clee@redhat.com> ++# Lawrence Lim <llim@redhat.com> ++# David Malcolm <dmalcolm@redhat.com> ++ ++cdef class Registry ++ ++cdef class Base ++cdef class EventBase ++cdef class StateSet ++cdef class Accessible (Base) ++cdef class Desktop (Accessible) ++cdef class Application (Accessible) ++cdef class Component (Accessible) ++cdef class Action (Base) ++cdef class Text (Base) ++cdef class EditableText (Text) ++cdef class Hypertext (Text) ++cdef class Hyperlink (Base) ++cdef class Image (Base) ++cdef class Value (Base) ++cdef class Selection (Base) ++cdef class Table (Base) ++cdef class Event (EventBase) ++cdef class DeviceEvent ++ ++ctypedef enum bool: ++ False = 0 ++ True ++ ++# SPIExceptionCode values: ++(SPI_EXCEPTION_UNSPECIFIED, SPI_EXCEPTION_DISCONNECT, SPI_EXCEPTION_NO_IMPL, SPI_EXCEPTION_IO, SPI_EXCEPTION_BAD_DATA)=range(5) ++ ++# SPIExceptionType values: ++(SPI_EXCEPTION_SOURCE_UNSPECIFIED, SPI_EXCEPTION_SOURCE_ACCESSIBLE, SPI_EXCEPTION_SOURCE_REGISTRY, SPI_EXCEPTION_SOURCE_DEVICE)=range(4) ++ ++# Accessible roles ++(SPI_ROLE_INVALID, SPI_ROLE_ACCEL_LABEL, SPI_ROLE_ALERT, SPI_ROLE_ANIMATION, SPI_ROLE_ARROW, SPI_ROLE_CALENDAR, SPI_ROLE_CANVAS, SPI_ROLE_CHECK_BOX, SPI_ROLE_CHECK_MENU_ITEM, SPI_ROLE_COLOR_CHOOSER, SPI_ROLE_COLUMN_HEADER, SPI_ROLE_COMBO_BOX, SPI_ROLE_DATE_EDITOR, SPI_ROLE_DESKTOP_ICON, SPI_ROLE_DESKTOP_FRAME, SPI_ROLE_DIAL, SPI_ROLE_DIALOG, SPI_ROLE_DIRECTORY_PANE, SPI_ROLE_DRAWING_AREA, SPI_ROLE_FILE_CHOOSER, SPI_ROLE_FILLER, SPI_ROLE_FONT_CHOOSER, SPI_ROLE_FRAME, SPI_ROLE_GLASS_PANE, SPI_ROLE_HTML_CONTAINER, SPI_ROLE_ICON, SPI_ROLE_IMAGE, SPI_ROLE_INTERNAL_FRAME, SPI_ROLE_LABEL, SPI_ROLE_LAYERED_PANE, SPI_ROLE_LIST, SPI_ROLE_LIST_ITEM, SPI_ROLE_MENU, SPI_ROLE_MENU_BAR, SPI_ROLE_MENU_ITEM, SPI_ROLE_OPTION_PANE, SPI_ROLE_PAGE_TAB, SPI_ROLE_PAGE_TAB_LIST, SPI_ROLE_PANEL, SPI_ROLE_PASSWORD_TEXT, SPI_ROLE_POPUP_MENU, SPI_ROLE_PROGRESS_BAR, SPI_ROLE_PUSH_BUTTON, SPI_ROLE_RADIO_BUTTON, SPI_ROLE_RADIO_MENU_ITEM, SPI_ROLE_ROOT_PANE, SPI_ROLE_ROW_HEADER, SPI_ROLE_SCROLL_BAR, SPI_ROLE_SCROLL_PANE, SPI_ROLE_SEPARATOR, SPI_ROLE_SLIDER, SPI_ROLE_SPIN_BUTTON, SPI_ROLE_SPLIT_PANE, SPI_ROLE_STATUS_BAR, SPI_ROLE_TABLE, SPI_ROLE_TABLE_CELL, SPI_ROLE_TABLE_COLUMN_HEADER, SPI_ROLE_TABLE_ROW_HEADER, SPI_ROLE_TEAROFF_MENU_ITEM, SPI_ROLE_TERMINAL, SPI_ROLE_TEXT, SPI_ROLE_TOGGLE_BUTTON, SPI_ROLE_TOOL_BAR, SPI_ROLE_TOOL_TIP, SPI_ROLE_TREE, SPI_ROLE_TREE_TABLE, SPI_ROLE_UNKNOWN, SPI_ROLE_VIEWPORT, SPI_ROLE_WINDOW, SPI_ROLE_EXTENDED, SPI_ROLE_HEADER, SPI_ROLE_FOOTER, SPI_ROLE_PARAGRAPH, SPI_ROLE_RULER, SPI_ROLE_APPLICATION, SPI_ROLE_AUTOCOMPLETE, SPI_ROLE_EDITBAR, SPI_ROLE_EMBEDDED, SPI_ROLE_LAST_DEFINED)=range(79) ++ ++# Accessible states ++(SPI_STATE_INVALID, SPI_STATE_ACTIVE, SPI_STATE_ARMED, SPI_STATE_BUSY, SPI_STATE_CHECKED, SPI_STATE_COLLAPSED, SPI_STATE_DEFUNCT, SPI_STATE_EDITABLE, SPI_STATE_ENABLED, SPI_STATE_EXPANDABLE, SPI_STATE_EXPANDED, SPI_STATE_FOCUSABLE, SPI_STATE_FOCUSED, SPI_STATE_HORIZONTAL, SPI_STATE_ICONIFIED, SPI_STATE_MODAL, SPI_STATE_MULTI_LINE, SPI_STATE_MULTISELECTABLE, SPI_STATE_OPAQUE, SPI_STATE_PRESSED, SPI_STATE_RESIZABLE, SPI_STATE_SELECTABLE, SPI_STATE_SELECTED, SPI_STATE_SENSITIVE, SPI_STATE_SHOWING, SPI_STATE_SINGLE_LINE, SPI_STATE_STALE, SPI_STATE_TRANSIENT, SPI_STATE_VERTICAL, SPI_STATE_VISIBLE, SPI_STATE_MANAGES_DESCENDANTS, SPI_STATE_INDETERMINATE) = range(32); ++ ++# Accessible relation types ++(SPI_RELATION_NULL, SPI_RELATION_LABEL_FOR, SPI_RELATION_LABELED_BY, SPI_RELATION_CONTROLLER_FOR, SPI_RELATION_CONTROLLED_BY, SPI_RELATION_MEMBER_OF, SPI_RELATION_NODE_CHILD_OF, SPI_RELATION_EXTENDED, SPI_RELATION_FLOWS_TO, SPI_RELATION_FLOWS_FROM, SPI_RELATION_SUBWINDOW_OF, SPI_RELATION_EMBEDS, SPI_RELATION_EMBEDDED_BY, SPI_RELATION_POPUP_FOR, SPI_RELATION_LAST_DEFINED) = range (15); ++ ++# AccessibleComponent layers ++(SPI_LAYER_INVALID, SPI_LAYER_BACKGROUND, SPI_LAYER_CANVAS, SPI_LAYER_WIDGET, SPI_LAYER_MDI, SPI_LAYER_POPUP, SPI_LAYER_OVERLAY, SPI_LAYER_WINDOW, SPI_LAYER_LAST_DEFINED) = range(9) ++ ++#AccessibleKeySynthType ++(SPI_KEY_PRESS, SPI_KEY_RELEASE, SPI_KEY_PRESSRELEASE, SPI_KEY_SYM, SPI_KEY_STRING) = range(5) ++ ++# AccessibleKeyListenerSyncType ++(SPI_KEYLISTENER_NOSYNC, SPI_KEYLISTENER_SYNCHRONOUS, SPI_KEYLISTENER_CANCONSUME, SPI_KEYLISTENER_ALL_WINDOWS) = range(4) ++ ++# AccessibleDeviceEventType ++SPI_KEY_PRESSED = 1<<0 ++SPI_KEY_RELEASED = 1<<1 ++SPI_BUTTON_PRESSED = 1<<2 ++SPI_BUTTON_RELEASED = 1<<3 ++ ++cdef cspi.AccessibleKeySet *SPI_KEYSET_ALL_KEYS ++SPI_KEYSET_ALL_KEYS = NULL ++ ++Accessibility_MODIFIER_SHIFT = 1 << 0 ++Accessibility_MODIFIER_SHIFTLOCK = 1 << 1 ++Accessibility_MODIFIER_CONTROL = 1 << 2 ++Accessibility_MODIFIER_ALT = 1 << 3 ++Accessibility_MODIFIER_META = 1 << 4 ++Accessibility_MODIFIER_META2 = 1 << 5 ++Accessibility_MODIFIER_META3 = 1 << 6 ++Accessibility_MODIFIER_NUMLOCK = 1 << 7 ++ ++ ++cdef object string(char * string): ++ cdef object pyString ++ pyString = string ++ cspi.SPI_freeString(string) ++ return pyString ++ ++import os ++class X11Exception(Exception): ++ def __init__(self, display = os.environ.get('DISPLAY', None)): ++ self.display = display ++ def __str__(self): ++ msg = "Cannot open display" ++ if self.display: return msg + ': ' + self.display ++ else: return msg ++ ++class AtspiException(Exception): ++ """ ++ Exceptions raised when calls to the AT-SPI C bindings return FALSE to ++ indicate failure. ++ """ ++ def __init__(self, message): ++ self.message = message ++ ++ def __str__(self): ++ return "AtspiException: %s"%self.message ++ ++class SpiException(Exception): ++ """ ++ Exceptions to be raised in response to an installed ++ SPIExceptionHandler, corresponding to a SPIException. These appear to ++ be short-lived structs, so we gather all applicable data immediately ++ """ ++ def __init__(self, is_fatal, sourceType, exceptionCode, description): ++ # print "got to __init__" ++ self.fatal = is_fatal ++ self.sourceType = sourceType ++ self.exceptionCode = exceptionCode ++ self.description = description ++ ++ # print "leaving __init__" ++ # print self.fatal ++ # print self.sourceType ++ # print self.exceptionCode ++ # print self.description ++ ++ def __str__(self): ++ if self.fatal: ++ fatalStr = "Fatal" ++ else: ++ fatalStr = "Non-fatal" ++ result = '%s SPIException: type:%s source:%s "%s"'%(fatalStr, self.sourceType, self.exceptionCode, self.description) ++ return result ++ ++cdef make_exception(cspi.SPIException *err, cspi.SPIBoolean is_fatal): ++ # Don't attempt to use SPIAccessibleException_getSource; this is error ++ # handling code, we don't want to introduce further complications ++ return SpiException(is_fatal, ++ cspi.SPIException_getSourceType (err), ++ cspi.SPIException_getExceptionCode (err), ++ cspi.SPIException_getDescription (err)) ++ ++ ++def event_main(): ++ cspi.SPI_event_main() ++ ++def event_quit(): ++ cspi.SPI_event_quit() ++ ++cdef cspi.SPIBoolean exception_handler (cspi.SPIException *err, cspi.SPIBoolean is_fatal) except *: ++ # print "got exception!!!" ++ e = make_exception(err, is_fatal) ++ raise e ++ ++# at-spi-<version>/cpsi.h contains: ++# typedef SPIBoolean (*SPIExceptionHandler) (SPIException *err, SPIBoolean is_fatal); ++# and ++# SPIBoolean SPI_exceptionHandlerPush (SPIExceptionHandler *handler); ++# There's thus an extra unnecessary level of indirection. ++# We have to jump through the following hoops to get pyrex to deal with this: ++cdef cspi.SPIExceptionHandler exception_handler_as_type ++cdef cspi.SPIExceptionHandler* exception_handler_ptr ++exception_handler_as_type = exception_handler ++exception_handler_ptr = &exception_handler_as_type ++ ++global_exception = None ++ ++cdef class Registry: ++ def __init__ (self): ++ cdef Xlib.Display *display ++ display = Xlib.XOpenDisplay(NULL) ++ if display == NULL: ++ raise X11Exception ++ else: ++ Xlib.XCloseDisplay(display) ++ ++ result = cspi.SPI_init () ++ #if result!=0: ++ # raise AtspiException("SPI_init: exit code %s" % str(result)) ++ ++ result = cspi.SPI_exceptionHandlerPush (exception_handler_ptr) ++ if not result: ++ raise AtspiException("Unable to install SPI exception handler") ++ ++ def __dealloc (self): ++ result = cspi.SPI_exit () ++ if result!=0: ++ raise AtspiException("SPI_init: exit code %s" % str(result)) ++ ++ def getDesktopCount (self): ++ return cspi.SPI_getDesktopCount() ++ ++ def getDesktop (self, index = 0): ++ cdef Desktop desktop ++ desktop = Desktop () ++ if not desktop.__setItem (cspi.SPI_getDesktop (index)): ++ return False ++ return desktop ++ ++ def getDesktopList (self): ++ # Using the bonobo.activation bindings, getDesktopList() returns a ++ # Python list of Desktop objects. The C bindings seem to do it differently, ++ # and Pyrex doesn't like that method. So we're re-implementing the function ++ # using getDesktopCount() and getDesktop() to work around that. ++ # Yay for Zack! ++ # ++ # -Zack ++ cdef Desktop desktop ++ desktops = [] ++ desktop = Desktop () ++ for i in xrange (cspi.SPI_getDesktopCount ()): ++ desktop.__setItem (cspi.SPI_getDesktop (i)) ++ desktops = desktops + [desktop] ++ return desktops ++ ++registry = Registry() ++ ++cdef class Base: ++ """ ++ Wrapper around a cspi.Accessible ++ """ ++ ++ cdef cspi.Accessible *__item ++ ++ def __new__ (self): ++ self.__item = NULL ++ ++ def __dealloc__ (self): ++ if self.__item != NULL: ++ cspi.Accessible_unref (self.__item) ++ ++ cdef bool __setItem (self, cspi.Accessible *obj): ++ if self.__item != NULL: ++ cspi.Accessible_unref (self.__item) ++ if obj != NULL: ++ self.__item = obj ++ cspi.Accessible_ref (self.__item) ++ return True ++ else: ++ return False ++ ++ def __checkSelf (self): ++ assert self.__item != NULL ++ ++# WHY OH WHY won't this work? :( ++# I need to be able to find out of two Accessible classes contain ++# the same cspi.Accessible objects. ++# ++# def isSameAs (self, base): ++# cdef bool foo ++# foo = self.__item == base.__item ++# return foo ++ ++cdef class EventBase: ++ """ ++ Wrapper around a cspi.AccessibleEvent ++ """ ++ cdef cspi.AccessibleEvent *__item ++ ++ def __new__ (self): ++ self.__item = NULL ++ ++ def __dealloc__ (self): ++ if self.__item != NULL: ++ cspi.AccessibleEvent_unref (self.__item) ++ ++ cdef bool __setItem (self, cspi.AccessibleEvent *obj): ++ if self.__item != NULL: ++ cspi.AccessibleEvent_unref (self.__item) ++ if obj != NULL: ++ self.__item = obj ++ cspi.AccessibleEvent_ref (self.__item) ++ return True ++ else: ++ return False ++ ++ def __checkSelf (self): ++ if self.__item == NULL: ++ raise AttributeError, "__item must not be NULL" ++ ++ def __getattr__ (self, attrName): ++ cdef cspi.Accessible* acc ++ cdef Accessible result ++ if attrName == "source": ++ acc = self.__item.source ++ if acc!=NULL: ++ result = Accessible () ++ result.__setItem (acc) ++ return result ++ elif attrName == "detail1": ++ detail1 = self.__item.detail1 ++ return detail1 ++ elif attrName == "detail2": ++ detail1 = self.__item.detail2 ++ return detail1 ++ elif attrName == "type": ++ return self.__item.type ++ ++cdef class StateSet: ++ """ ++ Wrapper around a cspi.AccessibleStateSet ++ """ ++ cdef cspi.AccessibleStateSet *__item ++ ++ def __new__ (self): ++ self.__item = NULL ++ ++ def __dealloc__ (self): ++ if self.__item != NULL: ++ cspi.AccessibleStateSet_unref (self.__item) ++ ++ def __checkSelf (self): ++ if self.__item == NULL: ++ raise AttributeError, "__item must not be NULL" ++ ++ cdef bool __setItem (self, cspi.AccessibleStateSet *obj): ++ if self.__item != NULL: ++ cspi.AccessibleStateSet_unref (self.__item) ++ if obj != NULL: ++ self.__item = obj ++ cspi.AccessibleStateSet_ref (self.__item) ++ return True ++ else: ++ return False ++ ++ cdef bool __contains (self, cspi.AccessibleState s): ++ self.__checkSelf () ++ return cspi.AccessibleStateSet_contains (self.__item, s) ++ ++ def contains (self, state): ++ self.__checkSelf () ++ return self.__contains(state) ++ ++ cdef void __add (self, cspi.AccessibleState s): ++ self.__checkSelf () ++ cspi.AccessibleStateSet_add(self.__item, s) ++ ++ def add (self, state): ++ self.__checkSelf () ++ self.__add (state) ++ ++ cdef void __remove (self, cspi.AccessibleState s): ++ self.__checkSelf () ++ cspi.AccessibleStateSet_remove (self.__item, s) ++ ++ def remove (self, state): ++ self.__checkSelf () ++ self.__remove (state) ++ ++ def __str__ (self): ++ self.__checkSelf () ++ return str(self.states) ++ ++ def __getattr__(self, name): ++ if name == "states": ++ result = [] ++ for state in range(SPI_STATE_INVALID, SPI_STATE_INDETERMINATE): ++ if self.contains(state): ++ result.append(state) ++ return result ++ else: ++ raise AttributeError, name ++ ++cdef class Relation: ++ """ ++ Wrapper around a cspi.AccessibleRelation ++ """ ++ cdef cspi.AccessibleRelation *__item ++ ++ def __new__ (self): ++ self.__item = NULL ++ ++ def __dealloc__ (self): ++ if self.__item != NULL: ++ cspi.AccessibleRelation_unref (self.__item) ++ ++ def __checkSelf (self): ++ if self.__item == NULL: ++ raise AttributeError, "__item must not be NULL" ++ ++ def __str__ (self): ++ self.__checkSelf () ++ return "relation %s -> %s"%(self.getRelationType (), self.getTargets()) ++ ++ def __repr__ (self): ++ self.__checkSelf () ++ return "relation %s -> %s"%(self.getRelationType (), self.getTargets()) ++ ++ cdef bool __setItem (self, cspi.AccessibleRelation *obj): ++ if self.__item != NULL: ++ cspi.AccessibleRelation_unref (self.__item) ++ if obj != NULL: ++ self.__item = obj ++ cspi.AccessibleRelation_ref (self.__item) ++ return True ++ else: ++ return False ++ ++ def getNTargets (self): ++ """ ++ Wrapper around cspi.AccessibleRelation_getNTargets ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleRelation_getNTargets (self.__item) ++ ++ def getTarget (self, i): ++ """ ++ Wrapper around cspi.AccessibleRelation_getTarget ++ """ ++ self.__checkSelf () ++ cdef Accessible target ++ target = Accessible () ++ target.__setItem (cspi.AccessibleRelation_getTarget (self.__item, i)) ++ target.__checkSelf () ++ return target ++ ++ def getTargets (self): ++ """ ++ Gets the targets of this AccessibleRelation as a list of atspi.Accessible ++ """ ++ self.__checkSelf () ++ result = [] ++ count = self.getNTargets() ++ for i in range(count): ++ result.append(self.getTarget(i)) ++ return result ++ ++ def getRelationType (self): ++ """ ++ Wrapper around cspi.AccessibleRelation_getRelationType ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleRelation_getRelationType (self.__item) ++ ++cdef class Accessible (Base): ++ """ ++ Wrapper around cspi.Accessible ++ """ ++ def __getattr__ (self, name): ++ if name == "name": ++ return self.getName () ++ elif name == "role": ++ return self.getRole () ++ elif name == "roleName": ++ return self.getRoleName () ++ elif name == "description": ++ return self.getDescription () ++ elif name == "parent": ++ return self.getParent () ++ elif name == "childCount": ++ return self.getChildCount () ++ elif name == "indexInParent": ++ return self.getIndexInParent () ++ elif name == "stateSet": ++ return self.getStateSet () ++ else: ++ raise AttributeError, name ++ ++ def getName (self): ++ """ ++ Wrapper around cspi.Accessible_getName ++ """ ++ self.__checkSelf() ++ return string(cspi.Accessible_getName(self.__item)) ++ ++ def getDescription (self): ++ """ ++ Wrapper around cspi.Accessible_getDescription ++ """ ++ self.__checkSelf() ++ return string(cspi.Accessible_getDescription(self.__item)) ++ ++ def getParent (self): ++ """ ++ Wrapper around cspi.Accessible_getParent, returning an ++ atspi.Accessible or None ++ """ ++ self.__checkSelf() ++ cdef Accessible parent ++ cdef cspi.Accessible* spiParent ++ ++ spiParent = cspi.Accessible_getParent (self.__item) ++ if spiParent!=NULL: ++ parent = Accessible () ++ parent.__setItem (spiParent) ++ parent.__checkSelf () ++ return parent ++ else: ++ return None ++ ++ def getChildAtIndex (self, index): ++ """ ++ Wrapper around cspi.Accessible_getChildAtIndex, returning an ++ atspi.Accessible, atspi.Application, or None ++ """ ++ self.__checkSelf() ++ cdef int i ++ i = index ++ ++ # This hairiness is due to the fact that Pyrex doesn't allow cdefs ++ # inside if blocks. ++ ++ cdef cspi.Accessible* spiChild ++ spiChild = cspi.Accessible_getChildAtIndex (self.__item, i) ++ # Workaround for GNOME bug #321273 ++ # http://bugzilla.gnome.org/show_bug.cgi?id=321273 ++ if spiChild == NULL: return None ++ ++ cdef object child ++ cdef Application app ++ cdef Accessible acc ++ cdef Text text ++ ++ if cspi.Accessible_isApplication (spiChild): ++ app = Application () ++ app.__setItem (spiChild) ++ child = app ++ else: ++ acc = Accessible () ++ acc.__setItem (spiChild) ++ child = acc ++ ++ return child ++ ++ def getIndexInParent (self): ++ """ ++ Wrapper around cspi.Accessible_getIndexInParent ++ """ ++ self.__checkSelf() ++ return cspi.Accessible_getIndexInParent (self.__item) ++ ++ def getRole (self): ++ """ ++ Wrapper around cspi.Accessible_getRole ++ """ ++ self.__checkSelf() ++ return cspi.Accessible_getRole (self.__item) ++ ++ def getRoleName (self): ++ """ ++ Wrapper around cspi.Accessible_getRoleName ++ """ ++ self.__checkSelf() ++ return string(cspi.Accessible_getRoleName (self.__item)) ++ ++ def getChildCount (self): ++ """ ++ Wrapper around cspi.Accessible_getChildCount ++ """ ++ self.__checkSelf() ++ return cspi.Accessible_getChildCount (self.__item) ++ ++ def getStateSet (self): ++ """ ++ Wrapper around cspi.Accessible_getStateSet, returning an ++ atspi.StateSet ++ """ ++ self.__checkSelf() ++ cdef StateSet set ++ set = StateSet() ++ set.__setItem (cspi.Accessible_getStateSet (self.__item)) ++ return set ++ ++ def getInterface (self, interface): ++ """ ++ This is NOT part of cspi, it is just for compatibility with ++ the bonobo bindings and will probably go away soon. ++ """ ++ self.__checkSelf() ++ return getattr(self, "get%s" % interface) () ++ ++ def getAction (self): ++ """ ++ Wrapper around cspi.Accessible_getAction, returning ++ an atspi.Action or None ++ """ ++ self.__checkSelf() ++ cdef Action action ++ action = Action () ++ action.__setItem (cspi.Accessible_getAction (self.__item)) ++ if action.__item != NULL: ++ return action ++ ++ def getText (self): ++ """ ++ Wrapper around cspi.Accessible_getText, returning an atspi.Text ++ or None ++ """ ++ self.__checkSelf () ++ cdef Text text ++ text = Text () ++ text.__setItem (cspi.Accessible_getText (self.__item)) ++ if text.__item != NULL: ++ return text ++ ++ def getEditableText (self): ++ """ ++ Wrapper around cspi.Accessible_getText, returning an ++ atspi.EditableText or None ++ """ ++ self.__checkSelf () ++ cdef EditableText etext ++ etext = EditableText () ++ etext.__setItem (cspi.Accessible_getEditableText (self.__item)) ++ if etext.__item != NULL: ++ return etext ++ ++ def getHypertext (self): ++ """ ++ Wrapper around cspi.Accessible_getHypertext, returning an ++ atspi.Hypertext or None ++ """ ++ self.__checkSelf () ++ cdef Hypertext hypertext ++ hypertext = Hypertext () ++ hypertext.__setItem (cspi.Accessible_getHypertext (self.__item)) ++ if hypertext.__item != NULL: ++ return hypertext ++ ++ def getImage (self): ++ """ ++ Wrapper around cspi.Accessible_getImage, returning an ++ atspi.Image or None ++ """ ++ self.__checkSelf () ++ cdef Image image ++ image = Image () ++ image.__setItem (cspi.Accessible_getImage (self.__item)) ++ if image.__item != NULL: ++ return image ++ ++ def getValue (self): ++ """ ++ Wrapper around cspi.Accessible_getValue, returning an ++ atspi.Value or None ++ """ ++ self.__checkSelf () ++ cdef Value value ++ value = Value () ++ value.__setItem (cspi.Accessible_getValue (self.__item)) ++ if value.__item != NULL: ++ return value ++ ++ def getSelection (self): ++ """ ++ Wrapper around cspi.Accessible_getSelection, returning an ++ atspi.Selection or None ++ """ ++ self.__checkSelf () ++ cdef Selection selection ++ selection = Selection () ++ selection.__setItem (cspi.Accessible_getSelection (self.__item)) ++ if selection.__item != NULL: ++ return selection ++ ++ def getComponent (self): ++ """ ++ Wrapper around cspi.Accessible_getComponent, returning an ++ atspi.Component or None ++ """ ++ self.__checkSelf () ++ cdef Component component ++ component = Component () ++ component.__setItem (cspi.Accessible_getComponent (self.__item)) ++ if component.__item != NULL: ++ return component ++ ++ def getRelationSet (self): ++ """ ++ Wraps Accessible_getRelationSet, returning a list ++ of atspi.Relation ++ """ ++ # looking at at-poke, result from C API appears to be a NULL-terminated list of pointers, and that we should free the buffer ++ self.__checkSelf () ++ cdef Relation relation ++ ++ relations = [] ++ cdef cspi.AccessibleRelation **relationSet ++ relationSet = cspi.Accessible_getRelationSet (self.__item) ++ ++ i=0 ++ while relationSet[i]: ++ relation = Relation () ++ relation.__setItem (relationSet[i]) ++ relations.append(relation) ++ i=i+1 ++ cspi.free (relationSet) ++ ++ return relations ++ ++ ++cdef class Desktop (Accessible): ++ pass ++ ++ ++cdef class Application (Accessible): ++ """ ++ Wrapper around the low-level cspi.AccessibleApplication_ functions, ++ giving an OO-style API. ++ """ ++ def getToolkit (self): ++ """ ++ Wraps AccessibleApplication_getToolkitName, returning a string ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleApplication_getToolkitName (self.__item) ++ ++ def getVersion (self): ++ """ ++ Wraps AccessibleApplication_getVersion, returning a string ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleApplication_getVersion(self.__item) ++ ++ def getID (self): ++ """ ++ Wraps AccessibleApplication_getID, returning a string ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleApplication_getID (self.__item) ++ ++ def pause (self): ++ """ ++ Wraps AccessibleApplication_pause ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleApplication_pause (self.__item) ++ ++ def resume (self): ++ """ ++ Wraps AccessibleApplication_resume ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleApplication_resume (self.__item) ++ ++cdef class Component (Accessible): ++ """ ++ Wrapper around the low-level cspi.AccessibleComponent_ functions, ++ giving an OO-style API. ++ """ ++ def getExtents (self, type=0): ++ """ ++ Wraps cspi.AccessibleComponent_getExtents, returning an ++ (x,y,w,h) tuple. ++ """ ++ self.__checkSelf () ++ cdef long x, y, w, h ++ cspi.AccessibleComponent_getExtents (self.__item, &x, &y, &w, &h, type) ++ return (x, y, w, h) ++ ++ def getPosition (self, type = 0): ++ """ ++ Wraps cspi.AccessibleComponent_getPosition, returning an ++ (x,y) tuple. ++ """ ++ self.__checkSelf () ++ cdef long x, y ++ cspi.AccessibleComponent_getPosition (self.__item, &x, &y, type) ++ return (x, y) ++ ++ def getSize (self): ++ """ ++ Wraps cspi.AccessibleComponent_getSize, returning a ++ (w,h) tuple. ++ """ ++ self.__checkSelf () ++ cdef long w, h ++ cspi.AccessibleComponent_getSize (self.__item, &w, &h) ++ return (w, h) ++ ++ def getLayer (self): ++ """ ++ Wraps cspi.AccessibleComponent_getLayer, returning an ++ AccessibleComponentLayer. ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleComponent_getLayer (self.__item) ++ ++ def grabFocus (self): ++ """ ++ Wraps cspi.AccessibleComponent_grabFocus, raising AtspiException ++ if it fails ++ """ ++ self.__checkSelf () ++ if not cspi.AccessibleComponent_grabFocus (self.__item): ++ raise AtspiException("AccessibleComponent_grabFocus") ++ ++ def getMDIZOrder (self): ++ """ ++ Wraps cspi.AccessibleComponent_getMDIZOrder, returning an integer. ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleComponent_getMDIZOrder(self.__item) ++ ++cdef class Action (Base): ++ """ ++ Wrapper around the low-level cspi.AccessibleAction_ functions, ++ giving an OO-style API. ++ """ ++ def __getattr__ (self, name): ++ if name == "nActions": ++ return self.getNActions () ++ else: ++ raise AttributeError, name ++ ++ def getNActions (self): ++ """ ++ Wraps cspi.AccessibleAction_getNActions ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleAction_getNActions (self.__item) ++ ++ def doAction (self, index): ++ """ ++ Wraps cspi.AccessibleAction_doAction ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleAction_doAction (self.__item, index) ++ ++ def getKeyBinding (self, index): ++ """ ++ Wraps cspi.AccessibleAction_getKeyBinding ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleAction_getKeyBinding (self.__item, index) ++ ++ def getName (self, index): ++ """ ++ Wraps cspi.AccessibleAction_getName ++ """ ++ self.__checkSelf () ++ return string(cspi.AccessibleAction_getName (self.__item, index)) ++ ++ def getDescription (self, index): ++ """ ++ Wraps cspi.AccessibleAction_getDescription ++ """ ++ self.__checkSelf () ++ return string(cspi.AccessibleAction_getDescription (self.__item, index)) ++ ++ ++cdef class Text (Base): ++ """ ++ Wrapper around the low-level cspi.AccessibleText_ functions, ++ giving an OO-style API. ++ """ ++ def addSelection (self, startOffset, endOffset): ++ """ ++ Wraps cspi.AccessibleText_addSelection ++ """ ++ self.__checkSelf () ++ if not cspi.AccessibleText_addSelection (self.__item, startOffset, endOffset): ++ raise AtspiException("AccessibleText_addSelection") ++ ++ ++ #def getAttributes (self, offset, startOffset, endOffset): ++ # self.__checkSelf () ++ # return cspi.AccessibleText_getAttributes (self.__item, offset, startOffset, endOffset) ++ def getCaretOffset (self): ++ """ ++ Wraps cspi.AccessibleText_getCaretOffset ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleText_getCaretOffset (self.__item) ++ ++ def getCharacterCount (self): ++ """ ++ Wraps cspi.AccessibleText_getCharacterCount ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleText_getCharacterCount (self.__item) ++ ++ def getNSelections (self): ++ """ ++ Wraps cspi.AccessibleText_getNSelections ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleText_getNSelections (self.__item) ++ ++ #def getSelection (self, selectionNum, startOffset, endOffset): ++ # self.__checkSelf () ++ # return cspi.AccessibleText_getSelection (self.__item, selectionNum, startOffset, endOffset) ++ ++ def getText (self, startOffset, endOffset): ++ """ ++ Wraps cspi.AccessibleText_getText ++ """ ++ self.__checkSelf () ++ return string(cspi.AccessibleText_getText (self.__item, startOffset, endOffset)) ++ ++ def removeSelection (self, selectionNum): ++ """ ++ Wraps cspi.AccessibleText_removeSelection, raising AtspiException if it fails ++ """ ++ self.__checkSelf () ++ if not cspi.AccessibleText_removeSelection (self.__item, selectionNum): ++ raise AtspiException("AccessibleText_removeSelection") ++ ++ def setSelection (self, selectionNum, startOffset, endOffset): ++ """ ++ Wraps cspi.AccessibleText_setSelection, raising AtspiException if it fails ++ """ ++ self.__checkSelf () ++ if not cspi.AccessibleText_setSelection (self.__item, selectionNum, startOffset, endOffset): ++ raise AtspiException("AccessibleText_setSelection") ++ ++ def setCaretOffset (self, position): ++ """ ++ Wraps cspi.AccessibleText_setCaretOffset, raising AtspiException if it fails ++ """ ++ self.__checkSelf () ++ if not cspi.AccessibleText_setCaretOffset (self.__item, position): ++ raise AtspiException("AccessibleText_setCaretOffset") ++ ++cdef class EditableText (Text): ++ """ ++ Wrapper around the low-level cspi.AccessibleEditableText_ functions, ++ giving an OO-style API. ++ """ ++ def setTextContents (self, newContents): ++ """ ++ Wraps cspi.AccessibleEditableText_setTextContents, raising AtspiException if it fails ++ """ ++ self.__checkSelf () ++ if not cspi.AccessibleEditableText_setTextContents (self.__item, newContents): ++ raise AtspiException("AccessibleEditableText_setTextContents") ++ ++ def setAttributes (self, attributes, startOffset, endOffset): ++ """ ++ Wraps cspi.AccessibleEditableText_setAttributes, raising AtspiException if it fails ++ """ ++ self.__checkSelf () ++ if not cspi.AccessibleEditableText_setAttributes (self.__item, attributes, startOffset, endOffset): ++ raise AtspiException("AccessibleEditableText_setAttributes") ++ ++ def insertText (self, position, text): ++ """ ++ Wraps cspi.AccessibleEditableText_insertText, raising AtspiException if it fails ++ """ ++ self.__checkSelf () ++ if not cspi.AccessibleEditableText_insertText (self.__item, position, text, cspi.strlen(text)): ++ raise AtspiException("AccessibleEditableText_insertText") ++ ++cdef class Hypertext (Text): ++ """ ++ Wrapper around the low-level cspi.AccessibleHypertext_ functions, ++ giving an OO-style API. ++ """ ++ def getNLinks (self): ++ """ ++ Wraps cspi.AccessibleHypertext_getNLinks, raising AtspiException if it fails ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleHypertext_getNLinks (self.__item) ++ ++ def getLink (self, linkIndex): ++ """ ++ Wraps cspi.AccessibleHypertext_getLink, raising AtspiException if it fails ++ """ ++ self.__checkSelf () ++ cdef Hyperlink hyperlink ++ hyperlink = Hyperlink () ++ hyperlink.__setItem (cspi.AccessibleHypertext_getLink (self.__item, linkIndex)) ++ if hyperlink.__item != NULL: ++ return hyperlink ++ ++ def getLinkIndex (self, characterOffset): ++ """ ++ Wraps cspi.AccessibleHypertext_getLinkIndex, raising AtspiException if it fails ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleHypertext_getLinkIndex (self.__item, characterOffset) ++ ++cdef class Hyperlink (Base): ++ """ ++ Wrapper around the low-level cspi.AccessibleHyperlink_ functions, ++ giving an OO-style API. ++ """ ++ def getNAnchors (self): ++ """ ++ Wraps cspi.AccessibleHyperlink_getNAnchors, raising AtspiException if it fails ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleHyperlink_getNAnchors (self.__item) ++ ++ def getIndexRange (self): ++ """ ++ Wraps cspi.AccessibleHyperlink_getIndexRange, returning [startIndex, endIndex] pair ++ """ ++ self.__checkSelf () ++ cdef long startIndex, endIndex ++ cspi.AccessibleHyperlink_getIndexRange(self.__item, &startIndex, &endIndex) ++ return [startIndex, endIndex] ++ ++ ++ def getObject (self, i): ++ """ ++ Wraps cspi.AccessibleHyperlink_getObject ++ """ ++ self.__checkSelf () ++ cdef Accessible object ++ object = Accessible () ++ object.__setItem (cspi.AccessibleHyperlink_getObject (self.__item, i)) ++ object.__checkSelf () ++ return object ++ ++ def getURI (self, i): ++ """ ++ Wraps cspi.AccessibleHyperlink_getURI, raising AtspiException if it fails ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleHyperlink_getURI (self.__item, i) ++ ++ def isValid (self): ++ """ ++ Wraps cspi.AccessibleHyperlink_isValid, raising AtspiException if it fails ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleHyperlink_isValid (self.__item) ++ ++cdef class Image (Base): ++ """ ++ Wrapper around the low-level cspi.AccessibleImage_ functions, ++ giving an OO-style API. ++ """ ++ def getImageDescription (self): ++ """ ++ Wraps cspi.AccessibleImage_getImageDescription ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleImage_getImageDescription (self.__item) ++ ++ def getImageSize (self): ++ """ ++ Wraps cspi.AccessibleImage_getImageSize, returning a (w,h) pair ++ """ ++ self.__checkSelf () ++ cdef long w, h ++ cspi.AccessibleImage_getImageSize(self.__item, &w, &h); ++ return [w, h] ++ ++ def getImagePosition (self, type=0): ++ """ ++ Wraps cspi.AccessibleImage_getImagePosition, returning a (x,y) ++ pair ++ """ ++ self.__checkSelf () ++ cdef long x, y ++ cspi.AccessibleImage_getImagePosition(self.__item, &x, &y, type) ++ return [x, y] ++ ++ def getImageExtents (self, type=0): ++ """ ++ Wraps cspi.AccessibleImage_getImageExtents, returning a ++ (x,y,w,h) tuple ++ """ ++ self.__checkSelf () ++ cdef long x, y, w, h ++ cspi.AccessibleImage_getImageExtents(self.__item, &x, &y, &w, &h, type) ++ return [x, y, w, h] ++ ++cdef class Value (Base): ++ """ ++ Wrapper around the low-level cspi.AccessibleValue_ functions, ++ giving an OO-style API. ++ """ ++ def getMinimumValue (self): ++ """ ++ Wraps cspi.AccessibleValue_getMinimumValue ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleValue_getMinimumValue(self.__item) ++ ++ def getCurrentValue (self): ++ """ ++ Wraps cspi.AccessibleValue_getMinimumValue ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleValue_getCurrentValue(self.__item) ++ ++ def getMaximumValue (self): ++ """ ++ Wraps cspi.AccessibleValue_getMinimumValue ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleValue_getMaximumValue(self.__item) ++ ++ def setCurrentValue (self, newValue): ++ """ ++ Wraps cspi.AccessibleValue_setCurrentValue ++ """ ++ self.__checkSelf () ++ if not cspi.AccessibleValue_setCurrentValue (self.__item, newValue): ++ raise AtspiException("AccessibleValue_setCurrentValue") ++ ++cdef class Selection (Base): ++ """ ++ Wrapper around the low-level cspi.AccessibleSelection_ functions, ++ giving an OO-style API. ++ """ ++ ++ def getNSelectedChildren (self): ++ """ ++ Wraps cspi.AccessibleSelection_getNSelectedChildren ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleSelection_getNSelectedChildren (self.__item) ++ ++ def getSelectedChild (self, index): ++ """ ++ Wraps cspi.AccessibleSelection_getSelectedChild ++ """ ++ self.__checkSelf () ++ ++ cdef cspi.Accessible* spiChild ++ spiChild = cspi.AccessibleSelection_getSelectedChild (self.__item, index) ++ ++ assert spiChild != NULL ++ ++ cdef object child ++ cdef Application app ++ cdef Accessible acc ++ cdef Text text ++ ++ if cspi.Accessible_isApplication (spiChild): ++ app = Application () ++ app.__setItem (spiChild) ++ child = app ++ else: ++ acc = Accessible () ++ acc.__setItem (spiChild) ++ child = acc ++ ++ return child ++ ++ def selectChild (self, index): ++ """ ++ Wraps cspi.AccessibleSelection_selectChild ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleSelection_selectChild (self.__item, index) ++ ++ def deselectSelectedChild (self, index): ++ """ ++ Wraps cspi.AccessibleSelection_deselectSelectedChild ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleSelection_deselectSelectedChild (self.__item, index) ++ ++ def isChildSelected (self, index): ++ """ ++ Wraps cspi.AccessibleSelection_isChildSelected ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleSelection_isChildSelected (self.__item, index) ++ ++ def selectAll (self): ++ """ ++ Wraps cspi.AccessibleSelection_selectAll ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleSelection_selectAll( self.__item) ++ ++ def clearSelection (self): ++ """ ++ Wraps cspi.AccessibleSelection_clearSelection ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleSelection_clearSelection (self.__item) ++ ++cdef class Table (Base): ++ """ ++ Wrapper around the low-level cspi.AccessibleTable_ functions, ++ giving an OO-style API. ++ """ ++ ++ # def getTableAccessibleAt (self, row, column): ++ # def getTableCaption (self): ++ ++ def getTableColumnAtIndex (self, index): ++ """ ++ Wraps cspi.AccessibleTable_getColumnAtIndex ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleTable_getColumnAtIndex(self.__item, index) ++ ++ def getTableColumnDescription (self, column): ++ """ ++ Wraps cspi.AccessibleTable_getColumnDescription ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleTable_getColumnDescription(self.__item, column) ++ ++ def getTableColumnExtentAt (self, row, column): ++ """ ++ Wraps cspi.AccessibleTable_getColumnExtentAt ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleTable_getColumnExtentAt(self.__item, row, column) ++ ++ # def getTableColumnHeader (self, column): ++ ++ def getTableIndexAt (self, row, column): ++ """ ++ Wraps cspi.AccessibleTable_getIndexAt ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleTable_getIndexAt(self.__item, row, column) ++ ++ def getTableNColumns (self): ++ """ ++ Wraps cspi.AccessibleTable_getNColumns ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleTable_getNColumns(self.__item) ++ ++ def getTableNRows (self): ++ """ ++ Wraps cspi.AccessibleTable_getNRows ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleTable_getNRows(self.__item) ++ ++ def getTableNSelectedColumns (self): ++ """ ++ Wraps cspi.AccessibleTable_getNSelectedColumns ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleTable_getNSelectedColumns(self.__item) ++ ++ def getTableNSelectedRows (self): ++ """ ++x Wraps cspi.AccessibleTable_getNSelectedRows ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleTable_getNSelectedRows(self.__item) ++ ++ def getTableRowAtIndex (self, index): ++ """ ++ Wraps cspi.AccessibleTable_getRowAtIndex ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleTable_getRowAtIndex(self.__item, index) ++ ++ def getTableRowDescription (self, row): ++ """ ++ Wraps cspi.AccessibleTable_getRowDescription ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleTable_getRowDescription(self.__item, row) ++ ++ def getTableRowExtentAt (self, row, column): ++ """ ++ Wraps cspi.AccessibleTable_getRowExtentAt ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleTable_getRowExtentAt(self.__item, row, column) ++ ++ # def getTableRowHeader (self, row): ++ # def getTableSelectedRows (self, **selectedRows): - Not sure if the variable which is a pointer to a pointer is acceptable ++ # def getTableSelectedColumns (self, **selectedColumns): - Same issue as above ++ # def getTableSummary (self): ++ ++ def isTableColumnSelected (self, column): ++ """ ++ Wraps cspi.AccessibleTable_isColumnSelected ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleTable_isColumnSelected(self.__item, column) ++ ++ def isTableRowSelected (self, row): ++ """ ++ Wraps cspi.AccessibleTable_isRowSelected ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleTable_isRowSelected(self.__item, row) ++ ++ def isTableSelected (self, row, column): ++ """ ++ Wraps cspi.AccessibleTable_isSelected ++ """ ++ self.__checkSelf () ++ return cspi.AccessibleTable_isSelected(self.__item, row, column) ++ ++ ++cdef class Event (EventBase): ++ #def AccessibleEventListener* SPI_createAccessibleEventListener (AccessibleEventListenerCB callback, void *user_data) ++ #void AccessibleEventListener_unref (AccessibleEventListener *listener) ++ #SPIBoolean AccessibleEventListener_addCallback (AccessibleEventListener *listener, AccessibleEventListenerCB callback, void *user_data) ++ #SPIBoolean AccessibleEventListener_removeCallback (AccessibleEventListener *listener, AccessibleEventListenerCB callback) ++ ++ #Accessible* AccessibleActiveDescendantChangedEvent_getActiveDescendant (AccessibleEvent *event) ++ #Accessible* AccessibleChildChangedEvent_getChildAccessible (AccessibleEvent *event) ++ ++ def getDescriptionChangedEventDescriptionString (self): ++ self.__checkSelf() ++ return string(cspi.AccessibleDescriptionChangedEvent_getDescriptionString(self.__item)) ++ ++ def getNameChangedEventNameString (self): ++ self.__checkSelf() ++ return string(cspi.AccessibleNameChangedEvent_getNameString(self.__item)) ++ ++ # Accessible* AccessibleParentChangedEvent_getParentAccessible (AccessibleEvent *event) ++ ++ def getTableCaptionChangedEventCaptionString(self): ++ self.__checkSelf() ++ return string(cspi.AccessibleTableCaptionChangedEvent_getCaptionString(self.__item)) ++ ++ def getTableColumnDescriptionChangedEventDescriptionString(self): ++ self.__checkSelf () ++ return string(cspi.AccessibleTableColumnDescriptionChangedEvent_getDescriptionString(self.__item)) ++ ++ # Accessible* AccessibleTableHeaderChangedEvent_getHeaderAccessible (AccessibleEvent *event) ++ ++ def getTableRowDescriptionChangedEventDescriptionString(self): ++ self.__checkSelf () ++ return string(cspi.AccessibleTableRowDescriptionChangedEvent_getDescriptionString(self.__item)) ++ ++ #Accessible* AccessibleTableSummaryChangedEvent_getSummaryAccessible (AccessibleEvent *event) ++ ++ def getTextChangedEventChangeString (self): ++ self.__checkSelf () ++ return string(cspi.AccessibleTextChangedEvent_getChangeString(self.__item)) ++ ++ def getTextSelectionChangedEventSelectionString (self): ++ self.__checkSelf () ++ return string(cspi.AccessibleTextSelectionChangedEvent_getSelectionString(self.__item)) ++ ++ def getWindowEventTitleString (self): ++ self.__checkSelf () ++ return string(cspi.AccessibleWindowEvent_getTitleString(self.__item)) ++ ++class EventGenerator: ++ """ ++ Wrapper layer around SPI_generateKeyboardEvent and ++ SPI_generateMouseEvent, used for generating input events. ++ ++ Use AccessibleAction in preference to this. ++ """ ++ def injectKeyboardString (self, string): ++ """ ++ Inject a string as if it had been typed using an input method. ++ """ ++ # Seems to only work if you do it one character at a time... ++ for char in string: ++ self.__generateKeystringEvent (str(char), cspi.SPI_KEY_STRING) ++ ++ def __keyStringToKeyCode(self, keyString): ++ cdef Xlib.Display *display ++ display = Xlib.XOpenDisplay(NULL) ++ ++ cdef Xlib.KeySym sym ++ sym = Xlib.XStringToKeysym(keyString) ++ cdef Xlib.KeyCode code ++ code = Xlib.XKeysymToKeycode(display, sym) ++ ++ #print str(keyString), str(int(sym)), code ++ ++ Xlib.XCloseDisplay(display) ++ return int(code) ++ ++ def generateKeyCombo (self, keyStrings): ++ modifiers = keyStrings[:-1] ++ finalKey = keyStrings[-1] ++ ++ for modifier in modifiers: ++ code = self.__keyStringToKeyCode(modifier) ++ self.generateKeyboardEvent(code, '', cspi.SPI_KEY_PRESS) ++ ++ code = self.__keyStringToKeyCode(finalKey) ++ self.generateKeyboardEvent(code, '', cspi.SPI_KEY_PRESSRELEASE) ++ ++ for modifier in modifiers: ++ code = self.__keyStringToKeyCode(modifier) ++ self.generateKeyboardEvent(code, '', cspi.SPI_KEY_RELEASE) ++ ++ ++ def __generateKeyvalEvent (self, keyval, synthType): ++ self.generateKeyboardEvent (keyval, None, synthType) ++ ++ def __generateKeystringEvent (self, keystring, synthType): ++ self.generateKeyboardEvent (0, keystring, synthType) ++ ++ def generateKeyboardEvent (self, keyval, keystring, synthType): ++ if not cspi.SPI_generateKeyboardEvent (keyval, keystring, synthType): ++ raise AtspiException("SPI_generateKeyboardEvent") ++ ++ def click (self, x, y, button): ++ """ ++ Synthesize a mouse button click at (x,y) ++ """ ++ self.__generateButtonEvent (x, y, button, "c") ++ ++ def doubleClick (self, x, y, button): ++ """ ++ Synthesize a mouse button double-click at (x,y) ++ """ ++ self.__generateButtonEvent (x, y, button, "d") ++ ++ def press (self, x, y, button): ++ """ ++ Synthesize a mouse button press at (x,y) ++ """ ++ self.__generateButtonEvent (x, y, button, "p") ++ ++ def release (self, x, y, button): ++ """ ++ Synthesize a mouse button release at (x,y) ++ """ ++ self.__generateButtonEvent (x, y, button, "r") ++ ++ def absoluteMotion (self, x, y): ++ """ ++ Synthesize mouse absolute motion to (x,y) ++ """ ++ self.__generateEvent (x, y, "abs") ++ ++ def relativeMotion (self, x, y): ++ """ ++ Synthesize mouse relative motion of (x,y) ++ """ ++ self.__generateEvent (x, y, "rel") ++ ++ def drag (self, fromXY, toXY, button): ++ """ ++ Synthesize a drag (press, move and release) from (x,y) to (x,y). ++ ++ These are absolute screen coordinates ++ """ ++ (x,y) = fromXY ++ self.press (x, y, button) ++ ++ (x,y) = toXY ++ self.absoluteMotion(x,y) ++ ++ self.release (x, y, button) ++ ++ def __generateEvent (self, x, y, name): ++ """ ++ Thin wrapper around SPI_generateMouseEvent. ++ ++ Event names: b1p = button 1 press; b2r = button 2 release; ++ b3c = button 3 click; b2d = button 2 double-click; ++ abs = absolute motion; rel = relative motion. ++ """ ++ if not cspi.SPI_generateMouseEvent (x, y, name): ++ raise AtspiException("Error generating mouse event") ++ ++ def __generateButtonEvent (self, x, y, button, suffix): ++ self.__generateEvent (x, y, self.__generateButtonName(button)+suffix) ++ ++ def __generateButtonName(self, button): ++ if button==1: ++ return "b1" ++ elif button==2: ++ return "b2" ++ elif button==3: ++ return "b3" ++ else: raise ValueError, "Unknown button" ++ ++# We use this C function to marshal a call to a python function. The Python callback ++# function is installed as the userdata of this C callback function. See the ++# "cheesefinder" demo in the Pyrex sources. ++# We ignore the "const"ness of the AccessibleEvent ++cdef void marshalAccessibleEventCallback (cspi.AccessibleEvent *event, void *python_fn) except *: ++ e = Event() ++ EventBase.__setItem(e, event) ++ (<object>python_fn) (e) ++ ++cdef class EventListener: ++ """ ++ Wrapper around the low-level cspi.AccessibleEventListener_ functions, ++ giving an OO-style API. ++ """ ++ cdef cspi.AccessibleEventListener *__item ++ cdef public object eventTypes ++ ++ def __init__ (self, callback, eventTypes): ++ """ ++ Registers a python callback function to be called. ++ The callback is expected to have one input, of type atspi.Event, and no return value. ++ See documentation of SPI_registerGlobalEventListener for the event names ++ """ ++ self.eventTypes = eventTypes ++ self.__item = cspi.SPI_createAccessibleEventListener (marshalAccessibleEventCallback, <void*>callback) ++ for eventType in self.eventTypes: ++ #char *e ++ e = eventType ++ if not cspi.SPI_registerGlobalEventListener (self.__item, e): ++ raise AtspiException("Unable to register event listener") ++ ++ def deregister(self): ++ for eventType in self.eventTypes: ++ cspi.SPI_deregisterGlobalEventListener(self.__item, eventType) ++ ++ def __dealloc__ (self): ++ if self.__item != NULL: ++ self.deregister() ++ cspi.AccessibleEventListener_unref (self.__item) ++ ++ def __checkSelf (self): ++ if self.__item == NULL: ++ raise AttributeError, "__item must not be NULL" ++ ++cdef class DeviceEvent: ++ """ ++ Wrapper around a cspi.AccessibleDeviceEvent ++ """ ++ cdef cspi.AccessibleDeviceEvent *__item ++ cdef public object keyID ++ cdef public object keyCode ++ cdef public object keyString ++ cdef public object timeStamp ++ cdef public object type ++ cdef public object modifiers ++ cdef public object isText ++ ++ def __new__ (self): ++ self.__item = NULL ++ ++ cdef bool __setItem (self, cspi.AccessibleDeviceEvent *obj): ++ if obj != NULL: ++ self.__item = obj ++ self.keyID = self.__item.keyID ++ self.keyCode = self.__item.keycode ++ self.keyString = self.__item.keystring ++ self.timeStamp = self.__item.timestamp ++ self.type = self.__item.type ++ self.modifiers = self.__item.modifiers ++ if self.__item.is_text: self.isText = True ++ else: self.isText = False ++ return True ++ else: ++ return False ++ ++ def __checkSelf (self): ++ if self.__item == NULL: ++ raise AttributeError, "__item must not be NULL" ++ ++# def __dealloc__ (self): ++# if self.__item != NULL: ++# cspi.AccessibleDeviceEvent_unref (self.__item) ++ ++ ++cdef cspi.SPIBoolean marshalAccessibleDeviceEventCallback (cspi.AccessibleDeviceEvent *event, void *python_fn) except 1: ++ k = DeviceEvent() ++ #k.__setItem(event) ++ DeviceEvent.__setItem(k, event) ++ k.__checkSelf() ++ (<object>python_fn) (k) ++ return False ++ ++cdef class DeviceListener: ++ """ ++ Wrapper around the low-level cspi.AccessibleDeviceListener_ functions, ++ giving an OO-style API. ++ """ ++ cdef cspi.AccessibleDeviceListener *__item ++ cdef public object modMasks ++ ++ def __init__ (self, callback, eventMask = cspi.SPI_KEY_PRESSED | cspi.SPI_KEY_RELEASED): ++ """ ++ Registers a python callback function to be called. ++ ++ eventMask may be one of the following: ++ key pressed: 1 ++ key released: 2 ++ key pressed or released (default): 3 ++ """ ++ self.__item = cspi.SPI_createAccessibleDeviceListener (marshalAccessibleDeviceEventCallback, <void*>callback) ++ cdef cspi.AccessibleKeySet *keySet ++ keySet = SPI_KEYSET_ALL_KEYS ++ self.modMasks = [] ++ cdef short int modMask ++ syncType = SPI_KEYLISTENER_SYNCHRONOUS | SPI_KEYLISTENER_CANCONSUME ++ #syncType = SPI_KEYLISTENER_NOSYNC ++ for modMask from 0 <= modMask < (1 << 8): ++ self.modMasks.append(modMask) ++ desc = "keySet "+str(<int> keySet)+" modMask "+str(modMask)+" eventMask "+str(eventMask)+" syncType "+str(syncType) ++ desc = str(desc) ++ if not cspi.SPI_registerAccessibleKeystrokeListener (self.__item, keySet, modMask, eventMask, syncType): ++ raise AtspiException("Unable to register keystroke listener", desc) ++ ++ def deregister(self): ++ if self.__item != NULL: ++ for modMask in self.modMasks: ++ cspi.SPI_deregisterAccessibleKeystrokeListener(self.__item, modMask) ++ ++ def __dealloc__ (self): ++ if self.__item != NULL: ++ self.deregister() ++ cspi.AccessibleDeviceListener_unref (self.__item) ++ ++ def __checkSelf (self): ++ if self.__item == NULL: ++ raise AttributeError, "__item must not be NULL" ++ ++ ++# vim: sw=4 ts=4 sts=4 noet ai diff --git a/testing/python-pysqlite/PKGBUILD b/testing/python-pysqlite/PKGBUILD new file mode 100644 index 000000000..5e889eab9 --- /dev/null +++ b/testing/python-pysqlite/PKGBUILD @@ -0,0 +1,38 @@ +# $Id: PKGBUILD 168875 2012-10-16 11:55:25Z allan $ +# Maintainer: Angel Velasquez <angvp@archlinux.org> +# Contributor: Aaron Griffin <aaron@archlinux.org> +# Contributor: Daniel J Griffiths <ghost1227@archlinux.us> + +pkgbase=python-pysqlite +pkgname=python2-pysqlite +pkgver=2.6.3 +pkgrel=3 +pkgdesc="A Python DB-API 2.0 interface for the SQLite embedded relational database engine" +license=('custom') +arch=('i686' 'x86_64') +url="http://code.google.com/p/pysqlite/" +depends=('python2' 'sqlite') +conflicts=('python-pysqlite<=2.6.3-2') +replaces=('python-pysqlite<=2.6.3-2') +source=(http://pysqlite.googlecode.com/files/pysqlite-${pkgver}.tar.gz \ + setup.cfg) +md5sums=('711afa1062a1d2c4a67acdf02a33d86e' + '86dd356c65afd14a22f2f8f64a26441e') + +check() { + cd "${srcdir}"/pysqlite-${pkgver}/build/lib.*/ + python2 -c "from pysqlite2 import test; test.test()" +} + +build() { + cd "${srcdir}/pysqlite-${pkgver}" + cp "${srcdir}/setup.cfg" . + python2 setup.py build +} + +package_python2-pysqlite() { + cd "${srcdir}/pysqlite-${pkgver}" + python2 setup.py install --root="${pkgdir}" + install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + rm -r "${pkgdir}/usr/pysqlite2-doc" +} diff --git a/testing/python-pysqlite/setup.cfg b/testing/python-pysqlite/setup.cfg new file mode 100644 index 000000000..ba6c77075 --- /dev/null +++ b/testing/python-pysqlite/setup.cfg @@ -0,0 +1,5 @@ +[build_ext] +define= +include_dirs=/usr/include +library_dirs=/usr/lib +libraries=sqlite3 diff --git a/testing/python-urwid/PKGBUILD b/testing/python-urwid/PKGBUILD new file mode 100644 index 000000000..d1804969c --- /dev/null +++ b/testing/python-urwid/PKGBUILD @@ -0,0 +1,42 @@ +# $Id: PKGBUILD,v 1.10 2009/03/13 21:14:09 sergej Exp $ +# Maintainer: Daniel Isenmann <daniel@archlinux.org> +# Maintainer: Sergej Pupykin <sergej@aur.archlinux.org> +# Maintainer: Douglas Soares de Andrade <dsandrade@gmail.com> + +pkgname=('python-urwid' 'python2-urwid') +pkgver=1.0.2 +pkgrel=2 +pkgdesc="Urwid is a curses-based user interface library." +license=('LGPL') +arch=('i686' 'x86_64') +makedepends=('python2-distribute' 'python-distribute') +url="http://excess.org/urwid/" +source=(http://excess.org/urwid/urwid-$pkgver.tar.gz) +md5sums=('00542bbd15fae7ea60b02a7570edee2b') + +build() { + cp -r urwid-$pkgver python2-urwid-$pkgver + + cd "$srcdir/urwid-$pkgver" + python setup.py build + + cd "$srcdir/python2-urwid-$pkgver" + sed -i 's#bin/python#bin/python2#' urwid/*.py + + python2 setup.py build +} + +package_python-urwid() { + depends=('python') + + cd "$srcdir/urwid-$pkgver" + python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 +} + +package_python2-urwid() { + depends=('python2') + + cd "$srcdir/python2-urwid-$pkgver" + python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 +} + diff --git a/testing/python-wpactrl/PKGBUILD b/testing/python-wpactrl/PKGBUILD new file mode 100644 index 000000000..ea380a61a --- /dev/null +++ b/testing/python-wpactrl/PKGBUILD @@ -0,0 +1,26 @@ +# $Id: PKGBUILD 168879 2012-10-16 11:55:34Z allan $ +# Maintainer: Daniel Isenmann <daniel@archlinux.org> + +pkgbase=python-wpactrl +pkgname=python2-wpactrl +pkgver=20090609 +pkgrel=4 +pkgdesc="A Python extension for wpa_supplicant/hostapd control interface access" +arch=('i686' 'x86_64') +url="http://projects.otaku42.de/wiki/PythonWpaCtrl" +license=('GPL2') +depends=('python2') +conflicts=('python-wpactrl<=20090609-3') +replaces=('python-wpactrl<=20090609-3') +source=(ftp://ftp.archlinux.org/other/${pkgbase}/python-wpactrl-20090609.tar.gz) +md5sums=('8d45739aa9bfa1110a4570bb5ceda768') + +build() { + cd "${srcdir}/${pkgbase}-${pkgver}" + python2 setup.py build +} + +package_python2-wpactrl() { + cd "${srcdir}/${pkgbase}-${pkgver}" + python2 setup.py install --root="${pkgdir}" +} diff --git a/testing/python/PKGBUILD b/testing/python/PKGBUILD new file mode 100644 index 000000000..f35fd3cd5 --- /dev/null +++ b/testing/python/PKGBUILD @@ -0,0 +1,75 @@ +# $Id: PKGBUILD 168851 2012-10-16 11:54:17Z allan $ +# Maintainer: Stéphane Gaudreault <stephane@archlinux.org> +# Contributor: Allan McRae <allan@archlinux.org> +# Contributor: Jason Chu <jason@archlinux.org> + +pkgname=python +pkgver=3.3.0 +pkgrel=1 +_pybasever=3.3 +pkgdesc="Next generation of the python high-level scripting language" +arch=('i686' 'x86_64') +license=('custom') +url="http://www.python.org/" +depends=('expat' 'bzip2' 'gdbm' 'openssl' 'libffi' 'zlib') +makedepends=('tk' 'sqlite' 'valgrind') +optdepends=('tk: for tkinter' 'sqlite') +provides=('python3') +replaces=('python3') +options=('!makeflags') +source=(http://www.python.org/ftp/python/${pkgver%rc*}/Python-${pkgver}.tar.xz) +sha1sums=('833d73565e1b665f1878504081dc985a5a06e46a') + +build() { + cd "${srcdir}/Python-${pkgver}" + + # FS#23997 + sed -i -e "s|^#.* /usr/local/bin/python|#!/usr/bin/python|" Lib/cgi.py + + # Ensure that we are using the system copy of various libraries (expat, zlib and libffi), + # rather than copies shipped in the tarball + rm -r Modules/expat + rm -r Modules/zlib + rm -r Modules/_ctypes/{darwin,libffi}* + + ./configure --prefix=/usr \ + --enable-shared \ + --with-threads \ + --with-computed-gotos \ + --enable-ipv6 \ + --with-valgrind \ + --with-system-expat \ + --with-dbmliborder=gdbm:ndbm \ + --with-system-ffi + + make +} + +check() { + cd "${srcdir}/Python-${pkgver}" + LD_LIBRARY_PATH="${srcdir}/Python-${pkgver}":${LD_LIBRARY_PATH} \ + "${srcdir}/Python-${pkgver}/python" -m test.regrtest -x test_distutils test_site \ + test_urllib test_uuid test_pydoc +} + +package() { + cd "${srcdir}/Python-${pkgver}" + make DESTDIR="${pkgdir}" install maninstall + + # Why are these not done by default... + ln -sf python3 "${pkgdir}/usr/bin/python" + ln -sf python3-config "${pkgdir}/usr/bin/python-config" + ln -sf idle3 "${pkgdir}/usr/bin/idle" + ln -sf pydoc3 "${pkgdir}/usr/bin/pydoc" + ln -sf python${_pybasever}.1 "${pkgdir}/usr/share/man/man1/python3.1" + + # Fix FS#22552 + ln -sf ../../libpython${_pybasever}m.so \ + "${pkgdir}/usr/lib/python${_pybasever}/config-${_pybasever}m/libpython${_pybasever}m.so" + + # Clean-up reference to build directory + sed -i "s|$srcdir/Python-${pkgver}:||" "$pkgdir/usr/lib/python${_pybasever}/config-${_pybasever}m/Makefile" + + # License + install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} diff --git a/testing/sonata/PKGBUILD b/testing/sonata/PKGBUILD new file mode 100644 index 000000000..17bb77c02 --- /dev/null +++ b/testing/sonata/PKGBUILD @@ -0,0 +1,30 @@ +# $Id: PKGBUILD 168892 2012-10-16 12:14:00Z allan $ +# Maintainer: Angel Velasquez <angvp@archlinux.org> +# Contributor: William Rea <sillywilly@gmail.com> + +pkgname=sonata +pkgver=1.6.2.1 +pkgrel=8 +pkgdesc="Elegant GTK+ music client for MPD" +arch=('i686' 'x86_64') +url="http://sonata.berlios.de/" +license=('GPL3') +depends=('pygtk' 'python2-mpd') +optdepends=('gnome-python-extras: Enhanced system tray support' + 'tagpy: Metadata editing support' + 'python2-dbus: Various extra functionality (e.g. multimedia keys support)') +source=(http://download.berlios.de/${pkgname}/${pkgname}-$pkgver.tar.gz + info.py.patch) +md5sums=('0b912325e7175abad3bf6c0edc071e05' + '595fcf7615035829b264afecb5a1beeb') + +build() { + cd "$srcdir/${pkgname}-$pkgver" + patch -Np0 -i "$srcdir/info.py.patch" + sed -i 's|/usr/bin/env python|/usr/bin/env python2|' sonata/breadcrumbs.py +} + +package() { + cd "$srcdir/${pkgname}-$pkgver" + python2 setup.py install --prefix=/usr --optimize 1 --root="$pkgdir" +} diff --git a/testing/sonata/info.py.patch b/testing/sonata/info.py.patch new file mode 100644 index 000000000..e95cc3a08 --- /dev/null +++ b/testing/sonata/info.py.patch @@ -0,0 +1,15 @@ +--- sonata/info.py 2011-07-05 22:32:08.452556016 -0500 ++++ sonata/info.py 2011-07-05 22:45:50.849311466 -0500 +@@ -393,9 +393,9 @@ + if content.startswith("#REDIRECT [["): + addr = "http://lyricwiki.org/index.php?title=%s&action=edit" % urllib.quote(content.split("[[")[1].split("]]")[0]) + content = urllib.urlopen(addr).read() +- lyrics = content.split("<lyrics>")[1].split("</lyrics>")[0] +- if lyrics.strip() != "<!-- PUT LYRICS HERE (and delete this entire line) -->": +- lyrics = misc.unescape_html(lyrics) ++ content = misc.unescape_html(content) ++ lyrics = content.split("<lyrics>")[1].split("</lyrics>")[0].strip() ++ if lyrics.strip() != "<!-- PUT LYRICS HERE (and delete this entire line) -->": + lyrics = misc.wiki_to_html(lyrics) + lyrics = lyrics.decode("utf-8") + # Save lyrics to file: diff --git a/testing/system-config-printer/PKGBUILD b/testing/system-config-printer/PKGBUILD new file mode 100644 index 000000000..6ee650101 --- /dev/null +++ b/testing/system-config-printer/PKGBUILD @@ -0,0 +1,108 @@ +# $Id: PKGBUILD 168898 2012-10-16 13:51:27Z allan $ +# Maintainer: Andrea Scarpino <andrea@archlinux.org> + +pkgbase=system-config-printer +pkgname=('system-config-printer-common' + 'system-config-printer-gnome') +pkgver=1.3.11 +pkgrel=2 +pkgdesc="A CUPS printer configuration tool and status applet" +url="http://cyberelk.net/tim/software/system-config-printer/" +arch=('i686' 'x86_64') +license=('GPL') +makedepends=('udev' 'libcups' 'intltool' 'python2' 'xmlto' 'docbook-xsl' + 'libusb-compat' 'desktop-file-utils') +source=(http://cyberelk.net/tim/data/${pkgbase}/1.3/${pkgbase}-${pkgver}.tar.xz{,.sig}) +md5sums=('081fde89686ee15a9433c0035f5faed0' + '470964eb627af31f2aff9967a4b9a5bb') + +build() { + cd "${srcdir}"/${pkgbase}-${pkgver} + + sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \ + -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \ + $(find . -name '*.py') + sed -i "s|#!/usr/bin/python|#!/usr/bin/python2|" udev/udev-add-printer + + # Fix build with udev 183 + sed -i 's:udev_get_sys_path (udev):"/sys":' udev/udev-configure-printer.c + + ./configure --prefix=/usr \ + --sbindir=/usr/bin \ + --sysconfdir=/etc \ + --with-udev-rules + + make +} + +package_system-config-printer-common() { + pkgdesc='Pygtk CUPS Configuration' + depends=('udev' 'pycups' 'python2-dbus' 'pysmbc' 'python2-pycurl' 'libusb-compat') + optdepends=('system-config-printer-gnome: for the GTK frontend' + 'kdeadmin-system-config-printer-kde: for the administration tool in KDE System Settings') + replaces=('system-config-printer') + provides=("system-config-printer=${pkgver}") + conflicts=('system-config-printer') + + cd "${srcdir}"/${pkgbase}-${pkgver} + install -d "${pkgdir}"/usr/share/${pkgbase} + install -m644 config.py \ + debug.py \ + installpackage.py \ + monitor.py \ + PhysicalDevice.py \ + ppdippstr.py \ + probe_printer.py \ + SearchCriterion.py \ + smburi.py \ + statereason.py \ + "${pkgdir}"/usr/share/${pkgbase}/ + + install -m755 pysmb.py \ + "${pkgdir}"/usr/share/${pkgbase}/ + + install -d "${pkgdir}"/etc/dbus-1/system.d/ + install -m644 dbus/com.redhat.NewPrinterNotification.conf \ + dbus/com.redhat.PrinterDriversInstaller.conf \ + "${pkgdir}"/etc/dbus-1/system.d/ + install -d "${pkgdir}"/etc/cupshelpers/ + install -m644 xml/preferreddrivers.xml "${pkgdir}"/etc/cupshelpers/ + + install -d "${pkgdir}"/usr/lib/udev/rules.d + install -m755 udev/{udev-add-printer,udev-configure-printer} \ + "${pkgdir}"/usr/lib/udev/ + install -m644 udev/70-printers.rules \ + "${pkgdir}"/usr/lib/udev/rules.d + + for file in build/lib/cupshelpers/*.py; do + install -Dm644 $file \ + "${pkgdir}"/usr/lib/python2.7/site-packages/cupshelpers/$(basename $file) + done +} + +package_system-config-printer-gnome() { + pkgdesc='A CUPS printer configuration tool and status applet - GTK frontend' + depends=('system-config-printer-common' 'gnome-icon-theme' 'python2-notify') + optdependence=('gnome-keyring: password management') + + cd "${srcdir}"/${pkgbase}-${pkgver} + make DESTDIR="${pkgdir}" install + + # files provided by system-config-printer-common + cd "${pkgdir}"/usr/share/${pkgbase} + rm config.py \ + debug.py \ + installpackage.py \ + monitor.py \ + PhysicalDevice.py \ + ppdippstr.py \ + probe_printer.py \ + SearchCriterion.py \ + smburi.py \ + statereason.py \ + pysmb.py + rm -r "${pkgdir}"/etc/dbus-1/ + rm -r "${pkgdir}"/etc/cupshelpers/ + rm -r "${pkgdir}"/etc/udev/ + rm -r "${pkgdir}"/usr/lib/ +} diff --git a/testing/twisted/PKGBUILD b/testing/twisted/PKGBUILD new file mode 100644 index 000000000..26514d9f3 --- /dev/null +++ b/testing/twisted/PKGBUILD @@ -0,0 +1,37 @@ +# $Id: PKGBUILD 168885 2012-10-16 11:55:48Z allan $ +# Maintainer : Ionut Biru <ibiru@archlinux.org> +# Contributor: Juergen Hoetzel <juergen@archlinux.org> +# Contributor: Douglas Soares de Andrade <douglas@archlinux.org> + +pkgname=twisted +pkgver=12.2.0 +pkgrel=2 +pkgdesc="Asynchronous networking framework written in Python." +arch=('i686' 'x86_64') +url="http://twistedmatrix.com/" +license=('MIT') +depends=('python2-crypto' 'python2-zope-interface') +optdepends=('python2-pyopenssl' + 'python2-soappy: for twisted.web.soap' + 'python2-pyasn1: for using conch' + 'pygtk: for using manhole' + 'tk: for using tkconch') +install=twisted.install +source=(http://twistedmatrix.com/Releases/Twisted/${pkgver%.*}/Twisted-$pkgver.tar.bz2) +sha1sums=('c51834c1270e7a4bb0de9190056e4317413920f9') + +build() { + cd "$srcdir/Twisted-$pkgver" + python2 setup.py build +} + +package() { + cd "$srcdir/Twisted-$pkgver" + python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 + install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + + sed -i 's:^#!.*bin.*python:#!/usr/bin/python2:' \ + "$pkgdir"/usr/lib/python2.7/site-packages/twisted/trial/test/scripttest.py \ + "$pkgdir"/usr/lib/python2.7/site-packages/twisted/mail/test/pop3testserver.py \ + "$pkgdir"/usr/lib/python2.7/site-packages/twisted/python/test/pullpipe.py +} diff --git a/testing/twisted/twisted.install b/testing/twisted/twisted.install new file mode 100644 index 000000000..8e93ffd3c --- /dev/null +++ b/testing/twisted/twisted.install @@ -0,0 +1,11 @@ +post_install() { + python2 -c 'from twisted.plugin import IPlugin, getPlugins; list(getPlugins(IPlugin))' >/dev/null 2>&1 || return 1 +} + +post_upgrade() { + post_install +} + +post_remove() { + find /usr/lib/python2.7/site-packages/twisted/plugins -name dropin.cache | xargs -r rm -f +} diff --git a/testing/vde2/PKGBUILD b/testing/vde2/PKGBUILD new file mode 100644 index 000000000..1f706ffa1 --- /dev/null +++ b/testing/vde2/PKGBUILD @@ -0,0 +1,50 @@ +# $Id: PKGBUILD 168886 2012-10-16 11:55:53Z allan $ +# Contributor: Sergej Pupykin +# Maintainer: Tobias Powalowski <tpowa@archlinux.org> +pkgname=vde2 +pkgver=2.3.2 +pkgrel=2 +pkgdesc="Virtual Distributed Ethernet for emulators like qemu" +url="http://sourceforge.net/projects/vde/" +license=("GPL" "LGPL" "CUSTOM") +arch=('i686' 'x86_64') +depends=('bash' 'libpcap' 'openssl') +makedepends=('python') +backup=(etc/conf.d/vde) +source=(http://downloads.sourceforge.net/vde/$pkgname-$pkgver.tar.bz2 + dhcpd.conf.sample + iptables.rules.sample + vde-config.sample + vde-connection.sample + vde.conf + vde.rc) +install=vde2.install +options=(!libtool !makeflags) + +build() { + cd $srcdir/$pkgname-$pkgver + ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib/vde2 \ + --enable-experimental + make +} + +package() { + cd $srcdir/$pkgname-$pkgver + make prefix=$pkgdir/usr sysconfdir=$pkgdir/etc libexecdir=$pkgdir/usr/lib/vde2 install + install -D -m 755 ../vde.rc $pkgdir/etc/rc.d/vde + install -D -m 644 ../vde.conf $pkgdir/etc/conf.d/vde + install -D -m 644 ../vde-config.sample $pkgdir/etc/vde/vde-config.sample + install -D -m 644 ../vde-connection.sample $pkgdir/etc/vde/vde-connection.sample + install -D -m 644 ../dhcpd.conf.sample $pkgdir/usr/share/vde2/dhcpd.conf.sample + install -D -m 644 ../iptables.rules.sample $pkgdir/usr/share/vde2/iptables.rules.sample + # install slirp license + install -D -m 644 COPYING.slirpvde $pkgdir/usr/share/licenses/vde2/COPYING.slirpvde +} + +md5sums=('46fbc5f97f03dc517aa3b2c9d9ea6628' + '7d9bc56d2e561d849e915000d1c0f269' + 'a920123fc620bcedbccb703a8d1bdc55' + 'cb8ace28e8efd4dad128be4be71b3b07' + '63033c33565e2030541c5e05e9d9b063' + 'a22730f051f4840da4a3162a88ff8156' + '6c7dc01bc2f039f0ff1682ee70d3d1da') diff --git a/testing/vde2/dhcpd.conf.sample b/testing/vde2/dhcpd.conf.sample new file mode 100644 index 000000000..565a78b27 --- /dev/null +++ b/testing/vde2/dhcpd.conf.sample @@ -0,0 +1,12 @@ +ddns-update-style none; + +subnet 192.168.254.0 netmask 255.255.255.0 { + range 192.168.254.1 192.168.254.253; + option routers 192.168.254.254; + option domain-name "virtual.example.com"; + # find your DNS servers from /etc/resolv.conf + # otherwise only pure IP addresses will work + option domain-name-servers 192.168.254.254; + option broadcast-address 192.168.254.255; + default-lease-time 86400; +} diff --git a/testing/vde2/iptables.rules.sample b/testing/vde2/iptables.rules.sample new file mode 100644 index 000000000..ac712ee21 --- /dev/null +++ b/testing/vde2/iptables.rules.sample @@ -0,0 +1,5 @@ +*filter +-A INPUT -i tun -j ACCEPT +-A FORWARD -s 192.168.254.0/255.255.255.0 -j ACCEPT +*nat +-A POSTROUTING -s 192.168.254.0/24 -j MASQUERADE diff --git a/testing/vde2/vde-config.sample b/testing/vde2/vde-config.sample new file mode 100644 index 000000000..c5a5b7d88 --- /dev/null +++ b/testing/vde2/vde-config.sample @@ -0,0 +1,35 @@ +# Set options vde_switch program +# To activate this vde profile add it to /etc/conf.d/vde + +# Global options +VDE_NUMPORTS="32" # Number of ports (default 32) +VDE_HUB="no" # [yes|no] Make the switch act as a hub +VDE_FSTP="no" # [yes|no] Activate the fast spanning tree protocol +VDE_MAC="" # Set the Switch MAC address +VDE_PRIOTIRY="" # Set the priority for FST (MAC extension) +VDE_HASHSIZE="" # Hash table size + +# Options from datasock module +VDE_SOCK="/var/run/vde/sample.sock" # control directory pathname +VDE_SOCK_MODE="660" # Standard access mode for comm sockets (octal) +VDE_SOCK_GROUP="root" # Group owner for comm sockets + +# Options from consmgmt module +VDE_MANAGEMENT_SOCK="/var/run/vde/sample.mgmt" # path of the management UNIX socket +VDE_MANAGEMENT_SOCK_MODE="660" # management UNIX socket access mode (octal) + +# Other options to parse to vde_switch +VDE_OPTIONS="" + +# VDE with internet support +# You can use either tuntap method or slirpvde method. + +# Options from tuntap module +VDE_TAP="" # Enable routing through TAP tap interface (comma separated array eg.:"tap0,tap1"). + +# slirpvde daemon support +SLIRP="no" # [yes|no] enable/disable SLIRP daemon support +SLIRP_DHCP="no" # [yes|no] turn on the DHCP server for the network autoconfiguration of all the units connected to the VDE +SLIRP_NETWORK="" # specify the network address (default 10.0.2.0) +# other options to parse to slirpvde +SLIRP_OPTIONS=""
\ No newline at end of file diff --git a/testing/vde2/vde-connection.sample b/testing/vde2/vde-connection.sample new file mode 100644 index 000000000..4a75e1f52 --- /dev/null +++ b/testing/vde2/vde-connection.sample @@ -0,0 +1,6 @@ +# You can add vde switch connections below +# just without the # at the beginning: +# vde_plug /var/run/vde/sample.sock = vde_plug /var/run/vde/sample2.sock +# or if hosts are different use this syntax: +# vde_plug /var/run/vde/sample.sock = ssh host2 vde_plug /var/run/vde/sample.sock + diff --git a/testing/vde2/vde.conf b/testing/vde2/vde.conf new file mode 100644 index 000000000..bc61dceda --- /dev/null +++ b/testing/vde2/vde.conf @@ -0,0 +1,11 @@ +# Set options for a vde daemon script +# +# Array for your vde config files, eg.: "internal-net external-net" +# You need a config file in /etc/vde/ with the same name. +# Sample config file provided: /etc/vde/vde-config.sample +VDE_CONFIG="" + +# Array for your dpipe connections, eg.: "connect-switches" +# You need a config file in /etc/vde/ with the same name. +# Sample config file provided: /etc/vde/vde-connection.sample +VDE_CONNECTION=""
\ No newline at end of file diff --git a/testing/vde2/vde.rc b/testing/vde2/vde.rc new file mode 100755 index 000000000..b368f9955 --- /dev/null +++ b/testing/vde2/vde.rc @@ -0,0 +1,113 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/vde + +case "$1" in + start) + # bring up all defined profiles + for i in $VDE_CONFIG; do + [ -e /etc/vde/$i ] && . /etc/vde/$i + stat_busy "Starting vde_switch $i" + # get options from profile + [ -n "$VDE_NUMPORTS" ] && OPTIONS="-n $VDE_NUMPORTS" + [ "$VDE_HUB" = "yes" ] && OPTIONS="$OPTIONS -x" + [ "$VDE_FSTP" = "yes" ] && OPTIONS="$OPTIONS -F" + [ -n "$VDE_MAC" ] && OPTIONS="$OPTIONS --macaddr $VDE_MAC" + [ -n "$VDE_PRIORITY" ] && OPTIONS="$OPTIONS --priority $VDE_PRIORITY" + [ -n "$VDE_HASH" ] && OPTIONS="$OPTIONS --hashsize $VDE_HASH" + [ -n "$VDE_SOCK" ] && OPTIONS="$OPTIONS -s $VDE_SOCK" + [ -n "$VDE_SOCK_MODE" ] && OPTIONS="$OPTIONS -m $VDE_SOCK_MODE" + [ -n "$VDE_SOCK_GROUP" ] && OPTIONS="$OPTIONS -g $VDE_SOCK_GROUP" + [ -n "$VDE_MANAGEMENT_SOCK" ] && OPTIONS="$OPTIONS -M $VDE_MANAGEMENT_SOCK" + [ -n "$VDE_MANAGEMENT_SOCK_MODE" ] && OPTIONS="$OPTIONS --mgmtmode $VDE_MANAGEMENT_SOCK_MODE" + [ -n "$VDE_TAP" ] && OPTIONS="$OPTIONS -t $VDE_TAP" + [ -n "$VDE_OPTIONS" ] && OPTIONS="$OPTIONS $VDE_OPTIONS" + vde_switch $OPTIONS -p /var/run/vde-$i.pid -daemon &>/dev/null + [ -n "$VDE_SOCK" -a -n "$VDE_SOCK_GROUP" ] && chgrp "$VDE_SOCK_GROUP" "$VDE_SOCK" + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + fi + if [ "$SLIRP" = "yes" ]; then + stat_busy "Starting slirpvde for $i" + [ "$SLIRP_DHCP" = "yes" ] && SP_OPTIONS="-D" + [ -n "$SLIRP_NETWORK" ] && SP_OPTIONS="$SP_OPTIONS -n $SLIRP_NETWORK" + [ -n "$SLIRP_OPTIONS" ] && SP_OPTIONS="$SP_OPTIONS $SLIRP_OPTIONS" + [ -n "$VDE_SOCK" ] && SP_OPTIONS="$SP_OPTIONS -s $VDE_SOCK" + [ -n "$VDE_SOCK_MODE" ] && SP_OPTIONS="$SP_OPTIONS -m $VDE_SOCK_MODE" + [ -n "$VDE_SOCK_GROUP" ] && SP_OPTIONS="$SP_OPTIONS -g $VDE_SOCK_GROUP" + slirpvde $SP_OPTIONS -p /var/run/slirpvde-$i.pid -daemon &>/dev/null + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + fi + unset OPTIONS + unset SP_OPTIONS + fi + done + for i in $VDE_CONNECTION; do + # connect specified vde_switches + if [ "$(grep ^vde_plug /etc/vde/$i)" ]; then + stat_busy "Connecting VDE switches $i together..." + while read j; do + switch="$(echo $j | grep ^vde_plug)" + [ -n "$switch" ] && (dpipe $switch &) + done </etc/vde/$i + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + fi + fi + done + add_daemon vde + ;; + stop) + # kill vde_plug if switches are connected + [ -n "$VDE_CONNECTION" ] && killall vde_plug >/dev/null 2>&1 + for i in $VDE_CONFIG; do + [ -e /etc/vde/$i ] && . /etc/vde/$i + if [ "$SLIRP" = "yes" ]; then + stat_busy "Stopping slirpvde for $i" + kill $(cat /var/run/slirpvde-$i.pid) &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + fi + rm /var/run/slirpvde-$i.pid &> /dev/null + fi + stat_busy "Stopping vde_switch $i" + kill $(cat /var/run/vde-$i.pid) &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + fi + rm /var/run/vde-$i.pid &> /dev/null + stat_busy "Removing $i vde sockets" + rm -rf $VDE_SOCK $VDE_MANAGEMENT_SOCK + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + fi + done + unset OPTIONS + unset SP_OPTIONS + [ -e /var/run/vde/gmon.out ] && rm /var/run/vde/gmon.out + rm_daemon vde + ;; + restart) + $0 stop + sleep 3 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/testing/vde2/vde2.install b/testing/vde2/vde2.install new file mode 100644 index 000000000..74e1710ff --- /dev/null +++ b/testing/vde2/vde2.install @@ -0,0 +1,10 @@ +post_install() { + echo "Change /etc/conf.d/vde to your needs." + echo "vde config files should be placed in /etc/vde, sample files are provided." + echo "iptables and dhcpd sample files have been installed to '/usr/share/vde2'." + echo "Merge those examples, if needed to the according config files." +} + +post_upgrade() { + post_install $1 +} |