summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@rshg047.dnsready.net>2011-06-11 22:48:58 +0000
committerroot <root@rshg047.dnsready.net>2011-06-11 22:48:58 +0000
commite392819937e37aa7f33ba83bb3e23bb1ccabaa37 (patch)
tree973aad7153fa658dce8cc60d9fc78f41c2dfa578
parent8bb6e3c7e5bec1adf2c819a1985de4d1f3347fb6 (diff)
Sat Jun 11 22:48:58 UTC 2011
-rw-r--r--community/clanlib/PKGBUILD6
-rw-r--r--community/compizconfig-backend-kconfig4/PKGBUILD31
-rw-r--r--community/dia/PKGBUILD19
-rw-r--r--community/fityk/PKGBUILD10
-rw-r--r--community/gogglesmm/PKGBUILD10
-rw-r--r--community/minidlna/PKGBUILD10
-rwxr-xr-xcommunity/pragha/PKGBUILD6
-rw-r--r--community/qbittorrent/PKGBUILD4
-rw-r--r--core/links/PKGBUILD12
-rw-r--r--extra/moc/PKGBUILD33
-rw-r--r--extra/python-pycurl/PKGBUILD22
-rw-r--r--extra/re-alpine/PKGBUILD38
-rw-r--r--extra/re-alpine/maildir.patch3712
-rw-r--r--extra/rhythmbox/PKGBUILD8
-rw-r--r--testing/kdeaccessibility/PKGBUILD98
-rw-r--r--testing/kdeaccessibility/kdeaccessibility.install11
-rw-r--r--testing/kdeadmin/PKGBUILD80
-rw-r--r--testing/kdeadmin/kdeadmin.install11
-rw-r--r--testing/kdeadmin/syslog-path.patch11
-rw-r--r--testing/kdeartwork/PKGBUILD102
-rw-r--r--testing/kdebase-runtime/PKGBUILD38
-rw-r--r--testing/kdebase-runtime/kdebase-runtime.install12
-rw-r--r--testing/kdebase-workspace/PKGBUILD72
-rw-r--r--testing/kdebase-workspace/fixpath.patch34
-rw-r--r--testing/kdebase-workspace/kde-np.pam7
-rw-r--r--testing/kdebase-workspace/kde.pam7
-rw-r--r--testing/kdebase-workspace/kdebase-workspace.install25
-rw-r--r--testing/kdebase-workspace/kdm36
-rw-r--r--testing/kdebase-workspace/kdm-zsh-profile.patch11
-rw-r--r--testing/kdebase-workspace/kscreensaver.pam1
-rw-r--r--testing/kdebase-workspace/terminate-server.patch11
-rw-r--r--testing/kdebase/PKGBUILD129
-rw-r--r--testing/kdebase/kdebase.install11
-rw-r--r--testing/kdebindings/PKGBUILD71
-rw-r--r--testing/kdeedu/PKGBUILD273
-rw-r--r--testing/kdeedu/gpsd-2.96.patch43
-rw-r--r--testing/kdeedu/kdeedu.install11
-rw-r--r--testing/kdeedu/remove-libkdeedu-libscience.patch10
-rw-r--r--testing/kdegames/PKGBUILD514
-rw-r--r--testing/kdegames/kdegames-kbattleship.install24
-rw-r--r--testing/kdegames/kdegames-kfourinline.install12
-rw-r--r--testing/kdegames/kdegames-kigo.install12
-rw-r--r--testing/kdegames/kdegames-kolf.install12
-rw-r--r--testing/kdegames/kdegames-kreversi.install22
-rw-r--r--testing/kdegames/kdegames-kspaceduel.install12
-rw-r--r--testing/kdegames/kdegames-ksquares.install22
-rw-r--r--testing/kdegames/kdegames-ktuberling.install12
-rw-r--r--testing/kdegames/kdegames-lskat.install12
-rw-r--r--testing/kdegames/kdegames-palapeli.install13
-rw-r--r--testing/kdegames/kdegames.install11
-rw-r--r--testing/kdegraphics/PKGBUILD141
-rw-r--r--testing/kdegraphics/kdegraphics.install11
-rw-r--r--testing/kdelibs/PKGBUILD63
-rw-r--r--testing/kdelibs/abs-syntax-highlight.patch12
-rw-r--r--testing/kdelibs/archlinux-menu.patch22
-rw-r--r--testing/kdelibs/kde-applications-menu.patch22
-rw-r--r--testing/kdelibs/kdelibs.install12
-rw-r--r--testing/kdemultimedia/PKGBUILD109
-rw-r--r--testing/kdemultimedia/kdemultimedia.install11
-rw-r--r--testing/kdemultimedia/mplayerthumbs.config2
-rw-r--r--testing/kdenetwork/PKGBUILD116
-rw-r--r--testing/kdenetwork/kdenetwork.install11
-rw-r--r--testing/kdepim-runtime/PKGBUILD37
-rw-r--r--testing/kdepim-runtime/disable-l10n.patch10
-rw-r--r--testing/kdepim-runtime/kdepim-runtime.install13
-rw-r--r--testing/kdepim/PKGBUILD253
-rw-r--r--testing/kdepim/kdepim-kleopatra.install12
-rw-r--r--testing/kdepim/kdepim-kmail.install12
-rw-r--r--testing/kdepim/kdepim-korganizer.install12
-rw-r--r--testing/kdepim/kdepim.install11
-rw-r--r--testing/kdepimlibs/PKGBUILD32
-rw-r--r--testing/kdepimlibs/kdepimlibs.install11
-rw-r--r--testing/kdeplasma-addons/PKGBUILD603
-rw-r--r--testing/kdeplasma-addons/kdeplasma-addons-applets-lancelot.install12
-rw-r--r--testing/kdeplasma-addons/kdeplasma-addons-applets.install11
-rw-r--r--testing/kdeplasma-applets-networkmanagement/PKGBUILD35
-rw-r--r--testing/kdeplasma-applets-networkmanagement/kdeplasma-applets-networkmanagement.install11
-rw-r--r--testing/kdesdk/PKGBUILD243
-rw-r--r--testing/kdesdk/fix-python2-path.patch64
-rw-r--r--testing/kdesdk/kdesdk-kate.install12
-rw-r--r--testing/kdesdk/kdesdk-okteta.install12
-rw-r--r--testing/kdesdk/kdesdk.install11
-rw-r--r--testing/kdetoys/PKGBUILD56
-rw-r--r--testing/kdetoys/kdetoys.install11
-rw-r--r--testing/kdeutils/PKGBUILD180
-rw-r--r--testing/kdeutils/kdeutils.install11
-rw-r--r--testing/kdewebdev/PKGBUILD67
-rw-r--r--testing/kdewebdev/kdewebdev.install11
-rw-r--r--testing/rrdtool/PKGBUILD37
89 files changed, 7979 insertions, 57 deletions
diff --git a/community/clanlib/PKGBUILD b/community/clanlib/PKGBUILD
index 4e6e36b1f..21b843621 100644
--- a/community/clanlib/PKGBUILD
+++ b/community/clanlib/PKGBUILD
@@ -1,8 +1,8 @@
-# $Id: PKGBUILD 44605 2011-04-09 12:36:14Z svenstaro $
+# $Id: PKGBUILD 49101 2011-06-11 03:15:22Z svenstaro $
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
pkgname=clanlib
-pkgver=2.2.8
+pkgver=2.2.9
pkgrel=1
pkgdesc="A multi-platform game development library."
arch=('i686' 'x86_64')
@@ -12,7 +12,7 @@ depends=('alsa-lib' 'libjpeg' 'libmikmod' 'libpng' 'libvorbis' 'libxi' 'libxmu'
makedepends=('doxygen' 'graphviz')
options=('!libtool')
source=(http://clanlib.org/download/releases-2.0/ClanLib-${pkgver}.tgz)
-md5sums=('b4184ea1535bbda52c2eea7523f332e4')
+md5sums=('321886420efa0263e6f6273057b5d6df')
build() {
cd ${srcdir}/ClanLib-${pkgver}
diff --git a/community/compizconfig-backend-kconfig4/PKGBUILD b/community/compizconfig-backend-kconfig4/PKGBUILD
new file mode 100644
index 000000000..7722987dc
--- /dev/null
+++ b/community/compizconfig-backend-kconfig4/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 49088 2011-06-10 14:35:09Z andrea $
+# Maintainer: Ronald van Haren <ronald.archlinux.org>
+# Contributor: Andrea Scarpino <andrea@archlinux.org>
+
+pkgname=compizconfig-backend-kconfig4
+pkgver=0.8.4
+pkgrel=1
+pkgdesc="Compizconfig backend for kconfig4"
+arch=('i686' 'x86_64')
+url="http://www.compiz.org/"
+license=('GPL2')
+depends=('libcompizconfig' 'kdelibs' 'libxcomposite' 'libxinerama')
+makedepends=('cmake' 'automoc4')
+groups=('compiz-fusion-kde' 'compiz-fusion')
+source=("http://releases.compiz.org/${pkgver}/${pkgname}-${pkgver}.tar.bz2")
+md5sums=('89f3cdbdbb8b1bc88f55ccaedbc8404d')
+
+build() {
+ cd "${srcdir}"
+ mkdir build
+ cd build
+ cmake ../${pkgname}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package() {
+ cd "${srcdir}"/build
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/community/dia/PKGBUILD b/community/dia/PKGBUILD
index 89c7f852e..954be7621 100644
--- a/community/dia/PKGBUILD
+++ b/community/dia/PKGBUILD
@@ -1,12 +1,11 @@
-# $Id: PKGBUILD 32607 2010-11-15 15:15:59Z spupykin $
+# $Id: PKGBUILD 49059 2011-06-10 08:42:06Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
-# Maintainer:
# Contributor: Juergen Hoetzel <juergen@archlinux.org>
# Contributor: Gregor Ibic <gregor.ibic@intelicom.si>
pkgname=dia
pkgver=0.97.1
-pkgrel=3
+pkgrel=4
pkgdesc="A GTK+ based diagram creation program"
arch=('i686' 'x86_64')
license=('GPL')
@@ -15,30 +14,32 @@ install=dia.install
depends=('libxslt' 'desktop-file-utils' 'libart-lgpl' 'gtk2')
makedepends=('intltool' 'python2' 'docbook-xsl')
optdepends=('python2')
-options=('!libtool')
+options=('!libtool' 'docs')
source=("ftp://ftp.gnome.org/pub/gnome/sources/${pkgname}/0.97/${pkgname}-${pkgver}.tar.bz2"
"dia-overflow-fix.patch")
md5sums=('57e44bb9f387559a0506b52a134deaf0'
'8fd9a2ad35b5a6fd8c758d7c73dbfe66')
-md5sums=('57e44bb9f387559a0506b52a134deaf0'
- '8fd9a2ad35b5a6fd8c758d7c73dbfe66')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
export PYTHON=/usr/bin/python2
sed -i 's#python2\.1#python2 python2.1#' configure
- patch -p1 <$srcdir/dia-overflow-fix.patch
+ patch -p1 <$srcdir/dia-overflow-fix.patch || true
./configure --prefix=/usr \
- --enable-db2html \
--with-cairo \
--with-python \
- --disable-gnome
+ --disable-gnome \
+ --with-hardbooks
+ sed -i 's#SUBDIRS = lib objects plug-ins shapes app bindings samples po sheets data doc tests installer#SUBDIRS = lib objects plug-ins shapes app bindings samples po sheets data tests installer#' Makefile
make
+ cd doc && make html
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
make DESTDIR="${pkgdir}" install
+ cd doc && make DESTDIR="${pkgdir}" install-html
+ ln -sf ../doc/dia/html $pkgdir/usr/share/dia/help
}
diff --git a/community/fityk/PKGBUILD b/community/fityk/PKGBUILD
index fc973936a..14552b927 100644
--- a/community/fityk/PKGBUILD
+++ b/community/fityk/PKGBUILD
@@ -3,7 +3,7 @@
# Contributor: Cuneyt Unlu <unlucu AT gmail.com>
pkgname=fityk
-pkgver=1.0.1
+pkgver=1.0.2
pkgrel=1
pkgdesc='A program for nonlinear fitting of analytical functions to data.'
arch=('i686' 'x86_64')
@@ -13,11 +13,11 @@ depends=('boost-libs' 'xylib' 'wxgtk' 'shared-mime-info')
makedepends=('boost' 'git' 'python-sphinx')
options=('!libtool')
install=${pkgname}.install
-source=('http://prdownloads.sourceforge.net/wxwindows/wxWidgets-2.9.1.tar.bz2')
-md5sums=('81c20d7b2ba31becb18e467dbe09be8f')
+source=('http://biolpc22.york.ac.uk/pub/Daily_HEAD/wxWidgets.tar.gz') # daily snapshot because fityk requires a version that hasn't been released yet...
+md5sums=('71a465a1d60c33c33b644d15ba23f30b')
build() {
- cd wxWidgets-2.9.1
+ cd wxWidgets
./configure --prefix=${srcdir}/usr --disable-shared --with-libpng=sys --with-libxpm=sys --with-libjpeg=sys --with-libtiff=sys
make
make install
@@ -25,7 +25,7 @@ build() {
cd ${srcdir}
git clone git://github.com/wojdyr/fityk.git
cd fityk
- ##git checkout v${pkgver}
+ git checkout v${pkgver}
#cd ${pkgname}-${pkgver}
# disable xyconvert because wxwidgets>=2.9 is needed (dev version) and it isn't standard with arch yet
diff --git a/community/gogglesmm/PKGBUILD b/community/gogglesmm/PKGBUILD
index f544a749a..450be248d 100644
--- a/community/gogglesmm/PKGBUILD
+++ b/community/gogglesmm/PKGBUILD
@@ -1,9 +1,9 @@
-# $Id: PKGBUILD 41060 2011-03-03 15:30:41Z spupykin $
+# $Id: PKGBUILD 49064 2011-06-10 08:43:11Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Sander Jansen <sander@knology.net>
pkgname=gogglesmm
-pkgver=0.12.1
+pkgver=0.12.2
pkgrel=1
pkgdesc="Music Manager and Player"
arch=('i686' 'x86_64')
@@ -14,12 +14,16 @@ depends=('fox>=1.6.0' 'xine-lib>=1.0' 'sqlite3>=3.4.0' 'taglib' 'dbus-core' 'cur
replaces=('musicmanager')
conflicts=('musicmanager')
source=(http://gogglesmm.googlecode.com/files/gogglesmm-$pkgver.tar.bz2)
-md5sums=('8657be2f67b25837fcf5d442700619aa')
+md5sums=('2fc5c90dc3feeacd857913c48c65771c')
build() {
cd $srcdir/gogglesmm-$pkgver
./configure --prefix=/usr
make
+}
+
+package() {
+ cd $srcdir/gogglesmm-$pkgver
mkdir -p $pkgdir/usr/bin
make DESTDIR=$pkgdir install
}
diff --git a/community/minidlna/PKGBUILD b/community/minidlna/PKGBUILD
index 3df7e5720..18cba3694 100644
--- a/community/minidlna/PKGBUILD
+++ b/community/minidlna/PKGBUILD
@@ -1,22 +1,22 @@
-# $Id: PKGBUILD 43934 2011-03-31 20:13:41Z spupykin $
+# $Id: PKGBUILD 49069 2011-06-10 08:44:02Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer:Biginoz < biginoz AT free point fr>
# Contributor: Ignacio Galmarino <igalmarino@gmail.com>
# Contributor: Matthias Sobczyk <matthias.sobczyk@googlemail.com>
pkgname=minidlna
-pkgver=1.0.19
-pkgrel=2
+pkgver=1.0.20
+pkgrel=1
pkgdesc="A DLNA/UPnP-AV Media server (aka ReadyDLNA)"
arch=('i686' 'x86_64')
-url="http://minidlna.sourceforge.net"
+url="http://sourceforge.net/projects/minidlna/"
license=('GPL')
depends=('libexif' 'libjpeg' 'libid3tag' 'flac' 'libvorbis' 'ffmpeg' 'sqlite3')
conflicts=('minidlna-cvs')
backup=('etc/minidlna.conf')
source=(http://downloads.sourceforge.net/minidlna/minidlna_${pkgver}_src.tar.gz
minidlna.rc)
-md5sums=('8bb5f2c0abc009e16039d7deecf09cf6'
+md5sums=('1c5230cc6dec7592eca4c63c526eadb7'
'80c423f003894ad15d7de41f3ed342c0')
build() {
diff --git a/community/pragha/PKGBUILD b/community/pragha/PKGBUILD
index 8e7336b4b..b18a77c40 100755
--- a/community/pragha/PKGBUILD
+++ b/community/pragha/PKGBUILD
@@ -1,10 +1,10 @@
-# $Id: PKGBUILD 46398 2011-05-07 07:41:07Z ttopper $
+# $Id: PKGBUILD 49091 2011-06-10 19:39:21Z ttopper $
# Maintainer: Thorsten Töpper <atsutane-tu@freethoughts.de>
# Contributor: Alois Nespor <alois.nespor@gmail.com>
# Contributor: JerichoKru <jerichokru(AT)htomail.com>
pkgname=pragha
-pkgver=0.95.0.1
+pkgver=0.96.1
pkgrel=1
pkgdesc="A lightweight GTK+ music manager - fork of Consonance Music Manager."
arch=('i686' 'x86_64')
@@ -18,7 +18,7 @@ optdepends=('notification-daemon: OSD notification')
replaces=('dissonance')
install=pragha.install
source=(http://dissonance.googlecode.com/files/$pkgname-$pkgver.tar.bz2)
-sha1sums=('4ad9de34e2e78176494d62b5407c3cbbbfb9c183')
+sha1sums=('0782f552cdf786290ab9b4defd1d65869c5ff08f')
build() {
cd "$srcdir/$pkgname-$pkgver"
diff --git a/community/qbittorrent/PKGBUILD b/community/qbittorrent/PKGBUILD
index 532fc9413..0fc9a2d88 100644
--- a/community/qbittorrent/PKGBUILD
+++ b/community/qbittorrent/PKGBUILD
@@ -3,7 +3,7 @@
# Contributor: Geoffroy Carrier <geoffroy.carrier@koon.fr>
pkgname=qbittorrent
-pkgver=2.8.0
+pkgver=2.8.1
pkgrel=1
pkgdesc="A bittorrent client written in C++ / Qt4 using the good libtorrent library"
arch=('i686' 'x86_64')
@@ -16,7 +16,7 @@ optdepends=('python2: needed for search'
install='qbittorrent.install'
source=("http://downloads.sourceforge.net/sourceforge/qbittorrent/qbittorrent-${pkgver}.tar.gz"
'python2.patch')
-md5sums=('6337b679b40f56fdd2dd49d795fd5405'
+md5sums=('4fb4490117a0909f1f0989b4b797b41a'
'db0d79fee8ce3470ad3741d36b02a94c')
build() {
diff --git a/core/links/PKGBUILD b/core/links/PKGBUILD
index aca8da456..95a4a05cd 100644
--- a/core/links/PKGBUILD
+++ b/core/links/PKGBUILD
@@ -1,8 +1,8 @@
-# $Id: PKGBUILD 102993 2010-12-13 20:58:28Z eric $
-# Maintainer: Eric Belanger <eric@archlinux.org>
+# $Id: PKGBUILD 126520 2011-06-06 04:11:26Z eric $
+# Maintainer: Eric Bélanger <eric@archlinux.org>
pkgname=links
-pkgver=2.3pre1
+pkgver=2.3pre2
pkgrel=1
pkgdesc="A text WWW browser, similar to Lynx"
arch=('i686' 'x86_64')
@@ -15,8 +15,10 @@ provides=('links-g')
conflicts=('links-g')
replaces=('links-g')
source=(http://links.twibright.com/download/${pkgname}-${pkgver}.tar.bz2 links.desktop)
-md5sums=('76cff0c716cd2a710abb078f859cfe9b' '7c47b15aaef51f1de129ff3a2afb7eac')
-sha1sums=('6d420a5c4514b45ee245fd3933d2a8cfa6eae76d' 'f600e27c2a71184444f7dd07a10230aa44463a02')
+md5sums=('4a6970d54f4a9c64b8cf5d83a5815c45'
+ '7c47b15aaef51f1de129ff3a2afb7eac')
+sha1sums=('5bc210f746559725565bec1d4748b5c56b263ee5'
+ 'f600e27c2a71184444f7dd07a10230aa44463a02')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
diff --git a/extra/moc/PKGBUILD b/extra/moc/PKGBUILD
index 4ab535225..535afc1a5 100644
--- a/extra/moc/PKGBUILD
+++ b/extra/moc/PKGBUILD
@@ -1,14 +1,14 @@
-# $Id: PKGBUILD 124292 2011-05-19 04:47:01Z eric $
+# $Id: PKGBUILD 126916 2011-06-08 17:30:45Z eric $
# Maintainer: Eric Bélanger <eric@archlinux.org>
pkgname=moc
-pkgver=2.4.4
-pkgrel=4
+pkgver=20110528
+pkgrel=2
pkgdesc="An ncurses console audio player with support for the mp3, ogg, and wave formats"
arch=('i686' 'x86_64')
url="http://moc.daper.net/"
license=('GPL')
-depends=('libmad' 'libid3tag' 'jack' 'curl' 'libsamplerate' 'libtool')
+depends=('libmad' 'libid3tag' 'jack' 'curl' 'libsamplerate' 'libtool' 'file')
makedepends=('speex' 'ffmpeg' 'taglib' 'libmpcdec' 'wavpack' 'libmodplug')
optdepends=('speex: for using the speex plugin'
'ffmpeg: for using the ffmpeg plugin'
@@ -17,31 +17,28 @@ optdepends=('speex: for using the speex plugin'
'wavpack: for using the wavpack plugin'
'libmodplug: for using the modplug plugin')
options=('!libtool')
-source=(ftp://ftp.daper.net/pub/soft/moc/stable/${pkgname}-${pkgver}.tar.bz2 \
- gcc-undefined-symbols.diff curl-streams.diff)
-md5sums=('647c770a5542a4ae5437386807a89796'
- 'efacb8559e9145e15b0c25f8fa2a9d79'
- 'bb9be1e80762851c57075c99a612af2f')
-sha1sums=('e56ee13aa17c177f0afc42efe3804ebbbf46d4db'
- 'a811a4ac7e049914aab528d3f06a6be6634c2720'
- 'a58ca952d7f3b0ede19b95c53da96c090d0a94c4')
+source=(ftp://ftp.archlinux.org/other/moc/${pkgname}-${pkgver}.tar.xz \
+ gcc-undefined-symbols.diff)
+md5sums=('003fd01af2165264eb666040e4f586cd'
+ 'efacb8559e9145e15b0c25f8fa2a9d79')
+sha1sums=('f79049136ce6616bfd6af2f5e08246a5921441cf'
+ 'a811a4ac7e049914aab528d3f06a6be6634c2720')
build() {
- cd "${srcdir}/${pkgname}-${pkgver}"
+ cd "${srcdir}/${pkgname}"
patch -p0 -i ../gcc-undefined-symbols.diff
- patch -p1 -i ../curl-streams.diff
- sed -i 's|ffmpeg/avformat.h|libavformat/avformat.h|' decoder_plugins/ffmpeg/ffmpeg.c
- sed -i 's|avcodec_decode_audio|avcodec_decode_audio2|' decoder_plugins/ffmpeg/ffmpeg.c
+
# Disabling aac to use the external ffmpeg to play them (FS#13164)
+ ./autogen.sh
./configure --prefix=/usr --without-rcc --without-aac \
--with-oss --with-alsa --with-jack --with-mp3 \
--with-musepack --with-vorbis --with-flac --with-wavpack \
--with-sndfile --with-modplug --with-ffmpeg --with-speex \
- --with-samplerate --with-curl
+ --with-samplerate --with-curl --disable-debug
make
}
package() {
- cd "${srcdir}/${pkgname}-${pkgver}"
+ cd "${srcdir}/${pkgname}"
make DESTDIR="${pkgdir}" install
}
diff --git a/extra/python-pycurl/PKGBUILD b/extra/python-pycurl/PKGBUILD
new file mode 100644
index 000000000..a60dc046a
--- /dev/null
+++ b/extra/python-pycurl/PKGBUILD
@@ -0,0 +1,22 @@
+# $Id: PKGBUILD 127116 2011-06-10 22:25:50Z andrea $
+# Maintainer:
+# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Contributor: Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve>
+
+pkgname=python-pycurl
+pkgver=7.19.0
+pkgrel=5
+pkgdesc="A Python interface to libcurl"
+arch=('i686' 'x86_64')
+url="http://pycurl.sourceforge.net"
+license=('GPL')
+depends=('python2' 'curl')
+replaces=('pycurl')
+provides=('pycurl')
+source=("http://pycurl.sourceforge.net/download/pycurl-${pkgver}.tar.gz")
+md5sums=('919d58fe37e69fe87ce4534d8b6a1c7b')
+
+package() {
+ cd "${srcdir}"/pycurl-${pkgver}
+ python2 setup.py install --curl-config=/usr/bin/curl-config --prefix ${pkgdir}/usr
+}
diff --git a/extra/re-alpine/PKGBUILD b/extra/re-alpine/PKGBUILD
new file mode 100644
index 000000000..9293744c9
--- /dev/null
+++ b/extra/re-alpine/PKGBUILD
@@ -0,0 +1,38 @@
+# $Id: PKGBUILD 125747 2011-05-29 05:24:41Z eric $
+# Maintainer: Eric Bélanger <eric@archlinux.org>
+# Contributor: Smith Dhumbumroong <zodmaner@gmail.com>
+
+pkgname=re-alpine
+pkgver=2.02
+pkgrel=3
+pkgdesc="The continuation of the Alpine email client from University of Washington"
+arch=('i686' 'x86_64')
+url="http://sourceforge.net/projects/re-alpine/"
+license=('APACHE')
+depends=('libldap' 'krb5')
+optdepends=('aspell: spell-checking support'
+ 'hunspell: spell-checking support')
+provides=('pine' 'alpine')
+conflicts=('pine' 'alpine')
+replaces=('pine' 'alpine')
+options=('!makeflags')
+source=(http://downloads.sourceforge.net/project/re-alpine/${pkgname}-${pkgver}.tar.bz2
+ maildir.patch)
+md5sums=('5e75826b15f05674856be8618bdefdfb'
+ '8d7a0e8d940e84e978f50266405c7361')
+sha1sums=('9c2f13dbc7ca75e7a09f81df607db84694b10fa6'
+ 'c09a8e42f9dba3e63a3755a9c418af95da721d8d')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -p1 < ../maildir.patch
+ LIBS+=-lpam ./configure --prefix=/usr --without-passfile --without-tcl \
+ --disable-shared --with-system-pinerc=/etc/alpine.d/pine.conf \
+ --with-system-fixed-pinerc=/etc/alpine.d/pine.conf.fixed
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/extra/re-alpine/maildir.patch b/extra/re-alpine/maildir.patch
new file mode 100644
index 000000000..cff18cb3f
--- /dev/null
+++ b/extra/re-alpine/maildir.patch
@@ -0,0 +1,3712 @@
+diff -rc alpine-2.00/alpine/alpine.c alpine-2.00.maildir/alpine/alpine.c
+*** alpine-2.00/alpine/alpine.c 2008-06-03 17:31:05.000000000 -0500
+--- alpine-2.00.maildir/alpine/alpine.c 2011-01-15 19:11:06.000000000 -0600
+***************
+*** 553,558 ****
+--- 553,563 ----
+ if(F_ON(F_MAILDROPS_PRESERVE_STATE, ps_global))
+ mail_parameters(NULL, SET_SNARFPRESERVE, (void *) TRUE);
+
++ #ifndef _WINDOWS
++ mail_parameters(NULL,SET_COURIERSTYLE,
++ (void *)(F_ON(F_COURIER_FOLDER_LIST, ps_global) ? 1 : 0));
++ #endif
++
+ rvl = 0L;
+ if(pine_state->VAR_NNTPRANGE){
+ if(!SVAR_NNTPRANGE(pine_state, rvl, tmp_20k_buf, SIZEOF_20KBUF))
+diff -rc alpine-2.00/alpine/confscroll.c alpine-2.00.maildir/alpine/confscroll.c
+*** alpine-2.00/alpine/confscroll.c 2008-08-21 17:14:45.000000000 -0500
+--- alpine-2.00.maildir/alpine/confscroll.c 2011-01-15 19:11:06.000000000 -0600
+***************
+*** 5489,5494 ****
+--- 5489,5500 ----
+ (void *)var->current_val.p);
+ }
+ #endif
++ #ifndef _WINDOWS
++ else if(var == &ps->vars[V_MAILDIR_LOCATION]){
++ if(var->current_val.p && var->current_val.p[0])
++ mail_parameters(NULL, SET_MDINBOXPATH, (void *)var->current_val.p);
++ }
++ #endif
+ else if(revert && standard_radio_var(ps, var)){
+
+ cur_rule_value(var, TRUE, FALSE);
+diff -rc alpine-2.00/imap/src/c-client/mail.c alpine-2.00.maildir/imap/src/c-client/mail.c
+*** alpine-2.00/imap/src/c-client/mail.c 2008-06-04 13:39:54.000000000 -0500
+--- alpine-2.00.maildir/imap/src/c-client/mail.c 2011-01-15 19:11:07.000000000 -0600
+***************
+*** 991,997 ****
+ MAILSTREAM *ts;
+ char *s,*t,tmp[MAILTMPLEN];
+ size_t i;
+! DRIVER *d;
+ /* never allow names with newlines */
+ if (s = strpbrk (mailbox,"\015\012")) {
+ MM_LOG ("Can't create mailbox with such a name",ERROR);
+--- 991,997 ----
+ MAILSTREAM *ts;
+ char *s,*t,tmp[MAILTMPLEN];
+ size_t i;
+! DRIVER *d, *md;
+ /* never allow names with newlines */
+ if (s = strpbrk (mailbox,"\015\012")) {
+ MM_LOG ("Can't create mailbox with such a name",ERROR);
+***************
+*** 1015,1020 ****
+--- 1015,1022 ----
+ return NIL;
+ }
+
++ /* Hack, we should do this better, but it works */
++ for (md = maildrivers; md && strcmp (md->name, "md"); md = md->next);
+ /* see if special driver hack */
+ if ((mailbox[0] == '#') && ((mailbox[1] == 'd') || (mailbox[1] == 'D')) &&
+ ((mailbox[2] == 'r') || (mailbox[2] == 'R')) &&
+***************
+*** 1045,1050 ****
+--- 1047,1059 ----
+ (((*mailbox == '{') || (*mailbox == '#')) &&
+ (stream = mail_open (NIL,mailbox,OP_PROTOTYPE | OP_SILENT))))
+ d = stream->dtb;
++ else if(mailbox[0] == '#'
++ && (mailbox[1] == 'm' || mailbox[1] == 'M')
++ && (mailbox[2] == 'd' || mailbox[2] == 'D'
++ || mailbox[2] == 'c' || mailbox[2] == 'C')
++ && mailbox[3] == '/'
++ && mailbox[4] != '\0')
++ return (*md->create)(stream, mailbox);
+ else if ((*mailbox != '{') && (ts = default_proto (NIL))) d = ts->dtb;
+ else { /* failed utterly */
+ sprintf (tmp,"Can't create mailbox %.80s: indeterminate format",mailbox);
+diff -rc alpine-2.00/imap/src/c-client/mail.h alpine-2.00.maildir/imap/src/c-client/mail.h
+*** alpine-2.00/imap/src/c-client/mail.h 2008-08-08 12:34:22.000000000 -0500
+--- alpine-2.00.maildir/imap/src/c-client/mail.h 2011-01-15 19:11:07.000000000 -0600
+***************
+*** 353,358 ****
+--- 353,362 ----
+ #define SET_SCANCONTENTS (long) 573
+ #define GET_MHALLOWINBOX (long) 574
+ #define SET_MHALLOWINBOX (long) 575
++ #define GET_COURIERSTYLE (long) 576
++ #define SET_COURIERSTYLE (long) 577
++ #define SET_MDINBOXPATH (long) 578
++ #define GET_MDINBOXPATH (long) 579
+
+ /* Driver flags */
+
+diff -rc alpine-2.00/imap/src/osdep/unix/dummy.c alpine-2.00.maildir/imap/src/osdep/unix/dummy.c
+*** alpine-2.00/imap/src/osdep/unix/dummy.c 2008-06-04 13:18:34.000000000 -0500
+--- alpine-2.00.maildir/imap/src/osdep/unix/dummy.c 2011-01-15 20:01:59.000000000 -0600
+***************
+*** 106,118 ****
+ * Accepts: mailbox name
+ * Returns: our driver if name is valid, NIL otherwise
+ */
+!
+ DRIVER *dummy_valid (char *name)
+ {
+! char *s,tmp[MAILTMPLEN];
+ struct stat sbuf;
+ /* must be valid local mailbox */
+! if (name && *name && (*name != '{') && (s = mailboxfile (tmp,name))) {
+ /* indeterminate clearbox INBOX */
+ if (!*s) return &dummydriver;
+ else if (!stat (s,&sbuf)) switch (sbuf.st_mode & S_IFMT) {
+--- 106,124 ----
+ * Accepts: mailbox name
+ * Returns: our driver if name is valid, NIL otherwise
+ */
+! char * maildir_remove_root(char *);
+ DRIVER *dummy_valid (char *name)
+ {
+! char *s,tmp[MAILTMPLEN], *rname;
+ struct stat sbuf;
++
++ if(strlen(name) > MAILTMPLEN)
++ name[MAILTMPLEN] = '\0';
++
++ strcpy(tmp, name);
++ rname = maildir_remove_root(tmp);
+ /* must be valid local mailbox */
+! if (rname && *rname && (*rname != '{') && (s = mailboxfile (tmp,rname))) {
+ /* indeterminate clearbox INBOX */
+ if (!*s) return &dummydriver;
+ else if (!stat (s,&sbuf)) switch (sbuf.st_mode & S_IFMT) {
+***************
+*** 121,128 ****
+ return &dummydriver;
+ }
+ /* blackbox INBOX does not exist yet */
+! else if (!compare_cstring (name,"INBOX")) return &dummydriver;
+ }
+ return NIL;
+ }
+
+--- 127,135 ----
+ return &dummydriver;
+ }
+ /* blackbox INBOX does not exist yet */
+! else if (!compare_cstring (rname,"INBOX")) return &dummydriver;
+ }
++ if(rname) fs_give((void **)&rname);
+ return NIL;
+ }
+
+***************
+*** 454,459 ****
+--- 461,468 ----
+ {
+ char *s,tmp[MAILTMPLEN];
+ long ret = NIL;
++ if(!strncmp(mailbox,"#md/",4) || !strncmp(mailbox,"#mc/", 4))
++ return maildir_create(stream, mailbox);
+ /* validate name */
+ if (!(compare_cstring (mailbox,"INBOX") && (s = dummy_file (tmp,mailbox)))) {
+ sprintf (tmp,"Can't create %.80s: invalid name",mailbox);
+***************
+*** 519,524 ****
+--- 528,541 ----
+ {
+ struct stat sbuf;
+ char *s,tmp[MAILTMPLEN];
++ if (!strncmp(mailbox,"#md/",4) || !strncmp(mailbox,"#mc/", 4)
++ || is_valid_maildir(&mailbox)){
++ char tmp[MAILTMPLEN] = {'\0'};
++ strcpy(tmp, mailbox);
++ if(tmp[strlen(tmp) - 1] != '/')
++ tmp[strlen(tmp)] = '/';
++ return maildir_delete(stream, tmp);
++ }
+ if (!(s = dummy_file (tmp,mailbox))) {
+ sprintf (tmp,"Can't delete - invalid name: %.80s",s);
+ MM_LOG (tmp,ERROR);
+***************
+*** 544,555 ****
+ long dummy_rename (MAILSTREAM *stream,char *old,char *newname)
+ {
+ struct stat sbuf;
+! char c,*s,tmp[MAILTMPLEN],mbx[MAILTMPLEN],oldname[MAILTMPLEN];
+ /* no trailing / allowed */
+! if (!dummy_file (oldname,old) || !(s = dummy_file (mbx,newname)) ||
+ stat (oldname,&sbuf) || ((s = strrchr (s,'/')) && !s[1] &&
+ ((sbuf.st_mode & S_IFMT) != S_IFDIR))) {
+! sprintf (mbx,"Can't rename %.80s to %.80s: invalid name",old,newname);
+ MM_LOG (mbx,ERROR);
+ return NIL;
+ }
+--- 561,583 ----
+ long dummy_rename (MAILSTREAM *stream,char *old,char *newname)
+ {
+ struct stat sbuf;
+! char c,*s,tmp[MAILTMPLEN],mbx[MAILTMPLEN],oldname[MAILTMPLEN], *rold, *rnewname;
+!
+! if(strlen(old) > MAILTMPLEN)
+! old[MAILTMPLEN] = '\0';
+!
+! if(strlen(newname) > MAILTMPLEN)
+! newname[MAILTMPLEN] = '\0';
+!
+! strcpy(tmp, old);
+! rold = maildir_remove_root(tmp);
+! strcpy(tmp, newname);
+! rnewname = maildir_remove_root(tmp);
+ /* no trailing / allowed */
+! if (!dummy_file (oldname,rold) || !(s = dummy_file (mbx,rnewname)) ||
+ stat (oldname,&sbuf) || ((s = strrchr (s,'/')) && !s[1] &&
+ ((sbuf.st_mode & S_IFMT) != S_IFDIR))) {
+! sprintf (mbx,"Can't rename %.80s to %.80s: invalid name",rold,rnewname);
+ MM_LOG (mbx,ERROR);
+ return NIL;
+ }
+***************
+*** 565,578 ****
+ }
+ }
+ /* rename of non-ex INBOX creates dest */
+! if (!compare_cstring (old,"INBOX") && stat (oldname,&sbuf))
+ return dummy_create (NIL,mbx);
+ if (rename (oldname,mbx)) {
+! sprintf (tmp,"Can't rename mailbox %.80s to %.80s: %.80s",old,newname,
+ strerror (errno));
+ MM_LOG (tmp,ERROR);
+ return NIL;
+ }
+ return T; /* return success */
+ }
+
+--- 593,608 ----
+ }
+ }
+ /* rename of non-ex INBOX creates dest */
+! if (!compare_cstring (rold,"INBOX") && stat (oldname,&sbuf))
+ return dummy_create (NIL,mbx);
+ if (rename (oldname,mbx)) {
+! sprintf (tmp,"Can't rename mailbox %.80s to %.80s: %.80s",rold,rnewname,
+ strerror (errno));
+ MM_LOG (tmp,ERROR);
+ return NIL;
+ }
++ if(rold) fs_give((void **)&rold);
++ if(rnewname) fs_give((void **)&rnewname);
+ return T; /* return success */
+ }
+
+diff -rc alpine-2.00/imap/src/osdep/unix/maildir.c alpine-2.00.maildir/imap/src/osdep/unix/maildir.c
+*** alpine-2.00/imap/src/osdep/unix/maildir.c 2011-01-24 19:38:50.000000000 -0600
+--- alpine-2.00.maildir/imap/src/osdep/unix/maildir.c 2011-01-15 19:38:50.000000000 -0600
+***************
+*** 0 ****
+--- 1,2584 ----
++ /*
++ * Maildir driver for Alpine 2.00
++ *
++ * Written by Eduardo Chappa <chappa@washington.edu>
++ * Last Update: November 6, 2010.
++ *
++ */
++
++ #include <stdio.h>
++ #include <ctype.h>
++ #include <errno.h>
++ extern int errno; /* just in case */
++ #include "mail.h"
++ #include <pwd.h>
++ #include <sys/stat.h>
++ #include <sys/time.h>
++ #include "osdep.h"
++ #include "rfc822.h"
++ #include "fdstring.h"
++ #include "misc.h"
++ #include "dummy.h"
++ #include "maildir.h"
++
++ /* Driver dispatch used by MAIL */
++ DRIVER maildirdriver = {
++ "md", /* driver name, yes it's md, not maildir */
++ /* driver flags */
++ DR_MAIL|DR_LOCAL|DR_NAMESPACE|DR_DIRFMT,
++ (DRIVER *) NIL, /* next driver */
++ maildir_valid, /* mailbox is valid for us */
++ maildir_parameters, /* manipulate parameters */
++ NIL, /* scan mailboxes */
++ maildir_list, /* find mailboxes */
++ maildir_lsub, /* find subscribed mailboxes */
++ maildir_sub, /* subscribe to mailbox */
++ maildir_unsub, /* unsubscribe from mailbox */
++ maildir_create, /* create mailbox */
++ maildir_delete, /* delete mailbox */
++ maildir_rename, /* rename mailbox */
++ mail_status_default, /* status of mailbox */
++ maildir_open, /* open mailbox */
++ maildir_close, /* close mailbox */
++ maildir_fast, /* fetch message "fast" attributes */
++ NIL, /* fetch message flags */
++ NIL, /* fetch overview */
++ NIL, /* fetch message structure */
++ maildir_header, /* fetch message header */
++ maildir_text, /* fetch message body */
++ NIL, /* fetch partial message text */
++ NIL, /* unique identifier */
++ NIL, /* message number */
++ NIL, /* modify flags */
++ maildir_flagmsg, /* per-message modify flags */
++ NIL, /* search for message based on criteria */
++ NIL, /* sort messages */
++ NIL, /* thread messages */
++ maildir_ping, /* ping mailbox to see if still alive */
++ maildir_check, /* check for new messages */
++ maildir_expunge, /* expunge deleted messages */
++ maildir_copy, /* copy messages to another mailbox */
++ maildir_append, /* append string message to mailbox */
++ NIL /* garbage collect stream */
++ };
++
++
++ DRIVER courierdriver = {
++ "mc", /* Why a separate driver? So that
++ createproto will work */
++ /* driver flags */
++ DR_MAIL|DR_LOCAL|DR_NAMESPACE|DR_DIRFMT,
++ (DRIVER *) NIL, /* next driver */
++ maildir_valid, /* mailbox is valid for us */
++ maildir_parameters, /* manipulate parameters */
++ NIL, /* scan mailboxes */
++ courier_list, /* find mailboxes */
++ maildir_lsub, /* find subscribed mailboxes */
++ maildir_sub, /* subscribe to mailbox */
++ maildir_unsub, /* unsubscribe from mailbox */
++ maildir_create, /* create mailbox */
++ maildir_delete, /* delete mailbox */
++ maildir_rename, /* rename mailbox */
++ mail_status_default, /* status of mailbox */
++ maildir_open, /* open mailbox */
++ maildir_close, /* close mailbox */
++ maildir_fast, /* fetch message "fast" attributes */
++ NIL, /* fetch message flags */
++ NIL, /* fetch overview */
++ NIL, /* fetch message structure */
++ maildir_header, /* fetch message header */
++ maildir_text, /* fetch message body */
++ NIL, /* fetch partial message text */
++ NIL, /* unique identifier */
++ NIL, /* message number */
++ NIL, /* modify flags */
++ maildir_flagmsg, /* per-message modify flags */
++ NIL, /* search for message based on criteria */
++ NIL, /* sort messages */
++ NIL, /* thread messages */
++ maildir_ping, /* ping mailbox to see if still alive */
++ maildir_check, /* check for new messages */
++ maildir_expunge, /* expunge deleted messages */
++ maildir_copy, /* copy messages to another mailbox */
++ maildir_append, /* append string message to mailbox */
++ NIL /* garbage collect stream */
++ };
++
++ MAILSTREAM maildirproto = {&maildirdriver}; /* prototype stream */
++ MAILSTREAM courierproto = {&courierdriver}; /* prototype stream */
++
++ long maildir_dirfmttest (char *name)
++ {
++ int i;
++ for (i = 0; mdstruct[i] && strcmp(name, mdstruct[i]); i++);
++ return (i < EndDir) || !strcmp(name, MDDIR)
++ || !strncmp(name, MDUIDLAST, strlen(MDUIDLAST))
++ || !strncmp(name, MDUIDTEMP, strlen(MDUIDTEMP)) ? LONGT : NIL;
++ }
++
++ void
++ md_domain_name(void)
++ {
++ int i;
++
++ strcpy(mdlocaldomain,mylocalhost ());
++ for (i = 0; mdlocaldomain[i] ; i++)
++ if(mdlocaldomain[i] == '/')
++ mdlocaldomain[i] = '\057';
++ else if (mdlocaldomain[i] == ':')
++ mdlocaldomain[i] = '\072';
++ }
++
++ char *
++ myrootdir(char *name)
++ {
++ return myhomedir();
++ }
++
++ char *
++ mdirpath(void)
++ {
++ char *path = maildir_parameters(GET_MDINBOXPATH,NIL);
++ return path ? (path[0] ? path : ".") : "Maildir";
++ }
++
++ /* remove the "#md/" or "#mc/" part from a folder name */
++ char *
++ maildir_remove_root (char *name)
++ {
++ int courier = IS_COURIER(name), offset;
++ char realname[MAILTMPLEN];
++
++ offset = maildir_valid_name(name) ? (name[3] == '/' ? 4 : 3) : 0;
++ if(courier)
++ courier_realname(name+offset, realname);
++ else
++ strcpy(realname, name+offset);
++ return cpystr(realname);
++ }
++
++
++ /* Check validity of the name, we accept:
++ * a) #md/directory/folder
++ * b) #md/inbox
++ * A few considerations: We can only accept as valid
++ * a) names that start with #md/ and the directory exists or
++ * b) names that do not start with #md/ but are maildir directories (have
++ * the /cur, /tmp and /new structure)
++ */
++ int maildir_valid_name (char *name)
++ {
++ char tmpname[MAILTMPLEN] = {'\0'};
++
++ if (mdfpath)
++ fs_give((void **)&mdfpath);
++ if (name && (name[0] != '#'))
++ sprintf(tmpname,"%s%s",MDPREFIX(CCLIENT), name);
++ mdfpath = cpystr(tmpname[0] ? tmpname : name);
++
++ return IS_CCLIENT(name) || IS_COURIER(name);
++ }
++
++ /* Check if the directory whose path is given by name is a valid maildir
++ * directory (contains /cur, /tmp and /new)
++ */
++ int maildir_valid_dir (char *name)
++ {
++ int len;
++ DirNamesType i;
++ struct stat sbuf;
++ char tmp[MAILTMPLEN];
++
++ if(name[strlen(name) - 1] == '/')
++ name[strlen(name) - 1] = '\0';
++ len = strlen(name);
++ for (i = Cur; i != EndDir; i++){
++ MDFLD(tmp, name, i);
++ if (stat(tmp, &sbuf) < 0 || !S_ISDIR(sbuf.st_mode))
++ break;
++ }
++ name[len] = '\0';
++ return (i == EndDir) ? T : NIL;
++ }
++
++ void courier_realname(char *name, char *realname)
++ {
++ int i,j;
++
++ if(!name)
++ return;
++
++ for (i = 0, j = 0; i < MAILTMPLEN && j < strlen(name); j++, i++){
++ realname[i] = name[j];
++ if(name[j] == '/' && name[j+1] != '.' && name[j+1] != '%'
++ && name[j+1] != '*')
++ realname[++i] = '.';
++ }
++ if(realname[i-1] == '.')
++ i--;
++ realname[i] = '\0';
++ }
++
++
++ /* given a maildir folder, return its path. Memory freed by caller. Directory
++ * does not contain the trailing slash "/". On error NULL is returned.
++ */
++ int maildir_file_path (char *name, char *tmp)
++ {
++ char *maildirpath = mdirpath(), *rname;
++ int courier = IS_COURIER(name);
++
++ /* There are several ways in which the path can come, so we will handle
++ them here. First we deal with #mc/ or #md/ prefix by removing the
++ prefix, if any */
++
++ if(strlen(name) >= MAILTMPLEN)
++ name[MAILTMPLEN] = '\0';
++ strcpy(tmp, name);
++ rname = maildir_remove_root(tmp);
++ tmp[0] = '\0'; /* just in case something fails */
++
++ if (strlen(myrootdir(rname)) +
++ max(strlen(rname), strlen(maildirpath)) > MAILTMPLEN){
++ errno = ENAMETOOLONG;
++ sprintf(tmp,"Error opening \"%s\": %s", rname, strerror (errno));
++ mm_log(tmp,ERROR);
++ return NIL;
++ }
++
++ /* There are two ways in which the name can come here, either as a
++ full path or not. If it is not a full path it can come in two ways,
++ either as a file system path (Maildir/.Drafts) or as a maildir path
++ (INBOX.Drafts)
++ */
++
++ if(*rname == '/') /* full path */
++ strcpy(tmp, rname); /* do nothing */
++ else{
++ sprintf (tmp,"%s/%s%s%s", myrootdir (rname),
++ strncmp (ucase (strcpy (tmp, rname)), "INBOX", 5)
++ ? rname : maildirpath,
++ strncmp (ucase (strcpy (tmp, rname)), "INBOX", 5)
++ ? "" : (courier ? "/" : ""),
++ strncmp (ucase (strcpy (tmp, rname)), "INBOX", 5)
++ ? "" : (*(rname+5) == MDSEPARATOR(courier) ? rname+5 : ""));
++ }
++ if(rname) fs_give((void **)&rname);
++ return tmp[0] ? T : NIL;
++ }
++
++ /* This function is given a full path for a mailbox and returns
++ * if it is a valid maildir transformed to canonical notation
++ */
++ int
++ is_valid_maildir (char **name)
++ {
++ if (!strncmp(*name, myrootdir (*name), strlen(myrootdir(*name)))){
++ (*name) += strlen(myrootdir(*name));
++ if (**name == '/') (*name)++;
++ }
++ return maildir_valid(*name) ? T : NIL;
++ }
++
++ /* Check validity of mailbox. This routine does not send errors to log, other
++ * routines calling this one may do so, though
++ */
++
++ DRIVER *maildir_valid (char *name)
++ {
++ char tmpname[MAILTMPLEN];
++
++ maildir_file_path(name, tmpname);
++
++ return maildir_valid_dir(tmpname)
++ ? (IS_COURIER(name) ? &courierdriver : &maildirdriver) : NIL;
++ }
++
++ void maildir_fast (MAILSTREAM *stream,char *sequence,long flags)
++ {
++ unsigned long i;
++ MESSAGECACHE *elt;
++ /* get sequence */
++ if (stream && LOCAL && ((flags & FT_UID) ?
++ mail_uid_sequence (stream,sequence) :
++ mail_sequence (stream,sequence)))
++ for (i = 1L; i <= stream->nmsgs; i++) {
++ if ((elt = mail_elt (stream,i))->sequence && (elt->valid = T) &&
++ !(elt->day && elt->rfc822_size)) {
++ ENVELOPE **env = NIL;
++ ENVELOPE *e = NIL;
++ if (!stream->scache) env = &elt->private.msg.env;
++ else if (stream->msgno == i) env = &stream->env;
++ else env = &e;
++ if (!*env || !elt->rfc822_size) {
++ STRING bs;
++ unsigned long hs;
++ char *ht = (*stream->dtb->header) (stream,i,&hs,NIL);
++
++ if (!*env) rfc822_parse_msg (env,NIL,ht,hs,NIL,BADHOST,
++ stream->dtb->flags);
++ if (!elt->rfc822_size) {
++ (*stream->dtb->text) (stream,i,&bs,FT_PEEK);
++ elt->rfc822_size = hs + SIZE (&bs) - GETPOS (&bs);
++ }
++ }
++
++ if (!elt->day && *env && (*env)->date)
++ mail_parse_date (elt,(*env)->date);
++
++ if (!elt->day) elt->day = elt->month = 1;
++ mail_free_envelope (&e);
++ }
++ }
++ }
++
++ int
++ maildir_eliminate_duplicate (char *name, struct direct ***flist, unsigned long *nfiles)
++ {
++ int i, j, k, error = 0, scanr;
++ char new[MAILTMPLEN], old[MAILTMPLEN], tmp[MAILTMPLEN], *str;
++ struct direct **names = NIL;
++
++ if((scanr = maildir_doscandir(name, &names, CCLIENT)) < 0)
++ return -1;
++
++ if(nfiles) *nfiles = scanr;
++ for(i = 0, j = 1, k = 0; j < scanr; i++, j++){
++ if(k)
++ names[i] = names[i+k];
++ if(same_maildir_file(names[i]->d_name, names[j]->d_name)){
++ int d, f, r, s;
++ maildir_getflag(names[i]->d_name, &d, &f, &r, &s, NIL);
++ sprintf(old,"%s/%s", name, names[i]->d_name);
++ sprintf(new,"%s/.%s", name, names[i]->d_name);
++ if(rename(old, new) < 0 && errno != EEXIST)
++ error++;
++ if(!error){
++ for(; j < scanr
++ && same_maildir_file(names[i]->d_name, names[j]->d_name)
++ ; j++, k++){
++ maildir_getflag(names[j]->d_name, (d ? NIL : &d),
++ (f ? NIL : &f), (r ? NIL : &r), (s ? NIL : &s), NIL);
++ sprintf(tmp,"%s/%s", name, names[j]->d_name);
++ if(unlink(tmp) < 0){ /* Hmmm... a problem, let's see */
++ struct stat sbuf;
++ if (stat(tmp, &sbuf) == 0 && (sbuf.st_mode & S_IFMT) == S_IFREG)
++ error++;
++ }
++ }
++ if((str = strrchr(names[i]->d_name,FLAGSEP)) != NULL) *str = '\0';
++ sprintf (old,"%s/%s%s%s%s%s%s", name, names[i]->d_name, MDSEP(2),
++ MDFLAG(Draft, d), MDFLAG(Flagged, f), MDFLAG(Replied, r),
++ MDFLAG(Seen, s));
++ if(rename(new, old) < 0)
++ error++;
++ }
++ }
++
++ }
++ if(k > 0)
++ fs_give((void **)&names);
++ else
++ *flist = names;
++ return error ? -1 : k;
++ }
++
++ int
++ maildir_doscandir(char *name, struct direct ***flist, int flag)
++ {
++ return scandir(name, flist,
++ flag == CCLIENT ? maildir_select : courier_dir_select,
++ flag == CCLIENT ? maildir_namesort : courier_dir_sort);
++ }
++
++ /*
++ * return all files in a given directory. This is a separate call
++ * so that if there are warnings during compilation this only appears once.
++ */
++ unsigned long
++ maildir_scandir (char *name, struct direct ***flist,
++ unsigned long *nfiles, int *scand, int flag)
++ {
++ struct stat sbuf;
++ int rv = -2; /* impossible value */
++
++ if (scand)
++ *scand = -1; /* assume error for safety */
++ *nfiles = 0;
++ if((stat(name,&sbuf) < 0)
++ || (flag == CCLIENT
++ && ((rv = maildir_eliminate_duplicate(name, flist, nfiles)) < 0)))
++ return 0L;
++
++ if (scand && (rv > 0 || rv == -2))
++ *nfiles = maildir_doscandir(name, flist, flag);
++
++ if(scand) *scand = *nfiles;
++
++ return (unsigned long) sbuf.st_ctime;
++ }
++
++ /* Does a message with given name exists (or was it removed)?
++ * Returns: 1 - yes, such message exist,
++ * 0 - No, that message does not exist anymore
++ *
++ * Parameters: stream, name of mailbox, new name if his message does not
++ * exist.
++ */
++
++ int maildir_message_exists(MAILSTREAM *stream, char *name, char *newfile)
++ {
++ char tmp[MAILTMPLEN];
++ int gotit = NIL;
++ DIR *dir;
++ struct direct *d;
++ struct stat sbuf;
++
++ /* First check directly if it exists, if not there, look for it */
++ sprintf(tmp,"%s/%s", LOCAL->curdir, name);
++ if ((stat(tmp, &sbuf) == 0) && ((sbuf.st_mode & S_IFMT) == S_IFREG))
++ return T;
++
++ if (!(dir = opendir (LOCAL->curdir)))
++ return NIL;
++
++ while ((d = readdir(dir)) && gotit == NIL){
++ if (d->d_name[0] == '.')
++ continue;
++ if (same_maildir_file(d->d_name, name)){
++ gotit = T;
++ strcpy(newfile, d->d_name);
++ }
++ }
++ closedir(dir);
++ return gotit;
++ }
++
++ /* Maildir open */
++
++ MAILSTREAM *maildir_open (MAILSTREAM *stream)
++ {
++ char tmp[MAILTMPLEN];
++ struct stat sbuf;
++
++ if (!stream) return &maildirproto;
++ if (stream->local) fatal ("maildir recycle stream");
++ md_domain_name(); /* get domain name for maildir files in mdlocaldomain */
++ if(mypid == (pid_t) 0)
++ mypid = getpid();
++ if (!stream->rdonly){
++ stream->perm_seen = stream->perm_deleted = stream->perm_flagged =
++ stream->perm_answered = stream->perm_draft = T;
++ }
++ stream->local = (MAILDIRLOCAL *) fs_get (sizeof (MAILDIRLOCAL));
++ memset(LOCAL, 0, sizeof(MAILDIRLOCAL));
++ LOCAL->fd = -1;
++
++ LOCAL->courier = IS_COURIER(stream->mailbox);
++ strcpy(tmp, stream->mailbox);
++ if (maildir_file_path (stream->mailbox, tmp))
++ LOCAL->dir = cpystr (tmp);
++ LOCAL->candouid = maildir_can_assign_uid(stream);
++ maildir_read_uid(stream, &stream->uid_last, &stream->uid_validity);
++ if (LOCAL->dir){
++ MDFLD(tmp, LOCAL->dir, Cur);
++ LOCAL->curdir = cpystr (tmp);
++ if (stat (LOCAL->curdir,&sbuf) < 0) {
++ sprintf (tmp,"Can't open folder %s: %s",
++ stream->mailbox,strerror (errno));
++ mm_log (tmp,ERROR);
++ maildir_close(stream, 0);
++ return NIL;
++ }
++ }
++
++ if(maildir_file_path (stream->mailbox, tmp)){
++ fs_give ((void **) &stream->mailbox);
++ stream->mailbox = cpystr(tmp);
++ }
++
++ LOCAL->buf = (char *) fs_get ((LOCAL->buflen = SENDBUFLEN) + 1);
++ stream->sequence++;
++ stream->nmsgs = stream->recent = 0L;
++
++ maildir_parse_folder(stream, 1);
++
++ return stream;
++ }
++
++ /* Maildir initial parsing of the folder */
++ void
++ maildir_parse_folder (MAILSTREAM *stream, int full)
++ {
++ char tmp[MAILTMPLEN], tmp2[MAILTMPLEN];
++ struct direct **namescur = NIL, **namesnew = NIL;
++ unsigned long i, nfilescur = 0L, nfilesnew = 0L, oldpos, newpos, total;
++ int scan_err, rescan, loop = 0;
++
++ if (!stream) /* what??? */
++ return;
++
++ MM_CRITICAL(stream);
++
++ MDFLD(tmp, LOCAL->dir, New);
++ maildir_scandir (tmp, &namesnew, &nfilesnew, &scan_err, CCLIENT);
++ if (scan_err < 0)
++ maildir_abort(stream);
++
++ /* Scan old messages first, escoba! */
++ if(stream->rdonly ||
++ (LOCAL && ((maildir_initial_check(stream, Cur) == 0)
++ || nfilesnew > 0L))){
++ MDFLD(tmp, LOCAL->dir, Cur);
++ LOCAL->scantime = maildir_scandir (tmp, &namescur, &nfilescur,
++ &scan_err, CCLIENT);
++ if (scan_err < 0){
++ if(namesnew){
++ for(i = 0L; i < nfilesnew; i++)
++ fs_give((void **)&namesnew[i]);
++ fs_give((void **) &namesnew);
++ }
++ maildir_abort(stream);
++ }
++ }
++ if(LOCAL && (maildir_initial_check(stream, New) == 0)
++ && (nfilescur > 0L)){
++ MDFLD(tmp, LOCAL->dir, New);
++ while(LOCAL && loop < 10){
++ if(nfilesnew == 0L)
++ maildir_scandir (tmp, &namesnew, &nfilesnew, &scan_err, CCLIENT);
++ if (scan_err < 0){
++ if(namesnew){
++ for(i = 0L; i < nfilesnew; i++)
++ fs_give((void **)&namesnew[i]);
++ fs_give((void **) &namesnew);
++ }
++ maildir_abort(stream);
++ break;
++ }
++ for(i = 0L, rescan = 0, newpos = oldpos = 0L;
++ newpos < nfilescur && i < nfilesnew; i++){
++ if(maildir_message_in_list(namesnew[i]->d_name, namescur, oldpos,
++ nfilescur - 1L, &newpos)){
++ oldpos = newpos;
++ sprintf(tmp2,"%s/%s",tmp,namesnew[i]->d_name);
++ if(unlink(tmp2) < 0)
++ scan_err = -1;
++ rescan++;
++ }
++ else
++ newpos = oldpos;
++ }
++ if(scan_err < 0)
++ maildir_abort(stream);
++ if(rescan == 0)
++ break;
++ else{ /* restart */
++ if(namesnew){
++ for(i = 0L; i < nfilesnew; i++)
++ fs_give((void **)&namesnew[i]);
++ fs_give((void **) &namesnew);
++ }
++ nfilesnew = 0L;
++ loop++;
++ }
++ }
++ }
++ if(loop == 10)
++ maildir_abort(stream);
++ if(LOCAL){
++ if(stream->rdonly)
++ stream->recent = 0L;
++ total = namescur || stream->rdonly
++ ? maildir_parse_dir(stream, 0L, Cur, namescur,
++ nfilescur, full) : stream->nmsgs;
++ stream->nmsgs = maildir_parse_dir(stream, total, New, namesnew,
++ nfilesnew, full);
++ }
++ if(namesnew){
++ for(i = 0L; i < nfilesnew; i++)
++ fs_give((void **)&namesnew[i]);
++ fs_give((void **) &namesnew);
++ }
++ if(namescur){
++ for(i = 0L; i < nfilescur; i++)
++ fs_give((void **)&namescur[i]);
++ fs_give((void **) &namescur);
++ }
++ MM_NOCRITICAL(stream);
++ }
++
++ int
++ maildir_initial_check (MAILSTREAM *stream, DirNamesType dirtype)
++ {
++ char tmp[MAILTMPLEN];
++ struct stat sbuf;
++
++ MDFLD(tmp, LOCAL->dir, dirtype);
++ if (access (tmp, R_OK|W_OK|X_OK) != 0){
++ maildir_abort(stream);
++ return -1;
++ }
++
++ MDFLD(tmp, LOCAL->dir, Cur);
++ if (dirtype != New &&
++ (stat(tmp, &sbuf) < 0 || sbuf.st_ctime == LOCAL->scantime))
++ return -1;
++ return 0;
++ }
++
++
++ /* Return the number of messages in the directory, while filling the
++ * elt structure.
++ */
++
++ unsigned long
++ maildir_parse_dir(MAILSTREAM *stream, unsigned long nmsgs,
++ DirNamesType dirtype, struct direct **names,
++ unsigned long nfiles, int full)
++ {
++ char tmp[MAILTMPLEN], tmp2[MAILTMPLEN], file[MAILTMPLEN],
++ newfile[MAILTMPLEN], *mdstr;
++ struct stat sbuf;
++ unsigned long i, new = 0L, l, uid_last;
++ unsigned long recent = stream ? stream->recent : 0L;
++ int d = 0, f = 0, r = 0, s = 0, t = 0;
++ int we_compute, in_list;
++ int silent = stream ? stream->silent : NIL;
++ MESSAGECACHE *elt;
++
++ MDFLD(tmp, LOCAL->dir, dirtype);
++ if (dirtype == Cur && !stream->rdonly)
++ for (i = 1L; i <= stream->nmsgs;){
++ elt = mail_elt(stream, i);
++ in_list = elt && elt->private.spare.ptr && nfiles > 0L
++ ? (MDPOS(elt) < nfiles
++ ? same_maildir_file(MDFILE(elt), names[MDPOS(elt)]->d_name)
++ : NIL)
++ || maildir_message_in_list(MDFILE(elt), names, 0L,
++ nfiles - 1L, &MDPOS(elt))
++ : NIL;
++ if (!in_list){
++ if (elt->private.spare.ptr)
++ maildir_free_file ((void **) &elt->private.spare.ptr);
++
++ if (elt->recent) --recent;
++ mail_expunged(stream,i);
++ }
++ else i++;
++ }
++
++ stream->silent = T;
++ uid_last = 0L;
++ for (we_compute = 0, i = l = 1L; l <= nfiles; l++){
++ unsigned long pos, uid;
++ if (dirtype == New && !stream->rdonly){ /* move new messages to cur */
++ pos = l - 1L;
++ sprintf (file,"%s/%s", tmp, names[pos]->d_name);
++ if(lstat(file,&sbuf) == 0)
++ switch(sbuf.st_mode & S_IFMT){
++ case S_IFREG:
++ strcpy(tmp2, names[pos]->d_name);
++ if((mdstr = strstr(tmp2,MDSEP(3)))
++ || (mdstr = strstr(tmp2,MDSEP(2))))
++ *(mdstr+1) = '2';
++ else
++ strcat(tmp2, MDSEP(2));
++ sprintf(newfile, "%s/%s",LOCAL->curdir, tmp2);
++ if(rename (file, newfile) != 0){
++ mm_log("Unable to read new mail!", WARN);
++ continue;
++ }
++ unlink (file);
++ new++;
++ break;
++ case S_IFLNK: /* clean up, clean up, everybody, everywhere */
++ if(unlink(file) < 0){
++ if(LOCAL->link == NIL){
++ mm_log("Unable to remove symbolic link", WARN);
++ LOCAL->link = T;
++ }
++ }
++ continue;
++ break;
++ default:
++ if(LOCAL && LOCAL->link == NIL){
++ mm_log("Unrecognized file or link in folder", WARN);
++ LOCAL->link = T;
++ }
++ continue;
++ break;
++ }
++ }
++ mail_exists(stream, i + nmsgs);
++ elt = mail_elt(stream, i + nmsgs);
++ pos = (elt && elt->private.spare.ptr) ? MDPOS(elt) : l - 1L;
++ if (dirtype == New) elt->recent = T;
++ maildir_getflag(names[pos]->d_name, &d, &f, &r ,&s, &t);
++ if (elt->private.spare.ptr)
++ maildir_free_file_only ((void **)&elt->private.spare.ptr);
++ else{
++ maildir_get_file((MAILDIRFILE **)&elt->private.spare.ptr);
++ we_compute++;
++ }
++ MDFILE(elt) = cpystr(names[pos]->d_name);
++ MDPOS(elt) = pos;
++ MDLOC(elt) = dirtype;
++ if (dirtype == Cur){ /* deal with UIDs */
++ if(elt->private.uid == 0L)
++ elt->private.uid = maildir_get_uid(MDFILE(elt));
++ if(elt->private.uid <= uid_last){
++ uid = (we_compute ? uid_last : stream->uid_last) + 1L;
++ if(LOCAL->candouid)
++ maildir_assign_uid(stream, i + nmsgs, uid);
++ else
++ elt->private.uid = uid;
++ }
++ else
++ uid = elt->private.uid;
++ uid_last = uid;
++ if(uid_last > stream->uid_last)
++ stream->uid_last = uid_last;
++ }
++ if(dirtype == New && !stream->rdonly){
++ maildir_free_file_only((void **)&elt->private.spare.ptr);
++ MDFILE(elt) = cpystr(tmp2);
++ MDSIZE(elt) = sbuf.st_size;
++ MDMTIME(elt) = sbuf.st_mtime;
++ MDLOC(elt) = Cur;
++ }
++ if (elt->draft != d || elt->flagged != f ||
++ elt->answered != r || elt->seen != s || elt->deleted != t){
++ elt->draft = d; elt->flagged = f; elt->answered = r;
++ elt->seen = s; elt->deleted = t;
++ if (!we_compute && !stream->rdonly)
++ MM_FLAGS(stream, i+nmsgs);
++ }
++ maildir_get_date(stream, i+nmsgs);
++ elt->valid = T;
++ i++;
++ }
++ stream->silent = silent;
++ if(LOCAL->candouid && dirtype == Cur)
++ maildir_read_uid(stream, NULL, &stream->uid_validity);
++ if (dirtype == New && stream->rdonly)
++ new = nfiles;
++ mail_exists(stream, nmsgs + ((dirtype == New) ? new : nfiles));
++ mail_recent(stream, recent + ((dirtype == New) ? new : 0L));
++
++ return (nmsgs + (dirtype == New ? new : nfiles));
++ }
++
++ long maildir_ping (MAILSTREAM *stream)
++ {
++ maildir_parse_folder(stream, 0);
++ if(stream && LOCAL){
++ if(LOCAL->candouid)
++ maildir_uid_renew_tempfile(stream);
++ else /* try again to get uids */
++ LOCAL->candouid = maildir_can_assign_uid(stream);
++ }
++ return stream && LOCAL ? LONGT : NIL;
++ }
++
++ int maildir_select (const struct direct *name)
++ {
++ return (name->d_name[0] != '.');
++ }
++
++ /*
++ * Unfortunately, there is no way to sort by arrival in this driver, this
++ * means that opening a folder in this driver using the scandir function
++ * will always make this driver slower than any driver that has a natural
++ * way of sorting by arrival (like a flat file format, "mbox", "mbx", etc).
++ */
++ int maildir_namesort (const void *d1, const void *d2)
++ {
++ const struct direct *e1 = *(const struct direct **) d1;
++ const struct direct *e2 = *(const struct direct **) d2;
++
++ return comp_maildir_file((char *) e1->d_name, (char *) e2->d_name);
++ }
++
++ /* Maildir close */
++
++ void maildir_close (MAILSTREAM *stream, long options)
++ {
++ MESSAGECACHE *elt;
++ unsigned long i;
++ int silent = stream ? stream->silent : 0;
++ mailcache_t mc = (mailcache_t) mail_parameters (NIL,GET_CACHE,NIL);
++
++ if (!stream) return;
++
++ for (i = 1L; i <= stream->nmsgs; i++)
++ if((elt = (MESSAGECACHE *) (*mc)(stream,i,CH_ELT)) && elt->private.spare.ptr)
++ maildir_free_file ((void **) &elt->private.spare.ptr);
++ stream->silent = T;
++ if (options & CL_EXPUNGE) maildir_expunge (stream, NIL, NIL);
++ maildir_abort(stream);
++ if (mdfpath) fs_give((void **)&mdfpath);
++ if (mypid) mypid = (pid_t) 0;
++ stream->silent = silent;
++ }
++
++ void maildir_check (MAILSTREAM *stream)
++ {
++ if (maildir_ping (stream)) mm_log ("Check completed",(long) NIL);
++ }
++
++ long maildir_text (MAILSTREAM *stream,unsigned long msgno,STRING *bs, long flags)
++ {
++ char tmp[MAILTMPLEN];
++ unsigned long i;
++ MESSAGECACHE *elt;
++ char *s;
++ /* UID call "impossible" */
++ if (flags & FT_UID || !LOCAL) return NIL;
++ elt = mail_elt (stream, msgno);
++
++ if (!(flags & FT_PEEK) && !elt->seen){
++ elt->seen = T;
++ maildir_flagmsg (stream, elt);
++ MM_FLAGS(stream, elt->msgno);
++ }
++
++ MSGPATH(tmp, LOCAL->dir, MDFILE(elt), MDLOC(elt));
++ if (LOCAL->fd < 0) /* if file closed ? */
++ LOCAL->fd = open(tmp,O_RDONLY,NIL);
++
++ if (LOCAL->fd < 0 && (errno == EACCES || errno == ENOENT)){
++ INIT (bs, mail_string, "", 0);
++ elt->rfc822_size = 0L;
++ return NIL;
++ }
++
++ s = maildir_text_work(stream, elt, &i, flags);
++ INIT (bs, mail_string, s, i);
++ return LONGT;
++ }
++
++ char *maildir_text_work (MAILSTREAM *stream,MESSAGECACHE *elt,
++ unsigned long *length,long flags)
++ {
++ FDDATA d;
++ STRING bs;
++ char *s,tmp[CHUNK];
++ unsigned long msgno = elt->msgno;
++ static int try = 0;
++
++ if (length)
++ *length = 0L;
++ LOCAL->buf[0] = '\0';
++
++ MSGPATH(tmp, LOCAL->dir, MDFILE(elt), MDLOC(elt));
++ if (LOCAL->fd < 0) /* if file closed ? */
++ LOCAL->fd = open(tmp,O_RDONLY,NIL);
++
++ if (LOCAL->fd < 0){ /* flag change? */
++ if (try < 5){
++ try++;
++ if (maildir_update_elt_maildirp(stream, msgno) > 0)
++ try = 0;
++ return maildir_text_work(stream, mail_elt(stream, msgno),length, flags);
++ }
++ try = 0;
++ return NULL;
++ }
++
++ lseek (LOCAL->fd, elt->private.msg.text.offset,L_SET);
++
++ if (flags & FT_INTERNAL) { /* initial data OK? */
++ if (elt->private.msg.text.text.size > LOCAL->buflen) {
++ fs_give ((void **) &LOCAL->buf);
++ LOCAL->buf = (char *) fs_get ((LOCAL->buflen =
++ elt->private.msg.text.text.size) + 1);
++ }
++ read (LOCAL->fd,LOCAL->buf,elt->private.msg.text.text.size);
++ LOCAL->buf[*length = elt->private.msg.text.text.size] = '\0';
++ }
++ else {
++ if (elt->rfc822_size > LOCAL->buflen) {
++ fs_give ((void **) &LOCAL->buf);
++ LOCAL->buf = (char *) fs_get ((LOCAL->buflen = elt->rfc822_size) + 1);
++ }
++ d.fd = LOCAL->fd; /* yes, set up file descriptor */
++ d.pos = elt->private.msg.text.offset;
++ d.chunk = tmp; /* initial buffer chunk */
++ d.chunksize = CHUNK;
++ INIT (&bs,fd_string,&d,elt->private.msg.text.text.size);
++ for (s = LOCAL->buf; SIZE (&bs);) switch (CHR (&bs)) {
++ case '\r': /* carriage return seen */
++ *s++ = SNX (&bs); /* copy it and any succeeding LF */
++ if (SIZE (&bs) && (CHR (&bs) == '\n')) *s++ = SNX (&bs);
++ break;
++ case '\n':
++ *s++ = '\r'; /* insert a CR */
++ default:
++ *s++ = SNX (&bs); /* copy characters */
++ }
++ *s = '\0'; /* tie off buffer */
++ *length = s - (char *) LOCAL->buf; /* calculate length */
++ }
++ close(LOCAL->fd); LOCAL->fd = -1;
++ return LOCAL->buf;
++ }
++
++ /* maildir parse, fill the elt structure... well not all of it... */
++ unsigned long maildir_parse_message(MAILSTREAM *stream, unsigned long msgno,
++ DirNamesType dirtype)
++ {
++ char *b, *s, *t, c;
++ char tmp[MAILTMPLEN];
++ struct stat sbuf;
++ unsigned long i, len;
++ int d, f, r, se, dt;
++ MESSAGECACHE *elt;
++
++ elt = mail_elt (stream,msgno);
++ MSGPATH(tmp, LOCAL->dir, MDFILE(elt), dirtype);
++ if(stat(tmp, &sbuf) == 0)
++ MDSIZE(elt) = sbuf.st_size;
++
++ maildir_get_date(stream, msgno);
++ maildir_getflag(MDFILE(elt), &d, &f, &r ,&se, &dt);
++ elt->draft = d; elt->flagged = f; elt->answered = r; elt->seen = se;
++ elt->deleted = dt; elt->valid = T;
++ if (LOCAL->fd < 0) /* if file closed ? */
++ LOCAL->fd = open(tmp,O_RDONLY,NIL);
++
++ if (LOCAL->fd >= 0){
++ s = (char *) fs_get (MDSIZE(elt) + 1);
++ read (LOCAL->fd,s,MDSIZE(elt));
++ s[MDSIZE(elt)] = '\0';
++ t = s + strlen(s); /* make t point to the end of s */
++ for (i = 0L, b = s; b < t && !(i && (*b == '\n')); i = (*b++ == '\n'));
++ len = (*b ? ++b : b) - s;
++ elt->private.msg.header.text.size =
++ elt->private.msg.text.offset = len;
++ elt->private.msg.text.text.size = MDSIZE(elt) - len;
++ for (i = 0L, b = s, c = *b; b &&
++ ((c < '\016' && ((c == '\012' && ++i)
++ ||(c == '\015' && *(b+1) == '\012' && ++b && (i +=2))))
++ || b < t); i++, c= *++b);
++ elt->rfc822_size = i;
++ fs_give ((void **) &s);
++ close(LOCAL->fd); LOCAL->fd = -1;
++ }
++ return elt->rfc822_size;
++ }
++
++ int
++ maildir_update_elt_maildirp(MAILSTREAM *stream, unsigned long msgno)
++ {
++ char tmp[MAILTMPLEN];
++ struct direct **names = NIL;
++ unsigned long i, nfiles, pos;
++ int d = 0, f = 0 , r = 0, s = 0, t = 0, in_list, scan_err;
++ MESSAGECACHE *elt;
++
++ MDFLD(tmp, LOCAL->dir, Cur);
++
++ maildir_scandir (tmp, &names, &nfiles, &scan_err, CCLIENT);
++
++ elt = mail_elt (stream,msgno);
++
++ in_list = nfiles > 0L
++ ? maildir_message_in_list(MDFILE(elt), names, 0L, nfiles - 1L, &pos)
++ : NIL;
++
++ if (in_list && pos >= 0L && pos < nfiles
++ && !strcmp(MDFILE(elt), names[pos]->d_name)){
++ in_list = NIL;
++ maildir_abort(stream);
++ }
++
++ if (in_list && pos >= 0L && pos < nfiles){
++ maildir_free_file_only((void **)&elt->private.spare.ptr);
++ MDFILE(elt) = cpystr(names[pos]->d_name);
++ maildir_getflag(MDFILE(elt), &d, &f, &r ,&s, &t);
++ if (elt->draft != d || elt->flagged != f ||
++ elt->answered != r || elt->seen != s || elt->deleted != t){
++ elt->draft = d; elt->flagged = f; elt->answered = r;
++ elt->seen = s; elt->deleted = t;
++ MM_FLAGS(stream, msgno);
++ }
++ }
++ for (i = 0L; i < nfiles; i++)
++ fs_give((void **) &names[i]);
++ if (names)
++ fs_give((void **) &names);
++ return in_list ? 1 : -1;
++ }
++
++ /* Maildir fetch message header */
++
++ char *maildir_header (MAILSTREAM *stream,unsigned long msgno,
++ unsigned long *length, long flags)
++ {
++ char tmp[MAILTMPLEN], *s;
++ MESSAGECACHE *elt;
++ static int try = 0;
++
++ if (length) *length = 0;
++ if (flags & FT_UID || !LOCAL) return ""; /* UID call "impossible" */
++ elt = mail_elt (stream,msgno);
++ if(elt->private.msg.header.text.size == 0)
++ maildir_parse_message(stream, msgno, MDLOC(elt));
++
++ MSGPATH(tmp, LOCAL->dir, MDFILE(elt), MDLOC(elt));
++ if (LOCAL->fd < 0)
++ LOCAL->fd = open (tmp,O_RDONLY,NIL);
++
++ if (LOCAL->fd < 0 && errno == EACCES){
++ mm_log ("Message exists but can not be read. Envelope and body lost!",ERROR);
++ return NULL;
++ }
++
++ if (LOCAL->fd < 0){ /* flag change? */
++ if (try < 5){
++ try++;
++ if (maildir_update_elt_maildirp(stream, msgno) > 0)
++ try = 0;
++ return maildir_header(stream, msgno, length, flags);
++ }
++ try = 0;
++ return NULL;
++ }
++
++ if (flags & FT_INTERNAL){
++ if(elt->private.msg.header.text.size > LOCAL->buflen){
++ fs_give ((void **) &LOCAL->buf);
++ LOCAL->buf = (char *) fs_get ((LOCAL->buflen =
++ elt->private.msg.header.text.size) + 1);
++ }
++ read (LOCAL->fd, (void *)LOCAL->buf, elt->private.msg.header.text.size);
++ LOCAL->buf[*length = elt->private.msg.header.text.size] = '\0';
++ }
++ else{
++ s = (char *) fs_get(elt->private.msg.header.text.size+1);
++ read (LOCAL->fd, (void *)s, elt->private.msg.header.text.size);
++ s[elt->private.msg.header.text.size] = '\0';
++ *length = strcrlfcpy (&LOCAL->buf,&LOCAL->buflen,s,
++ elt->private.msg.header.text.size);
++ fs_give ((void **) &s);
++ }
++ elt->private.msg.text.offset = elt->private.msg.header.text.size;
++ elt->private.msg.text.text.size = MDSIZE(elt) - elt->private.msg.text.offset;
++ close(LOCAL->fd); LOCAL->fd = -1;
++ return LOCAL->buf;
++ }
++
++ /* Maildir find list of subscribed mailboxes
++ * Accepts: mail stream
++ * pattern to search
++ */
++
++ void maildir_list (MAILSTREAM *stream,char *ref, char *pat)
++ {
++ char *s,test[MAILTMPLEN],file[MAILTMPLEN];
++ long i = 0L;
++
++ if((!pat || !*pat) && maildir_canonicalize (test,ref,"*")
++ && maildir_valid_name(test)){ /* there is a #md/ leading here */
++ for (i = 3L; test[i] && test[i] != '/'; i++);
++ if ((s = strchr (test+i+1,'/')) != NULL) *++s = '\0';
++ else test[0] = '\0';
++ mm_list (stream,'/',test, LATT_NOSELECT);
++ }
++ else if (maildir_canonicalize (test,ref,pat)) {
++ if (test[3] == '/') { /* looking down levels? */
++ /* yes, found any wildcards? */
++ if ((s = strpbrk (test,"%*")) != NULL){
++ /* yes, copy name up to that point */
++ strncpy (file,test+4,i = s - (test+4));
++ file[i] = '\0'; /* tie off */
++ }
++ else strcpy (file,test+4);/* use just that name then */
++ /* find directory name */
++ if ((s = strrchr (file, '/')) != NULL){
++ *s = '\0'; /* found, tie off at that point */
++ s = file;
++ }
++ /* do the work */
++ if(IS_COURIER(test))
++ courier_list_work (stream,s,test,0);
++ else
++ maildir_list_work (stream,s,test,0);
++ }
++ /* always an INBOX */
++ if (!compare_cstring (test,"#MD/INBOX"))
++ mm_list (stream,NIL,"#MD/INBOX",LATT_NOINFERIORS);
++ if (!compare_cstring (test,"#MC/INBOX"))
++ mm_list (stream,NIL,"#MC/INBOX",LATT_NOINFERIORS);
++ }
++ }
++
++ void courier_list (MAILSTREAM *stream,char *ref, char *pat)
++ {
++ /* I am too lazy to do anything. Do you care to ask maildir list, please?
++ The real reason why this is a dummy function is because we do not want to
++ see the same folder listed twice.
++ */
++ }
++
++ /* For those that want to hide things, we give them a chance to do so */
++ void *maildir_parameters (long function, void *value)
++ {
++ void *ret = NIL;
++ switch ((int) function) {
++ case SET_MDINBOXPATH:
++ if(strlen((char *) value ) > 49)
++ strcpy(myMdInboxDir, "Maildir");
++ else
++ strcpy(myMdInboxDir, (char *) value);
++ case GET_MDINBOXPATH:
++ if (myMdInboxDir[0] == '\0') strcpy(myMdInboxDir,"Maildir");
++ ret = (void *) myMdInboxDir;
++ break;
++ case SET_COURIERSTYLE:
++ CourierStyle = (long) value;
++ case GET_COURIERSTYLE:
++ ret = (void *) CourierStyle;
++ break;
++ case GET_DIRFMTTEST:
++ ret = (void *) maildir_dirfmttest;
++ break;
++ default:
++ break;
++ }
++ return ret;
++ }
++
++ int maildir_create_folder(char *mailbox)
++ {
++ char tmp[MAILTMPLEN], err[MAILTMPLEN];
++ int i;
++
++ for (i = Cur; i != EndDir; i++){
++ MDFLD(tmp, mailbox, i);
++ if (mkdir(tmp, 0700) && errno != EEXIST){ /* try to make new dir */
++ sprintf (err, "Can't create %s: %s", tmp, strerror(errno));
++ mm_log (err,ERROR);
++ return NIL;
++ }
++ }
++ return T;
++ }
++
++ int maildir_create_work(char *mailbox, int loop)
++ {
++ char *s, c, err[MAILTMPLEN], tmp[MAILTMPLEN], tmp2[MAILTMPLEN], mbx[MAILTMPLEN];
++ int fnlen, create_dir = 0, courier, mv;
++ struct stat sbuf;
++ long style = (long) maildir_parameters(GET_COURIERSTYLE, NIL);
++
++ courier = IS_COURIER(mailbox);
++ strcpy(mbx, mailbox);
++ mv = maildir_valid(mbx) ? 1 : 0;
++ maildir_file_path(mailbox, tmp);
++ if (mailbox[strlen(mailbox) - 1] == MDSEPARATOR(courier)){
++ create_dir++;
++ mailbox[strlen(mailbox) - 1] = '\0';
++ }
++
++ if(!loop && courier){
++ if(mv){
++ if(create_dir){
++ if(style == CCLIENT)
++ strcpy (err,"Can not create directory: folder exists. Create subfolder");
++ else
++ strcpy(err,"Folder and Directory already exist");
++ }
++ else
++ strcpy (err, "Can't create mailbox: mailbox already exists");
++ }
++ else{
++ if(create_dir)
++ strcpy(err, "Can not create directory. Cread folder instead");
++ else
++ err[0] = '\0';
++ }
++ if(err[0]){
++ mm_log (err,ERROR);
++ return NIL;
++ }
++ }
++
++ fnlen = strlen(tmp);
++ if ((s = strrchr(mailbox,MDSEPARATOR(courier))) != NULL){
++ c = *++s;
++ *s = '\0';
++ if ((stat(tmp,&sbuf) || ((sbuf.st_mode & S_IFMT) != S_IFDIR)) &&
++ !maildir_create_work (mailbox, ++loop))
++ return NIL;
++ *s = c;
++ }
++ tmp[fnlen] = '\0';
++
++ if (mkdir(tmp,0700) && errno != EEXIST)
++ return NIL;
++
++ if (create_dir)
++ mailbox[fnlen] = '/';
++
++ if (create_dir){
++ if(style == CCLIENT){
++ if(!courier){
++ FILE *fp = NULL;
++ sprintf(tmp2,"%s%s", tmp, MDDIR);
++ if ((fp = fopen(tmp2,"w")) == NULL){
++ sprintf (err,"Problem creating %s: %s", tmp2, strerror(errno));
++ mm_log (err,ERROR);
++ return NIL;
++ }
++ fclose(fp);
++ }
++ }
++ return T;
++ }
++ else
++ return maildir_create_folder(tmp);
++ }
++
++ long maildir_create (MAILSTREAM *stream,char *mailbox)
++ {
++ char tmp[MAILTMPLEN], err[MAILTMPLEN];
++ int rv, create_dir;
++
++ create_dir = mailbox ?
++ (mailbox[strlen(mailbox) - 1] ==
++ MDSEPARATOR(IS_COURIER(mailbox))) : 0;
++ maildir_file_path(mailbox, tmp);
++ strcpy(tmp, mailbox);
++ rv = maildir_create_work(mailbox, 0);
++ strcpy(mailbox, tmp);
++ if (rv == 0){
++ sprintf (err,"Can't create %s %s",
++ (create_dir ? "directory" : "mailbox"), mailbox);
++ mm_log (err,ERROR);
++ }
++ return rv ? LONGT : NIL;
++ }
++
++ #define MAXTRY 10000
++ void maildir_flagmsg (MAILSTREAM *stream,MESSAGECACHE *elt)
++ {
++ char oldfile[MAILTMPLEN],newfile[MAILTMPLEN],fn[MAILTMPLEN];
++ char *s;
++ int ren, try = 0;
++
++ if (elt->valid){
++ for (try = 1; try > 0 && try < MAXTRY; try++){
++ /* build the new filename */
++ sprintf (oldfile,"%s/%s",LOCAL->curdir, MDFILE(elt));
++ fn[0] = '\0';
++ if ((ren = maildir_message_exists(stream, MDFILE(elt), fn)) == 0){
++ errno = ENOENT;
++ try = MAXTRY;
++ }
++ if (*fn) /* new oldfile! */
++ sprintf (oldfile,"%s/%s",LOCAL->curdir,fn);
++ if ((s = strrchr (MDFILE(elt), FLAGSEP))) *s = '\0';
++ sprintf (fn,"%s%s%s%s%s%s%s", MDFILE(elt), MDSEP(2),
++ MDFLAG(Draft, elt->draft), MDFLAG(Flagged, elt->flagged),
++ MDFLAG(Replied, elt->answered), MDFLAG(Seen, elt->seen),
++ MDFLAG(Trashed, elt->deleted));
++ sprintf (newfile,"%s/%s",LOCAL->curdir,fn);
++ if (ren != 0 && rename (oldfile,newfile) >= 0)
++ try = -1;
++ }
++
++ if (try > 0){
++ sprintf(oldfile,"Unable to write flags to disk: %s",
++ (errno == ENOENT) ? "message is gone!" : strerror (errno));
++ mm_log(oldfile,ERROR);
++ return;
++ }
++ #ifdef __CYGWIN__
++ utime(LOCAL->curdir, NIL); /* make sure next scan will catch the change */
++ #endif
++ maildir_free_file_only ((void **) &elt->private.spare.ptr);
++ MDFILE(elt) = cpystr (fn);
++ }
++ }
++
++ long maildir_expunge (MAILSTREAM *stream, char *sequence, long options)
++ {
++ long ret;
++ MESSAGECACHE *elt;
++ unsigned long i, n = 0L;
++ unsigned long recent = stream->recent;
++ char tmp[MAILTMPLEN];
++
++ mm_critical (stream); /* go critical */
++ ret = sequence ? ((options & EX_UID) ?
++ mail_uid_sequence (stream,sequence) :
++ mail_sequence (stream,sequence)) : LONGT;
++ if(ret == 0L)
++ return 0L;
++ for (i = 1L; i <= stream->nmsgs;){
++ elt = mail_elt (stream,i);
++ if (elt->deleted && (sequence ? elt->sequence : T)){
++ sprintf (tmp,"%s/%s",LOCAL->curdir, MDFILE(elt));
++ if (unlink (tmp) < 0) {/* try to delete the message */
++ sprintf (tmp,"Expunge of message %ld failed, aborted: %s",i,
++ strerror (errno));
++ if (!stream->silent)
++ mm_log (tmp,WARN);
++ break;
++ }
++ if (elt->private.spare.ptr)
++ maildir_free_file ((void **) &elt->private.spare.ptr);
++ if (elt->recent) --recent;/* if recent, note one less recent message */
++ mail_expunged (stream,i); /* notify upper levels */
++ n++; /* count up one more expunged message */
++ }
++ else i++;
++ }
++ if(n){ /* output the news if any expunged */
++ sprintf (tmp,"Expunged %ld messages",n);
++ if (!stream->silent)
++ mm_log (tmp,(long) NIL);
++ }
++ else
++ if (!stream->silent)
++ mm_log ("No messages deleted, so no update needed",(long) NIL);
++ mm_nocritical (stream); /* release critical */
++ /* notify upper level of new mailbox size */
++ mail_exists (stream,stream->nmsgs);
++ mail_recent (stream,recent);
++ return ret;
++ }
++
++ long maildir_copy (MAILSTREAM *stream,char *sequence,char *mailbox,long options)
++ {
++ STRING st;
++ MESSAGECACHE *elt;
++ unsigned long len;
++ int fd;
++ unsigned long i;
++ struct stat sbuf;
++ char tmp[MAILTMPLEN], flags[MAILTMPLEN], path[MAILTMPLEN], *s;
++ /* copy the messages */
++ if ((options & CP_UID) ? mail_uid_sequence (stream, sequence) :
++ mail_sequence (stream,sequence))
++ for (i = 1L; i <= stream->nmsgs; i++)
++ if ((elt = mail_elt (stream,i))->sequence){
++ MSGPATH(path, LOCAL->dir, MDFILE(elt), MDLOC(elt));
++ if (((fd = open (path,O_RDONLY,NIL)) < 0)
++ ||((!elt->rfc822_size &&
++ ((stat(path, &sbuf) < 0) || !S_ISREG (sbuf.st_mode)))))
++ return NIL;
++ if(!elt->rfc822_size)
++ MDSIZE(elt) = sbuf.st_size;
++ s = (char *) fs_get(MDSIZE(elt) + 1);
++ read (fd,s,MDSIZE(elt));
++ s[MDSIZE(elt)] = '\0';
++ close (fd);
++ len = strcrlfcpy (&LOCAL->buf,&LOCAL->buflen, s, MDSIZE(elt));
++ INIT (&st,mail_string, LOCAL->buf, len);
++ elt->rfc822_size = len;
++ fs_give ((void **)&s);
++
++ flags[0] = flags[1] = '\0';
++ if (elt->seen) strcat (flags," \\Seen");
++ if (elt->draft) strcat (flags," \\Draft");
++ if (elt->deleted) strcat (flags," \\Deleted");
++ if (elt->flagged) strcat (flags," \\Flagged");
++ if (elt->answered) strcat (flags," \\Answered");
++ flags[0] = '('; /* open list */
++ strcat (flags,")"); /* close list */
++ mail_date (tmp,elt); /* generate internal date */
++ if (!mail_append_full (NIL,mailbox,flags,tmp,&st))
++ return NIL;
++ if (options & CP_MOVE) elt->deleted = T;
++ }
++ return LONGT; /* return success */
++ }
++
++ long maildir_append (MAILSTREAM *stream,char *mailbox,append_t af,void *data)
++ {
++ int fd, k;
++ STRING *message;
++ char c,*s, *flags, *date;
++ char tmp[MAILTMPLEN],file[MAILTMPLEN],path1[MAILTMPLEN],path2[MAILTMPLEN];
++ MESSAGECACHE elt;
++ long i, size = 0L, ret = LONGT, f;
++ unsigned long uf, ti;
++ static unsigned int transact = 0;
++
++ if (!maildir_valid(mailbox)) {
++ sprintf (tmp,"Not a valid Maildir mailbox: %s",mailbox);
++ mm_log (tmp,ERROR);
++ return NIL;
++ }
++
++ if (!*mdlocaldomain)
++ md_domain_name(); /* get domain name for maildir files in mdlocaldomain now! */
++
++ if (mypid == (pid_t) 0)
++ mypid = getpid();
++
++ if (!stream){
++ stream = &maildirproto;
++
++ for (k = 0; k < NUSERFLAGS && stream->user_flags[k]; ++k)
++ fs_give ((void **) &stream->user_flags[k]);
++ }
++
++ if (!(*af) (stream,data,&flags,&date,&message)) return NIL;
++
++ mm_critical (stream); /* go critical */
++ /* call time(0) only once, use transact to distinguish instead */
++ ti = time(0);
++ do {
++ if (!SIZE (message)) { /* guard against zero-length */
++ mm_log ("Append of zero-length message",ERROR);
++ ret = NIL;
++ break;
++ }
++ if (date && !mail_parse_date(&elt,date)){
++ sprintf (tmp,"Bad date in append: %.80s",date);
++ mm_log (tmp,ERROR);
++ ret = NIL;
++ break;
++ }
++ f = mail_parse_flags (stream,flags,&uf);
++ /* build file name we will use */
++ sprintf (file,"%lu.%d_%09u.%s%s%s%s%s%s",
++ ti, mypid, transact++, mdlocaldomain, (f ? MDSEP(2) : ""),
++ MDFLAG(Draft, f&fDRAFT), MDFLAG(Flagged, f&fFLAGGED),
++ MDFLAG(Replied, f&fANSWERED), MDFLAG(Seen, f&fSEEN));
++ /* build tmp file name */
++ if (maildir_file_path(mailbox, tmp))
++ MSGPATH(path1, tmp, file, Tmp);
++
++ if ((fd = open (path1,O_WRONLY|O_CREAT|O_EXCL,S_IREAD|S_IWRITE)) < 0) {
++ sprintf (tmp, "Can't open append mailbox: %s", strerror (errno));
++ mm_log (tmp, ERROR);
++ return NIL;
++ }
++ for (size = 0,i = SIZE (message),s = (char *) fs_get (i + 1); i; --i)
++ if ((c = SNX (message)) != '\015') s[size++] = c;
++ if ((write (fd, s, size) < 0) || fsync (fd)) {
++ unlink (path1); /* delete message */
++ sprintf (tmp, "Message append failed: %s", strerror (errno));
++ mm_log (tmp, ERROR);
++ ret = NIL;
++ }
++ fs_give ((void **) &s); /* flush the buffer */
++ close (fd); /* close the file */
++ /* build final filename to use */
++ if (maildir_file_path(mailbox, tmp))
++ MSGPATH(path2, tmp, file, New);
++ if (rename (path1,path2) < 0) {
++ sprintf (tmp, "Message append failed: %s", strerror (errno));
++ mm_log (tmp, ERROR);
++ ret = NIL;
++ }
++ unlink (path1);
++
++ if (ret)
++ if (!(*af) (stream,data,&flags,&date,&message)) ret = NIL;
++
++ } while (ret && message); /* write the data */
++ mm_nocritical (stream); /* release critical */
++ return ret;
++ }
++
++ long maildir_delete (MAILSTREAM *stream,char *mailbox)
++ {
++ DIR *dirp;
++ struct direct *d;
++ int i, remove_dir = 0, mddir = 0, rv, error = 0;
++ char tmp[MAILTMPLEN],tmp2[MAILTMPLEN], realname[MAILTMPLEN];
++ struct stat sbuf;
++ int courier = IS_COURIER(mailbox);
++
++ if (mailbox[strlen(mailbox) - 1] == MDSEPARATOR(courier)){
++ remove_dir++;
++ mailbox[strlen(mailbox) -1] = '\0';
++ }
++
++ if (!maildir_valid(mailbox)){
++ maildir_file_path(mailbox, tmp);
++ if (stat(tmp, &sbuf) < 0 || !S_ISDIR(sbuf.st_mode)){
++ sprintf(tmp,"Can not remove %s", mailbox);
++ error++;
++ }
++ }
++
++ if (!error && remove_dir && !maildir_dir_is_empty(mailbox)){
++ sprintf(tmp,"Can not remove directory %s/: directory not empty", mailbox);
++ error++;
++ }
++
++ if(error){
++ mm_log (tmp,ERROR);
++ return NIL;
++ }
++
++ maildir_close(stream,0); /* even if stream was NULL */
++
++ maildir_file_path(mailbox, realname);
++
++ if (remove_dir){
++ sprintf(tmp,"%s/%s", realname, MDDIR);
++ if ((rv = stat (tmp,&sbuf)) == 0 && S_ISREG(sbuf.st_mode))
++ rv = unlink(tmp);
++ else if (errno == ENOENT)
++ rv = 0;
++ if (rv != 0){
++ sprintf(tmp,"Can not remove %s/%s: %s", tmp2, MDDIR, strerror(errno));
++ mm_log (tmp,ERROR);
++ return NIL;
++ }
++ if (!maildir_valid(realname) && rmdir(realname) != 0){
++ sprintf(tmp,"Can not remove %s/: %s", mailbox, strerror(errno));
++ mm_log (tmp,ERROR);
++ return NIL;
++ }
++ return LONGT;
++ }
++ /* else remove just the folder. Remove all hidden files, except MDDIR */
++ for (i = Cur; i != EndDir; i++){
++ MDFLD(tmp, realname, i);
++
++ if (!(dirp = opendir (tmp))){
++ sprintf(tmp,"Can not read %s/: %s", mailbox, strerror(errno));
++ mm_log (tmp,ERROR);
++ return NIL;
++ }
++
++ while ((d = readdir(dirp)) != NULL){
++ if (strcmp(d->d_name, ".") && strcmp(d->d_name,"..")){
++ sprintf(tmp2,"%s/%s", tmp, d->d_name);
++ if (unlink(tmp2) != 0){
++ sprintf(tmp2,"Can not remove %s: %s", mailbox, strerror(errno));
++ mm_log (tmp2,ERROR);
++ return NIL;
++ }
++ }
++ }
++ closedir(dirp);
++ if (rmdir(tmp) != 0){
++ sprintf(tmp,"Can not remove %s: %s", mailbox, strerror(errno));
++ mm_log (tmp,ERROR);
++ return NIL;
++ }
++ }
++ /*
++ * ok we have removed all subdirectories of the folder mailbox, Remove the
++ * hidden files.
++ */
++
++ if(!(dirp = opendir (realname))){
++ sprintf(tmp,"Can not read %s/: %s", realname, strerror(errno));
++ mm_log (tmp,ERROR);
++ return NIL;
++ }
++
++ while ((d = readdir(dirp)) != NULL){
++ if (strcmp(d->d_name, ".") && strcmp(d->d_name,"..")
++ && (!strcmp(d->d_name, MDDIR)
++ || !strncmp(d->d_name, MDUIDLAST, strlen(MDUIDLAST))
++ || !strncmp(d->d_name, MDUIDTEMP, strlen(MDUIDTEMP)))){
++ if(strcmp(d->d_name, MDDIR) == 0)
++ mddir++;
++ sprintf(tmp,"%s/%s", realname, d->d_name);
++ if (unlink(tmp) != 0)
++ error++;
++ }
++ }
++ closedir(dirp);
++ if (error ||
++ (maildir_dir_is_empty(mailbox) && mddir == 0 && rmdir(realname) < 0)){
++ sprintf(tmp,"Can not remove folder %s: %s", mailbox, strerror(errno));
++ mm_log (tmp,ERROR);
++ return NIL;
++ }
++ return LONGT;
++ }
++
++ long maildir_rename (MAILSTREAM *stream, char *old, char *new)
++ {
++ char tmp[MAILTMPLEN],tmpnew[MAILTMPLEN], realold[MAILTMPLEN];
++ char realnew[MAILTMPLEN];
++ int courier = IS_COURIER(old) && IS_COURIER(new);
++ int i;
++ long rv = LONGT;
++ COURIER_S *cdir;
++
++ if((IS_COURIER(old) || IS_COURIER(new)) && !courier){
++ sprintf (tmp,"Can't rename mailbox %s to %s",old, new);
++ mm_log (tmp,ERROR);
++ return NIL;
++ }
++
++ if (!maildir_valid(old)){
++ sprintf (tmp,"Can't rename mailbox %s: folder not in maildir format",old);
++ mm_log (tmp,ERROR);
++ return NIL;
++ }
++ maildir_file_path(old, realold);
++ if (!maildir_valid_name(new) && new[0] == '#'){
++ sprintf (tmp,"Can't rename mailbox %s: folder not in maildir format",new);
++ mm_log (tmp,ERROR);
++ return NIL;
++ }
++ maildir_file_path(new, realnew);
++ if (access(tmpnew,F_OK) == 0){ /* new mailbox name must not exist */
++ sprintf (tmp,"Can't rename to mailbox %s: destination already exists",new);
++ mm_log (tmp,ERROR);
++ return NIL;
++ }
++
++ if(!courier){
++ if (rename (realold,realnew)){ /* try to rename the directory */
++ sprintf (tmp,"Can't rename mailbox %s to %s: %s",old, new,
++ strerror(errno));
++ mm_log (tmp,ERROR);
++ return NIL;
++ }
++ return LONGT; /* return success */
++ }
++
++ cdir = courier_list_dir(old);
++ for (i = 0; cdir && i < cdir->total; i++){
++ if(strstr(cdir->data[i]->name, old)){
++ sprintf(tmp,"%s%s", new, cdir->data[i]->name+strlen(old));
++ maildir_file_path(cdir->data[i]->name, realold);
++ maildir_file_path(tmp, realnew);
++ if (rename (realold,realnew)){
++ sprintf (tmp,"Can't rename mailbox %s to %s: %s",old, new,
++ strerror(errno));
++ mm_log (tmp,ERROR);
++ rv = NIL;
++ }
++ }
++ }
++ courier_free_cdir(&cdir);
++ return rv;
++ }
++
++ long maildir_sub (MAILSTREAM *stream,char *mailbox)
++ {
++ return sm_subscribe (mailbox);
++ }
++
++ long maildir_unsub (MAILSTREAM *stream,char *mailbox)
++ {
++ return sm_unsubscribe (mailbox);
++ }
++
++ void maildir_lsub (MAILSTREAM *stream,char *ref,char *pat)
++ {
++ void *sdb = NIL;
++ char *s, test[MAILTMPLEN];
++ /* get canonical form of name */
++ if (maildir_canonicalize (test,ref,pat) && (s = sm_read (&sdb))) {
++ do if (pmatch_full (s,test,'/')) mm_lsub (stream,'/',s,NIL);
++ while ((s = sm_read (&sdb)) != NULL); /* until no more subscriptions */
++ }
++ }
++
++ long maildir_canonicalize (char *pattern,char *ref,char *pat)
++ {
++ if (ref && *ref) { /* have a reference */
++ strcpy (pattern,ref); /* copy reference to pattern */
++ /* # overrides mailbox field in reference */
++ if (*pat == '#') strcpy (pattern,pat);
++ /* pattern starts, reference ends, with / */
++ else if ((*pat == '/') && (pattern[strlen (pattern) - 1] == '/'))
++ strcat (pattern,pat + 1); /* append, omitting one of the period */
++
++ else strcat (pattern,pat); /* anything else is just appended */
++ }
++ else strcpy (pattern,pat); /* just have basic name */
++ return maildir_valid_name(pattern) ? LONGT : NIL;
++ }
++
++ void maildir_list_work (MAILSTREAM *stream,char *dir,char *pat,long level)
++ {
++ DIR *dp;
++ struct direct *d;
++ struct stat sbuf;
++ char curdir[MAILTMPLEN],name[MAILTMPLEN], tmp[MAILTMPLEN];
++ char realpat[MAILTMPLEN];
++ long i;
++ char *maildirpath = mdirpath();
++
++ sprintf(curdir,"%s/%s/", myrootdir(pat), dir ? dir : maildirpath);
++ if ((dp = opendir (curdir)) != NULL){
++ if (dir) sprintf (name,"%s%s/",MDPREFIX(CCLIENT),dir);
++ else strcpy (name, pat);
++
++ if (level == 0 && !strpbrk(pat,"%*")){
++ if(maildir_valid(pat)){
++ i = maildir_contains_folder(pat, NULL)
++ ? LATT_HASCHILDREN
++ : (maildir_is_dir(pat, NULL)
++ ? LATT_HASNOCHILDREN : LATT_NOINFERIORS);
++ maildir_file_path(pat, realpat);
++ i += maildir_any_new_msgs(realpat)
++ ? LATT_MARKED : LATT_UNMARKED;
++ mm_list (stream,'/', pat, i);
++ }
++ else
++ if(pat[strlen(pat) - 1] == '/')
++ mm_list (stream,'/', pat, LATT_NOSELECT);
++ }
++
++ while ((d = readdir (dp)) != NULL)
++ if(strcmp(d->d_name, ".") && strcmp(d->d_name,"..")
++ && strcmp(d->d_name, MDNAME(Cur))
++ && strcmp(d->d_name, MDNAME(Tmp))
++ && strcmp(d->d_name, MDNAME(New))){
++
++ if (dir) sprintf (tmp,"%s%s", name,d->d_name);
++ else strcpy(tmp, d->d_name);
++
++ if(pmatch_full (tmp, pat,'/')){
++ sprintf(tmp,"%s/%s/%s", myrootdir(d->d_name),
++ (dir ? dir : maildirpath), d->d_name);
++ if(stat (tmp,&sbuf) == 0
++ && ((sbuf.st_mode & S_IFMT) == S_IFDIR)){
++ if (dir) sprintf (tmp,"%s%s", name,d->d_name);
++ else strcpy(tmp, d->d_name);
++ i = maildir_valid(tmp)
++ ? (maildir_contains_folder(dir, d->d_name)
++ ? LATT_HASCHILDREN
++ : (maildir_is_dir(dir, d->d_name)
++ ? LATT_HASNOCHILDREN : LATT_NOINFERIORS))
++ : LATT_NOSELECT;
++ i += maildir_any_new_msgs(tmp)
++ ? LATT_MARKED : LATT_UNMARKED;
++ mm_list (stream,'/',tmp, i);
++ strcat (tmp, "/");
++ if(dmatch (tmp, pat,'/') &&
++ (level < (long) mail_parameters (NIL,GET_LISTMAXLEVEL,NIL))){
++ sprintf(tmp,"%s/%s",dir,d->d_name);
++ maildir_list_work (stream,tmp,pat,level+1);
++ }
++ }
++ }
++ }
++ closedir (dp);
++ }
++ }
++
++ void courier_list_work (MAILSTREAM *stream, char *dir, char *pat, long level)
++ {
++ char c, curdir[MAILTMPLEN], tmp[MAILTMPLEN];
++ char realname[MAILTMPLEN], realpat[MAILTMPLEN] = {'\0'};
++ int i, found;
++ long style = (long) maildir_parameters(GET_COURIERSTYLE, NIL), j;
++ char *maildirpath = mdirpath();
++ COURIER_S *cdir;
++
++ if(!strpbrk(pat,"%*")){ /* a mailbox */
++ maildir_file_path(pat, curdir);
++ i = strlen(curdir) - 1;
++ if(curdir[i] == '/')
++ curdir[i] = '\0';
++ cdir = courier_list_dir(curdir);
++ if(cdir){
++ found = 0; j = 0L;
++ if(maildir_valid_name(pat)){
++ for(i = 0; !found && i < cdir->total; i++)
++ if(strstr(curdir, cdir->data[i]->name)){
++ if(strlen(curdir) < strlen(cdir->data[i]->name))
++ found += 2;
++ else if(strlen(curdir) == strlen(cdir->data[i]->name))
++ found -= 1;
++ }
++ if(found > 0)
++ j = LATT_HASCHILDREN;
++ else if(found == 0)
++ j = (style == COURIER) ? LATT_HASNOCHILDREN : LATT_NOINFERIORS;
++ }
++ else
++ j = LATT_NOSELECT;
++ j += maildir_any_new_msgs(curdir) ? LATT_MARKED : LATT_UNMARKED;
++ if (found)
++ mm_list (stream, '.', pat, j);
++ courier_free_cdir(&cdir);
++ }
++ return;
++ }
++
++ strcpy(tmp,pat + 4); /* a directory */
++ j = strlen(pat) - 1;
++ maildir_file_path(pat, realpat);
++ c = pat[j];
++ pat[j] = '\0';
++ realname[0] = '\0';
++ if(dir)
++ maildir_file_path(dir, realname);
++ sprintf(curdir,"%s%s%s/%s", (dir ? "" : myrootdir(pat)), (dir ? "" : "/"),
++ (dir ? realname : maildirpath), (dir ? "" : "."));
++ sprintf(tmp, "%s%s/.", MDPREFIX(COURIER), dir ? dir : maildirpath);
++ if (level == 0 && tmp && pmatch_full (tmp, realpat, '.'))
++ mm_list (stream,'.', tmp, LATT_NOSELECT);
++
++ cdir = courier_list_dir(pat);
++ pat[j] = c;
++ for (i = 0; cdir && i < cdir->total; i++)
++ if(pmatch_full (cdir->data[i]->name, pat, '.')){
++ sprintf(tmp, "%s.", cdir->data[i]->name);
++ courier_list_info(&cdir, tmp, i);
++ mm_list (stream,'.',cdir->data[i]->name, cdir->data[i]->attribute);
++ }
++ courier_free_cdir(&cdir);
++ }
++
++ int
++ same_maildir_file(char *name1, char *name2)
++ {
++ char tmp1[MAILTMPLEN], tmp2[MAILTMPLEN];
++ char *s;
++
++ strcpy(tmp1, name1 ? name1 : "");
++ strcpy(tmp2, name2 ? name2 : "");
++ if ((s = strrchr(tmp1, FLAGSEP)) != NULL)
++ *s = '\0';
++ if (((s = strrchr(tmp1, SIZESEP)) != NULL) && (strchr(s,'.') == NULL))
++ *s = '\0';
++ if ((s = strrchr(tmp2, FLAGSEP)) != NULL)
++ *s = '\0';
++ if (((s = strrchr(tmp2, SIZESEP)) != NULL) && (strchr(s,'.') == NULL))
++ *s = '\0';
++
++ return !strcmp(tmp1, tmp2);
++ }
++
++ unsigned long antoul(char *seed)
++ {
++ int i, error = 0;
++ unsigned long val = 0L, rv1 = 0L, t;
++ char c, *p;
++ if(!seed)
++ return 0L;
++ t = strtoul(seed, &p, 10);
++ if(p && (*p == '.' || *p == '_'))
++ return t;
++ /* else */
++ if((p = strchr(seed,'.')) != NULL)
++ *p = '\0';
++ error = (strlen(seed) > 6); /* too long */
++ for(i= strlen(seed)-1; error == 0 && i >= 0; i--){
++ c = seed[i];
++ if (c >= 'A' && c <= 'Z') val = c - 'A';
++ else if (c >= 'a' && c <= 'z') val = c - 'a' + 26;
++ else if (c >= '0' && c <= '9') val = c - '0' + 26 + 26;
++ else if (c == '-') val = c - '-' + 26 + 26 + 10;
++ else if (c == '_') val = c - '_' + 26 + 26 + 10 + 1;
++ else error++;
++ rv1 = val + (rv1 << 6);
++ }
++ if(p)
++ *p = '.';
++ return error ? 0L : rv1;
++ }
++
++ unsigned long mdfntoul (char *name)
++ {
++ unsigned long t;
++ char *r, last;
++
++ if((*name == '_') && ((r = strpbrk(name,".,%+")) != NULL)){ /* Grrr!!! */
++ last = *r;
++ *r = '\0';
++ t = antoul(r+1);
++ *r = last;
++ }
++ else
++ t = antoul(name);
++ return t;
++ }
++
++ int comp_maildir_file(char *name1, char *name2)
++ {
++ int uset1 = 1, uset2 = 1, i, j, cmp;
++ unsigned long t1, t2;
++ char *s1, *s2;
++
++ if (!(name1 && *name1))
++ return (name2 && *name2) ? (*name2 == FLAGSEP ? 0 : -1) : 0;
++
++ if (!(name2 && *name2))
++ return (name1 && *name1) ? (*name1 == FLAGSEP ? 0 : 1) : 0;
++
++ if((cmp = strcmp(name1,name2)) == 0)
++ return 0;
++
++ t1 = strtoul(name1, &s1, 10);
++ t2 = strtoul(name2, &s2, 10);
++
++ if(!s1 || *s1 != '.')
++ uset1 = 0;
++
++ if(!s2 || *s2 != '.')
++ uset2 = 0;
++
++ if(uset1 && uset2) /* normal sort order */
++ return (t1 < t2) ? -1 : (t1 > t2 ? 1 : (cmp < 0 ? -1 : 1));
++
++ /* If we make it here we say Grrrr.... first, then we try to figure out
++ * how to sort this mess.
++ * These are the rules.
++ * If there is a number at the beginning it is bigger than anything else.
++ * If there are digits, then the number of digits decides which one is bigger.
++ */
++
++ for(i = 0; isdigit(name1[i]); i++);
++ for(j = 0; isdigit(name2[j]); j++);
++
++ return(uset1 ? 1
++ : (uset2 ? -1
++ : (i < j ? -1 : (i > j ? 1 : (cmp < 0 ? -1 : 1)))));
++ }
++
++ void
++ maildir_getflag(char *name, int *d, int *f, int *r ,int *s, int *t)
++ {
++ char tmp[MAILTMPLEN], *b;
++ int offset = 0;
++ int tmpd, tmpf, tmpr, tmps, tmpt;
++
++ if(d) *d = 0;
++ if(f) *f = 0;
++ if(r) *r = 0;
++ if(s) *s = 0;
++ if(t) *t = 0;
++
++ tmpd = tmpf = tmpr = tmps = tmpt = NIL; /* no flags set by default */
++ strcpy(tmp,name);
++ while ((b = strrchr(tmp+offset, FLAGSEP)) != NULL){
++ char flag,last;
++ int k;
++ if (!++b) break;
++ switch (*b){
++ case '1':
++ case '2':
++ case '3': flag = *b; b += 2;
++ for (k = 0; b[k] && b[k] != FLAGSEP && b[k] != ','; k++);
++ last = b[k];
++ b[k] = '\0';
++ if (flag == '2' || flag == '3'){
++ tmpd = strchr (b, MDFLAGC(Draft)) ? T : NIL;
++ tmpf = strchr (b, MDFLAGC(Flagged)) ? T : NIL;
++ tmpr = strchr (b, MDFLAGC(Replied)) ? T : NIL;
++ tmps = strchr (b, MDFLAGC(Seen)) ? T : NIL;
++ tmpt = strchr (b, MDFLAGC(Trashed)) ? T : NIL;
++ }
++ b[k] = last;
++ b += k;
++ for (; tmp[offset] && tmp[offset] != FLAGSEP; offset++);
++ offset++;
++ break;
++ default: break; /* Should we crash?... Nahhh */
++ }
++ }
++ if(d) *d = tmpd;
++ if(f) *f = tmpf;
++ if(r) *r = tmpr;
++ if(s) *s = tmps;
++ if(t) *t = tmpt;
++ }
++
++ int
++ maildir_message_in_list(char *msgname, struct direct **names,
++ unsigned long bottom, unsigned long top, unsigned long *pos)
++ {
++ unsigned long middle = (bottom + top)/2;
++ int test;
++
++ if (!msgname)
++ return NIL;
++
++ if (pos) *pos = middle;
++
++ if (same_maildir_file(msgname, names[middle]->d_name))
++ return T;
++
++ if (middle == bottom){ /* 0 <= 0 < 1 */
++ int rv = NIL;
++ if (same_maildir_file(msgname, names[middle]->d_name)){
++ rv = T;
++ if (pos) *pos = middle;
++ }
++ else
++ if (same_maildir_file(msgname, names[top]->d_name)){
++ rv = T;
++ if (pos) *pos = top;
++ }
++ return rv;
++ }
++
++ test = comp_maildir_file(msgname, names[middle]->d_name);
++
++ if (top <= bottom)
++ return test ? NIL : T;
++
++ if (test < 0 ) /* bottom < msgname < middle */
++ return maildir_message_in_list(msgname, names, bottom, middle, pos);
++ else if (test > 0) /* middle < msgname < top */
++ return maildir_message_in_list(msgname, names, middle, top, pos);
++ else return T;
++ }
++
++ void
++ maildir_abort(MAILSTREAM *stream)
++ {
++ if (LOCAL){
++ if(LOCAL->candouid)
++ maildir_read_uid(stream, NULL, &stream->uid_validity);
++ if (LOCAL->dir) fs_give ((void **) &LOCAL->dir);
++ if (LOCAL->curdir) fs_give ((void **) &LOCAL->curdir);
++ if (LOCAL->buf) fs_give ((void **) &LOCAL->buf);
++ if(LOCAL->uidtempfile){
++ unlink(LOCAL->uidtempfile);
++ fs_give ((void **) &LOCAL->uidtempfile);
++ }
++ fs_give ((void **) &stream->local);
++ }
++ if (mdfpath) fs_give((void **)&mdfpath);
++ stream->dtb = NIL;
++ }
++
++ int
++ maildir_contains_folder(char *dirname, char *name)
++ {
++ char tmp[MAILTMPLEN], tmp2[MAILTMPLEN];
++ int rv = 0;
++ DIR *dir;
++ struct direct *d;
++
++ maildir_file_path(dirname, tmp2);
++ if(name){
++ strcat(tmp2,"/");
++ strcat(tmp2, name);
++ }
++
++ if (!(dir = opendir (tmp2)))
++ return NIL;
++
++ while ((d = readdir(dir)) != NULL){
++ if (strcmp(d->d_name, ".") && strcmp(d->d_name,"..")
++ && strcmp(d->d_name, MDNAME(Cur))
++ && strcmp(d->d_name, MDNAME(Tmp))
++ && strcmp(d->d_name, MDNAME(New))){
++
++ sprintf(tmp,"%s/%s", tmp2, d->d_name);
++ if(maildir_valid(tmp)){
++ rv++;
++ break;
++ }
++ }
++ }
++ closedir(dir);
++ return rv;
++ }
++
++ int
++ maildir_is_dir(char *dirname, char *name)
++ {
++ char tmp[MAILTMPLEN];
++ struct stat sbuf;
++
++ maildir_file_path(dirname, tmp);
++ if(name){
++ strcat(tmp,"/");
++ strcat(tmp,name);
++ }
++ strcat(tmp,"/");
++ strcat(tmp,MDDIR);
++
++ return ((stat(tmp, &sbuf) == 0) && S_ISREG (sbuf.st_mode)) ? 1 : 0;
++ }
++
++ int
++ maildir_dir_is_empty(char *mailbox)
++ {
++ char tmp[MAILTMPLEN], tmp2[MAILTMPLEN], tmp3[MAILTMPLEN],*s;
++ int rv = 1, courier = IS_COURIER(mailbox);
++ DIR *dir;
++ struct direct *d;
++ struct stat sbuf;
++
++ maildir_file_path(mailbox, tmp2);
++
++ if(courier){
++ strcpy(tmp3, tmp2);
++ if(s = strrchr(tmp2, '/'))
++ *s = '\0';
++ }
++
++ if (!(dir = opendir (tmp2)))
++ return rv;
++
++ if(courier){
++ while((d = readdir(dir)) != NULL){
++ sprintf(tmp,"%s/%s", tmp2, d->d_name);
++ if(!strncmp(tmp, tmp3, strlen(tmp3))
++ && tmp[strlen(tmp3)] == '.'){
++ rv = 0;
++ break;
++ }
++ }
++ }
++ else
++ while ((d = readdir(dir)) != NULL){
++ sprintf(tmp,"%s/%s", tmp2, d->d_name);
++ if (strcmp(d->d_name, ".")
++ && strcmp(d->d_name,"..")
++ && strcmp(d->d_name, MDNAME(Cur))
++ && strcmp(d->d_name, MDNAME(Tmp))
++ && strcmp(d->d_name, MDNAME(New))
++ && strcmp(d->d_name, MDDIR)
++ && strcmp(d->d_name, MDUIDVALIDITY)
++ && !(d->d_name[0] == '.'
++ && stat (tmp,&sbuf) == 0
++ && S_ISREG(sbuf.st_mode))){
++ rv = 0;
++ break;
++ }
++ }
++ closedir(dir);
++ return rv;
++ }
++
++ void
++ maildir_get_file (MAILDIRFILE **mdfile)
++ {
++ MAILDIRFILE *md;
++
++ md = (MAILDIRFILE *) fs_get(sizeof(MAILDIRFILE));
++ memset(md, 0, sizeof(MAILDIRFILE));
++ *mdfile = md;
++ }
++
++ void
++ maildir_free_file (void **mdfile)
++ {
++ MAILDIRFILE *md = (mdfile && *mdfile) ? (MAILDIRFILE *) *mdfile : NULL;
++
++ if (md){
++ if (md->name) fs_give((void **)&md->name);
++ fs_give((void **)&md);
++ }
++ }
++
++ void
++ maildir_free_file_only (void **mdfile)
++ {
++ MAILDIRFILE *md = (mdfile && *mdfile) ? (MAILDIRFILE *) *mdfile : NULL;
++
++ if (md && md->name)
++ fs_give((void **)&md->name);
++ }
++
++ int
++ maildir_any_new_msgs(char *mailbox)
++ {
++ char tmp[MAILTMPLEN];
++ int rv = NIL;
++ DIR *dir;
++ struct direct *d;
++
++ MDFLD(tmp, mailbox, New);
++
++ if (!(dir = opendir (tmp)))
++ return rv;
++
++ while ((d = readdir(dir)) != NULL){
++ if (d->d_name[0] == '.')
++ continue;
++ rv = T;
++ break;
++ }
++ closedir(dir);
++ return rv;
++ }
++
++
++ void
++ maildir_get_date(MAILSTREAM *stream, unsigned long msgno)
++ {
++ MESSAGECACHE *elt;
++ struct tm *t;
++ time_t ti;
++ int i,k;
++
++ elt = mail_elt (stream,msgno);
++ if(elt && elt->year != 0)
++ return;
++ if ((ti = mdfntoul(MDFILE(elt))) > 0L && (t = gmtime(&ti))){
++ i = t->tm_hour * 60 + t->tm_min;
++ k = t->tm_yday;
++ t = localtime(&ti);
++ i = t->tm_hour * 60 + t->tm_min - i;
++ if((k = t->tm_yday - k) != 0)
++ i += ((k < 0) == (abs (k) == 1)) ? -24*60 : 24*60;
++ k = abs (i);
++ elt->hours = t->tm_hour;
++ elt->minutes = t->tm_min;
++ elt->seconds = t->tm_sec;
++ elt->day = t->tm_mday; elt->month = t->tm_mon + 1;
++ elt->year = t->tm_year - (BASEYEAR - 1900);
++ elt->zoccident = (k == i) ? 0 : 1;
++ elt->zhours = k/60;
++ elt->zminutes = k % 60;
++ }
++ }
++
++ /* Support for Courier Style directories
++ When this code is complete there will be two types of support, which
++ will be configurable. The problem is the following: In Courier style
++ folder structure, a "folder" may have a subfolder called
++ "folder.subfolder", which is not natural in the file system in the
++ sense that I can not stat for "folder.subfolder" wihtout knowing what
++ "subfolder" is. It needs to be guessed. Because of this I need to look
++ in the list of folders if there is a folder with a name
++ "folder.subfolder", before I can say if the folder is dual or not. One
++ can avoid this annoyance if one ignores the problem by declaring that
++ every folder is dual. I will however code as the default the more
++ complicated idea of scaning the containing directory each time it is
++ modified and search for subfolders, and list the entries it found.
++ */
++
++ int courier_dir_select (const struct direct *name)
++ {
++ return name->d_name[0] == '.' && (strlen(name->d_name) > 2
++ || (strlen(name->d_name) == 2 && name->d_name[1] != '.'));
++ }
++
++ int courier_dir_sort (const void *d1, const void *d2)
++ {
++ const struct direct *e1 = *(const struct direct **) d1;
++ const struct direct *e2 = *(const struct direct **) d2;
++
++ return strcmp((char *) e1->d_name, (char *) e2->d_name);
++ }
++
++ void courier_free_cdir (COURIER_S **cdir)
++ {
++ int i;
++
++ if (!*cdir)
++ return;
++
++ if ((*cdir)->path) fs_give((void **)&((*cdir)->path));
++ for (i = 0; i < (*cdir)->total; i++)
++ if((*cdir)->data[i]->name) fs_give((void **)&((*cdir)->data[i]->name));
++ fs_give((void **)&((*cdir)->data));
++ fs_give((void **)&(*cdir));
++ }
++
++ COURIER_S *courier_get_cdir (int total)
++ {
++ COURIER_S *cdir;
++
++ cdir = (COURIER_S *)fs_get(sizeof(COURIER_S));
++ memset(cdir, 0, sizeof(COURIER_S));
++ cdir->data = (COURIERLOCAL **) fs_get(total*sizeof(COURIERLOCAL *));
++ memset(cdir->data, 0, sizeof(COURIERLOCAL *));
++ cdir->total = total;
++ return cdir;
++ }
++
++ int courier_search_list(COURIERLOCAL **data, char *name, int first, int last)
++ {
++ int try = (first + last)/2;
++
++ if(!strstr(data[try]->name, name)){
++ if(first == try) /* first == last || first + 1 == last */
++ return strstr(data[last]->name, name) ? 1 : 0;
++ if(strcmp(data[try]->name, name) < 0) /*data[try] < name < data[end] */
++ return courier_search_list(data, name, try, last);
++ else /* data[begin] < name < data[try] */
++ return courier_search_list(data, name, first, try);
++ }
++ return 1;
++ }
++
++ /* Lists all directories that are subdirectories of a given directory */
++
++ COURIER_S *courier_list_dir(char *curdir)
++ {
++ struct direct **names = NIL;
++ struct stat sbuf;
++ unsigned long ndir;
++ COURIER_S *cdir = NULL;
++ char tmp[MAILTMPLEN], tmp2[MAILTMPLEN], pathname[MAILTMPLEN],
++ realname[MAILTMPLEN];
++ int i, j, scand, td;
++
++ /* There are two cases, either curdir is
++ #mc/INBOX. #mc/INBOX.foo
++ or
++ #mc/Maildir/. #mc/Maildir/.foo
++ */
++ strcpy(tmp,curdir + 4);
++ if(!strncmp(ucase(tmp), "INBOX", 5))
++ strcpy(tmp, "#mc/INBOX.");
++ else{
++ strcpy(tmp, curdir);
++ for (i = strlen(tmp) - 1; tmp[i] && tmp[i] != '/'; i--);
++ tmp[i+2] = '\0'; /* keep the last "." intact */
++ }
++ maildir_file_path(tmp, realname);
++ maildir_scandir (realname, &names, &ndir, &scand, COURIER);
++
++ if (scand > 0){
++ cdir = courier_get_cdir(ndir);
++ cdir->path = cpystr(realname);
++ for(i = 0, j = 0; i < ndir; i++){
++ td = realname[strlen(realname) - 1] == '.'
++ && *names[i]->d_name == '.';
++ sprintf(tmp2,"%s%s", tmp, names[i]->d_name+1);
++ sprintf(pathname,"%s%s", realname, names[i]->d_name + td);
++ if(stat(pathname, &sbuf) == 0 && S_ISDIR(sbuf.st_mode)){
++ cdir->data[j] = (COURIERLOCAL *) fs_get(sizeof(COURIERLOCAL));
++ cdir->data[j++]->name = cpystr(tmp2);
++ }
++ fs_give((void **)&names[i]);
++ }
++ cdir->total = j;
++ if(cdir->total == 0)
++ courier_free_cdir(&cdir);
++ }
++ if(names)
++ fs_give((void **) &names);
++ return cdir;
++ }
++
++ void
++ courier_list_info(COURIER_S **cdirp, char *data, int i)
++ {
++ long style = (long) maildir_parameters(GET_COURIERSTYLE, NIL);
++ COURIER_S *cdir = *cdirp;
++
++ if(maildir_valid(cdir->data[i]->name)){
++ if(courier_search_list(cdir->data, data, 0, cdir->total - 1))
++ cdir->data[i]->attribute = LATT_HASCHILDREN;
++ else
++ cdir->data[i]->attribute = (style == COURIER)
++ ? LATT_HASNOCHILDREN : LATT_NOINFERIORS;
++ }
++ else
++ cdir->data[i]->attribute = LATT_NOSELECT;
++ cdir->data[i]->attribute += maildir_any_new_msgs(cdir->data[i]->name)
++ ? LATT_MARKED : LATT_UNMARKED;
++ }
++
++ /* UID Support */
++ /* Yes, I know I procastinated a lot about this, but here it is finally */
++
++ unsigned int
++ maildir_can_assign_uid (MAILSTREAM *stream)
++ {
++ unsigned int rv = 0;
++ int createtemp;
++ unsigned long t;
++ char tmp[MAILTMPLEN], *s;
++ DIR *dir;
++ struct direct *d;
++
++ if(!stream || stream->rdonly
++ || !LOCAL || !LOCAL->dir || !(dir = opendir(LOCAL->dir)))
++ return rv;
++
++ sprintf(tmp, "%s.%d", MDUIDTEMP, mypid);
++ while ((d = readdir(dir)) != NULL){
++ if(!strncmp(d->d_name, tmp, strlen(tmp))
++ || !strncmp(d->d_name, MDUIDTEMP, strlen(MDUIDTEMP)))
++ break;
++ }
++ rv = d ? !strncmp(d->d_name, tmp, strlen(tmp)) : 1;
++ createtemp = d ? 0 : 1;
++ if (d && rv == 0){ /* is there a temp file that is not ours? */
++ s = strrchr(d->d_name, '.');
++ t = strtoul(s+1, &s, 10);
++ if(s != NULL && *s != '\0')
++ createtemp++;
++ if(time(0) > t + MAXTEMPUID){
++ createtemp++;
++ sprintf(tmp,"%s/%s", LOCAL->dir, d->d_name);
++ unlink(tmp);
++ }
++ }
++ closedir(dir);
++ if(createtemp){
++ FILE *fp;
++ sprintf(tmp,"%s/%s.%d.%lu", LOCAL->dir, MDUIDTEMP, mypid, time(0));
++ if(fp = fopen(tmp, "w")){
++ fclose(fp);
++ if(LOCAL->uidtempfile)
++ fs_give((void **)&LOCAL->uidtempfile);
++ LOCAL->uidtempfile = cpystr(tmp);
++ rv++;
++ }
++ }
++ return rv;
++ }
++
++ void
++ maildir_read_uid(MAILSTREAM *stream, unsigned long *uid_last,
++ unsigned long *uid_validity)
++ {
++ int createuid, deleteuid = 0;
++ char tmp[MAILTMPLEN], *s = NULL;
++ DIR *dir;
++ struct direct *d;
++
++ if(uid_last) *uid_last = 0L;
++ if(uid_last && uid_validity) *uid_validity = time(0);
++ if(!stream || !LOCAL || !LOCAL->dir || !(dir = opendir(LOCAL->dir)))
++ return;
++
++ while ((d = readdir(dir)) != NULL){
++ if(!strncmp(d->d_name, MDUIDLAST, strlen(MDUIDLAST)))
++ break;
++ }
++ createuid = d == NULL ? 1 : 0;
++ if(uid_last == NULL)
++ deleteuid++;
++ if(d){
++ if(uid_last){
++ s = d->d_name + strlen(MDUIDLAST) + 1;
++ *uid_last = strtoul(s, &s, 10);
++ if(!s || *s != '.'){
++ deleteuid++;
++ createuid++;
++ *uid_last = 0L;
++ }
++ }
++ if(s && *s == '.'){
++ if(uid_validity){
++ s++;
++ *uid_validity = strtoul(s, &s, 10);
++ if(s && *s != '\0'){
++ *uid_validity = time(0);
++ deleteuid++;
++ createuid++;
++ }
++ }
++ }
++ else{
++ deleteuid++;
++ createuid++;
++ }
++ }
++ if(deleteuid){
++ sprintf(tmp,"%s/%s", LOCAL->dir, d->d_name);
++ unlink(tmp);
++ }
++ if(createuid)
++ maildir_write_uid(stream, (uid_last ? *uid_last : stream->uid_last),
++ uid_validity ? *uid_validity : time(0));
++ closedir(dir);
++ }
++
++ void
++ maildir_write_uid(MAILSTREAM *stream, unsigned long uid_last,
++ unsigned long uid_validity)
++ {
++ char tmp[MAILTMPLEN];
++ FILE *fp;
++
++ if(!stream || stream->rdonly || !LOCAL || !LOCAL->dir)
++ return;
++
++ sprintf(tmp,"%s/%s.%010lu.%010lu", LOCAL->dir, MDUIDLAST,
++ uid_last, uid_validity);
++ if(fp = fopen(tmp, "w"))
++ fclose(fp);
++ }
++
++ unsigned long
++ maildir_get_uid(char *name)
++ {
++ char *s;
++ unsigned long rv = 0L;
++
++ if(!name || (s = strstr(name,MDUIDSEP)) == NULL)
++ return rv;
++
++ s += strlen(MDUIDSEP);
++ rv = strtoul(s, NULL, 10);
++ return rv;
++ }
++
++
++ void
++ maildir_delete_uid(MAILSTREAM *stream, unsigned long msgno)
++ {
++ char old[MAILTMPLEN], new[MAILTMPLEN], *s, *t;
++ MESSAGECACHE *elt;
++
++ elt = mail_elt(stream, msgno);
++ if(!stream || !elt || !elt->private.spare.ptr || !LOCAL || !LOCAL->dir)
++ return;
++
++ sprintf(old, "%s/%s/%s", LOCAL->dir, MDNAME(Cur), MDFILE(elt));
++ t = MDFILE(elt);
++ if(s = strstr(MDFILE(elt), MDUIDSEP)){
++ *s = '\0';
++ s += strlen(MDUIDSEP);
++ strtoul(s, &s, 10);
++ sprintf(new, "%s/%s/%s%s", LOCAL->dir, MDNAME(Cur), t, s);
++ if(rename(old, new) == 0){
++ maildir_free_file_only ((void **)&elt->private.spare.ptr);
++ s = strrchr(new, '/');
++ MDFILE(elt) = cpystr(s+1);
++ }
++ elt->private.uid = 0L;
++ }
++ }
++
++ void
++ maildir_assign_uid(MAILSTREAM *stream, unsigned long msgno, unsigned long uid)
++ {
++ int createuid, deleteuid = 0;
++ char old[MAILTMPLEN], new[MAILTMPLEN], *s, *t;
++ MESSAGECACHE *elt;
++
++ elt = mail_elt(stream, msgno);
++ if(!stream || !elt || !elt->private.spare.ptr || !LOCAL || !LOCAL->dir)
++ return;
++
++ maildir_delete_uid(stream, msgno);
++ sprintf(old, "%s/%s/%s", LOCAL->dir, MDNAME(Cur), MDFILE(elt));
++ t = MDFILE(elt);
++ if((s = strrchr(MDFILE(elt),FLAGSEP)) != NULL){
++ *s++ = '\0';
++ sprintf(new, "%s/%s/%s%s%lu%c%s",
++ LOCAL->dir, MDNAME(Cur), t, MDUIDSEP, uid, FLAGSEP, s);
++ if(rename(old, new) == 0){
++ maildir_free_file_only ((void **)&elt->private.spare.ptr);
++ s = strrchr(new, '/');
++ MDFILE(elt) = cpystr(s+1);
++ stream->uid_validity = time(0);
++ }
++ elt->private.uid = uid;
++ }
++ }
++
++ void
++ maildir_uid_renew_tempfile(MAILSTREAM *stream)
++ {
++ char tmp[MAILTMPLEN];
++
++ if(!stream || stream->rdonly
++ || !LOCAL || !LOCAL->candouid || !LOCAL->dir || !LOCAL->uidtempfile)
++ return;
++
++ sprintf(tmp,"%s/%s.%d.%lu", LOCAL->dir, MDUIDTEMP, mypid, time(0));
++ if(rename(LOCAL->uidtempfile, tmp) == 0){
++ fs_give((void **)&LOCAL->uidtempfile);
++ LOCAL->uidtempfile = cpystr(tmp);
++ }
++ }
+diff -rc alpine-2.00/imap/src/osdep/unix/maildir.h alpine-2.00.maildir/imap/src/osdep/unix/maildir.h
+*** alpine-2.00/imap/src/osdep/unix/maildir.h 2011-01-24 19:38:50.000000000 -0600
+--- alpine-2.00.maildir/imap/src/osdep/unix/maildir.h 2011-01-15 19:11:36.000000000 -0600
+***************
+*** 0 ****
+--- 1,226 ----
++ /*
++ * A few definitions that try to make this module portable to other
++ * platforms (e.g. Cygwin). This module is based on the information from
++ * http://cr.yp.to/proto/maildir.html
++ */
++
++ /* First we deal with the separator character */
++ #ifndef FLAGSEP
++ #define FLAGSEP ':'
++ #endif
++ #define SIZESEP ','
++
++ const char sep1[] = {FLAGSEP, '1', ',', '\0'}; /* experimental semantics*/
++ const char sep2[] = {FLAGSEP, '2', ',', '\0'}; /* Flags Information */
++ const char sep3[] = {FLAGSEP, '3', ',', '\0'}; /* Grrrr.... */
++
++ const char *sep[] = { sep1, sep2, sep3, NULL};
++
++ #define MDSEP(i) sep[((i) - 1)]
++
++ /* Now we deal with flags. Woohoo! */
++ typedef enum {Draft, Flagged, Passed, Replied, Seen, Trashed,
++ EmptyFlag, EndFlags} MdFlagNamesType;
++ const int mdimapflags[] = {Draft, Flagged, Replied, Seen, Trashed, EmptyFlag, EndFlags};
++ const int mdkwdflags[] = {Passed, EmptyFlag, EndFlags};
++
++ /* this array lists the codes for mdflgnms (maildir flag names) above */
++ const char *mdflags[] = { "D", "F", "P", "R", "S", "T", "", NULL};
++ /* and as characters too */
++ const char cmdflags[] = { 'D', 'F', 'P', 'R', 'S', 'T', '0', '\0'};
++
++ /* MDFLAG(Seen, elt->seen) */
++ #define MDFLAG(i,j) mdflags[j ? (i) : EmptyFlag]
++ /* MDFLAGC(Seen) */
++ #define MDFLAGC(i) cmdflags[(i)]
++
++ /* Now we deal with the directory structure */
++ typedef enum {Cur, Tmp, New, EndDir} DirNamesType;
++ char *mdstruct[] = {"cur", "tmp", "new", NULL};
++ #define MDNAME(i) mdstruct[(i)]
++ #define MDFLD(tmp, dir, i) sprintf((tmp),"%s/%s", (dir), mdstruct[(i)])
++ #define MSGPATH(tmp, dir, msg,i) sprintf((tmp),"%s/%s/%s", (dir), mdstruct[(i)],(msg))
++
++ /* Files associated to a maildir directory */
++
++ #define MDUIDVALIDITY ".uidvalidity" /* support for old maildirs */
++ #define MDDIR ".mdir" /* this folder is a directory */
++ #define MDUIDLAST ".uidlast" /* last assigned uid */
++ #define MDUIDTEMP ".uidtemp" /* We assign uid's no one else */
++
++
++
++ /* Support of Courier Structure */
++ #define CCLIENT 0
++ #define COURIER 1
++ #define IS_CCLIENT(t) \
++ (((t) && (t)[0] == '#' && ((t)[1] == 'm' || (t)[1] == 'M')\
++ && ((t)[2] == 'd' || (t)[2] == 'D')\
++ && (t)[3] == '/' && (t)[4] != '\0') ? 1 : 0)
++
++ #define IS_COURIER(t) \
++ (((t) && (t)[0] == '#' && ((t)[1] == 'm' || (t)[1] == 'M')\
++ && ((t)[2] == 'c' || (t)[2] == 'C')\
++ && (t)[3] == '/' && (t)[4] != '\0') ? 1 : 0)
++ #define MDPREFIX(s) ((s) ? "#mc/" : "#md/")
++ #define MDSEPARATOR(s) ((s) ? '.' : '/')
++
++ /* UID Support */
++
++ #define MAXTEMPUID (unsigned long) 180L
++ const char mduid[] = {',','u','=','\0'};
++ #define MDUIDSEP mduid
++
++
++ /* Now we deal with messages filenames */
++ char mdlocaldomain[MAILTMPLEN+1] = {'\0'};
++ pid_t mypid = (pid_t) 0;
++ static char *mdfpath = NULL;
++ static char myMdInboxDir[50] = { '\0' };/* Location of the Maildir INBOX */
++ static long CourierStyle = CCLIENT;
++
++ #define CHUNK 16384 /* from unix.h */
++
++ typedef struct courier_local {
++ char *name; /* name of directory/folder */
++ int attribute; /* attributes (children/marked/etc) */
++ } COURIERLOCAL;
++
++ typedef struct courier {
++ char *path; /* Path to collection */
++ time_t scantime; /* time at which information was generated */
++ int total; /* total number of elements in data */
++ COURIERLOCAL **data;
++ } COURIER_S;
++
++ /* In gdb this is the *(struct maildir_local *)stream->local structure */
++ typedef struct maildir_local {
++ unsigned int dirty : 1; /* diskcopy needs updating */
++ unsigned int courier : 1; /* It is Courier style file system */
++ unsigned int link : 1; /* There is a symbolic link */
++ unsigned int candouid; /* we can assign uids and no one else */
++ char *uidtempfile; /* path to uid temp file */
++ int fd; /* fd of open message */
++ char *dir; /* mail directory name */
++ char *curdir; /* mail directory name/cur */
++ unsigned char *buf; /* temporary buffer */
++ unsigned long buflen; /* current size of temporary buffer */
++ time_t scantime; /* last time directory scanned */
++ } MAILDIRLOCAL;
++
++ /* Convenient access to local data */
++ #define LOCAL ((MAILDIRLOCAL *) stream->local)
++
++ typedef struct maildir_file_info {
++ char *name; /* name of the file */
++ DirNamesType loc; /* location of this file */
++ unsigned long pos; /* place in list where this file is listed */
++ off_t size; /* size in bytes, on disk */
++ time_t atime; /* last access time */
++ time_t mtime; /* last modified time */
++ time_t ctime; /* last changed time */
++ } MAILDIRFILE;
++
++ #define MDFILE(F) (((MAILDIRFILE *)((F)->private.spare.ptr))->name)
++ #define MDLOC(F) (((MAILDIRFILE *)((F)->private.spare.ptr))->loc)
++ #define MDPOS(F) (((MAILDIRFILE *)((F)->private.spare.ptr))->pos)
++ #define MDSIZE(F) (((MAILDIRFILE *)((F)->private.spare.ptr))->size)
++ #define MDATIME(F) (((MAILDIRFILE *)((F)->private.spare.ptr))->atime)
++ #define MDMTIME(F) (((MAILDIRFILE *)((F)->private.spare.ptr))->mtime)
++ #define MDCTIME(F) (((MAILDIRFILE *)((F)->private.spare.ptr))->ctime)
++
++ /* Function prototypes */
++
++ DRIVER *maildir_valid (char *name);
++ MAILSTREAM *maildir_open (MAILSTREAM *stream);
++ void maildir_close (MAILSTREAM *stream, long options);
++ long maildir_ping (MAILSTREAM *stream);
++ void maildir_check (MAILSTREAM *stream);
++ long maildir_text (MAILSTREAM *stream,unsigned long msgno,STRING *bs,long flags);
++ char *maildir_header (MAILSTREAM *stream,unsigned long msgno,
++ unsigned long *length, long flags);
++ void maildir_list (MAILSTREAM *stream,char *ref,char *pat);
++ void *maildir_parameters (long function,void *value);
++ int maildir_create_folder (char *mailbox);
++ long maildir_create (MAILSTREAM *stream,char *mailbox);
++ void maildir_flagmsg (MAILSTREAM *stream,MESSAGECACHE *elt); /*check */
++ long maildir_expunge (MAILSTREAM *stream, char *sequence, long options);
++ long maildir_copy (MAILSTREAM *stream,char *sequence,char *mailbox,long options);
++ long maildir_append (MAILSTREAM *stream,char *mailbox, append_t af, void *data);
++ long maildir_delete (MAILSTREAM *stream,char *mailbox);
++ long maildir_rename (MAILSTREAM *stream,char *old,char *new);
++ long maildir_sub (MAILSTREAM *stream,char *mailbox);
++ long maildir_unsub (MAILSTREAM *stream,char *mailbox);
++ void maildir_lsub (MAILSTREAM *stream,char *ref,char *pat);
++ void courier_list (MAILSTREAM *stream,char *ref, char *pat);
++
++ /* utility functions */
++ void courier_realname (char *name, char *realname);
++ long maildir_dirfmttest (char *name);
++ char *maildir_file (char *dst,char *name);
++ int maildir_select (const struct direct *name);
++ int maildir_namesort (const void *d1, const void *d2);
++ unsigned long antoul (char *seed);
++ unsigned long mdfntoul (char *name);
++ int courier_dir_select (const struct direct *name);
++ int courier_dir_sort (const void *d1, const void *d2);
++ long maildir_canonicalize (char *pattern,char *ref,char *pat);
++ void maildir_list_work (MAILSTREAM *stream,char *subdir,char *pat,long level);
++ void courier_list_work (MAILSTREAM *stream,char *subdir,char *pat,long level);
++ int maildir_file_path(char *name, char *tmp);
++ int maildir_valid_name (char *name);
++ int maildir_valid_dir (char *name);
++ int is_valid_maildir (char **name);
++ int maildir_message_exists(MAILSTREAM *stream,char *name, char *tmp);
++ char *maildir_remove_root(char *name);
++ char *maildir_text_work (MAILSTREAM *stream,MESSAGECACHE *elt, unsigned long *length,long flags);
++ unsigned long maildir_parse_message(MAILSTREAM *stream, unsigned long msgno,
++ DirNamesType dirtype);
++ int maildir_eliminate_duplicate (char *name, struct direct ***flist,
++ unsigned long *nfiles);
++ int maildir_doscandir (char *name, struct direct ***flist, int flag);
++ unsigned long maildir_scandir (char *name, struct direct ***flist,
++ unsigned long *nfiles, int *scand, int flag);
++ void maildir_parse_folder (MAILSTREAM *stream, int full);
++ void md_domain_name (void);
++ char *myrootdir (char *name);
++ char *mdirpath (void);
++ int maildir_initial_check (MAILSTREAM *stream, DirNamesType dirtype);
++ unsigned long maildir_parse_dir(MAILSTREAM *stream, unsigned long nmsgs,
++ DirNamesType dirtype, struct direct **names, unsigned long nfiles, int full);
++ int same_maildir_file(char *name1, char *name2);
++ int comp_maildir_file(char *name1, char *name2);
++ int maildir_message_in_list(char *msgname, struct direct **names,
++ unsigned long bottom, unsigned long top, unsigned long *pos);
++ void maildir_getflag(char *name, int *d, int *f, int *r ,int *s, int *t);
++ int maildir_update_elt_maildirp(MAILSTREAM *stream, unsigned long msgno);
++ void maildir_abort (MAILSTREAM *stream);
++ int maildir_contains_folder(char *dirname, char *name);
++ int maildir_is_dir(char *dirname, char *name);
++ int maildir_dir_is_empty(char *mailbox);
++ int maildir_create_work (char *mailbox, int loop);
++ void maildir_get_file (MAILDIRFILE **mdfile);
++ void maildir_free_file (void **mdfile);
++ void maildir_free_file_only (void **mdfile);
++ int maildir_any_new_msgs(char *mailbox);
++ void maildir_get_date(MAILSTREAM *stream, unsigned long msgno);
++ void maildir_fast (MAILSTREAM *stream,char *sequence,long flags);
++
++ /* Courier server support */
++ void courier_free_cdir (COURIER_S **cdir);
++ COURIER_S *courier_get_cdir (int total);
++ int courier_search_list(COURIERLOCAL **data, char *name, int first, int last);
++ COURIER_S *courier_list_dir(char *curdir);
++ void courier_list_info(COURIER_S **cdirp, char *data, int i);
++
++ /* UID Support */
++ unsigned int maildir_can_assign_uid (MAILSTREAM *stream);
++ void maildir_read_uid(MAILSTREAM *stream, unsigned long *uid_last,
++ unsigned long *uid_validity);
++ void maildir_write_uid(MAILSTREAM *stream, unsigned long uid_last,
++ unsigned long uid_validity);
++ unsigned long maildir_get_uid(char *name);
++ void maildir_delete_uid(MAILSTREAM *stream, unsigned long msgno);
++ void maildir_assign_uid(MAILSTREAM *stream, unsigned long msgno, unsigned long uid);
++ void maildir_uid_renew_tempfile(MAILSTREAM *stream);
++
+diff -rc alpine-2.00/imap/src/osdep/unix/Makefile alpine-2.00.maildir/imap/src/osdep/unix/Makefile
+*** alpine-2.00/imap/src/osdep/unix/Makefile 2008-06-04 13:18:34.000000000 -0500
+--- alpine-2.00.maildir/imap/src/osdep/unix/Makefile 2011-01-15 19:11:07.000000000 -0600
+***************
+*** 144,150 ****
+ # However, mh needs to be before any sysinbox formats (such as mmdf or unix)
+ # since otherwise INBOX won't work correctly when mh_allow_inbox is set.
+ #
+! DEFAULTDRIVERS=imap nntp pop3 mix mx mbx tenex mtx mh mmdf unix news phile
+ CHUNKSIZE=65536
+
+ # Normally no need to change any of these
+--- 144,150 ----
+ # However, mh needs to be before any sysinbox formats (such as mmdf or unix)
+ # since otherwise INBOX won't work correctly when mh_allow_inbox is set.
+ #
+! DEFAULTDRIVERS=maildir courier imap nntp pop3 mix mx mbx tenex mtx mh mmdf unix news phile
+ CHUNKSIZE=65536
+
+ # Normally no need to change any of these
+***************
+*** 153,159 ****
+ BINARIES=osdep.o mail.o misc.o newsrc.o smanager.o utf8.o utf8aux.o siglocal.o \
+ dummy.o pseudo.o netmsg.o flstring.o fdstring.o \
+ rfc822.o nntp.o smtp.o imap4r1.o pop3.o \
+! unix.o mbx.o mmdf.o tenex.o mtx.o news.o phile.o mh.o mx.o mix.o
+ CFLAGS=-g
+
+ CAT=cat
+--- 153,159 ----
+ BINARIES=osdep.o mail.o misc.o newsrc.o smanager.o utf8.o utf8aux.o siglocal.o \
+ dummy.o pseudo.o netmsg.o flstring.o fdstring.o \
+ rfc822.o nntp.o smtp.o imap4r1.o pop3.o \
+! unix.o mbx.o mmdf.o tenex.o mtx.o news.o phile.o mh.o mx.o mix.o maildir.o
+ CFLAGS=-g
+
+ CAT=cat
+***************
+*** 282,288 ****
+
+ cyg: # Cygwin - note that most local file drivers don't work!!
+ $(BUILD) `$(CAT) SPECIALS` OS=$@ \
+! DEFAULTDRIVERS="imap nntp pop3 mbx unix phile" \
+ SIGTYPE=psx CHECKPW=cyg LOGINPW=cyg CRXTYPE=std \
+ SPOOLDIR=/var \
+ ACTIVEFILE=/usr/local/news/lib/active \
+--- 282,288 ----
+
+ cyg: # Cygwin - note that most local file drivers don't work!!
+ $(BUILD) `$(CAT) SPECIALS` OS=$@ \
+! DEFAULTDRIVERS="imap nntp pop3 mbx unix maildir phile" \
+ SIGTYPE=psx CHECKPW=cyg LOGINPW=cyg CRXTYPE=std \
+ SPOOLDIR=/var \
+ ACTIVEFILE=/usr/local/news/lib/active \
+***************
+*** 892,898 ****
+ unix.o: mail.h misc.h osdep.h unix.h pseudo.h dummy.h
+ utf8.o: mail.h misc.h osdep.h utf8.h tmap.c widths.c
+ utf8aux.o: mail.h misc.h osdep.h utf8.h
+!
+
+ # OS-dependent
+
+--- 892,898 ----
+ unix.o: mail.h misc.h osdep.h unix.h pseudo.h dummy.h
+ utf8.o: mail.h misc.h osdep.h utf8.h tmap.c widths.c
+ utf8aux.o: mail.h misc.h osdep.h utf8.h
+! maildir.o: mail.h misc.h osdep.h maildir.h dummy.h
+
+ # OS-dependent
+
+diff -rc alpine-2.00/imap/src/osdep/unix/os_cyg.h alpine-2.00.maildir/imap/src/osdep/unix/os_cyg.h
+*** alpine-2.00/imap/src/osdep/unix/os_cyg.h 2008-06-04 13:18:34.000000000 -0500
+--- alpine-2.00.maildir/imap/src/osdep/unix/os_cyg.h 2011-01-15 19:11:07.000000000 -0600
+***************
+*** 47,52 ****
+--- 47,53 ----
+ #define setpgrp setpgid
+
+ #define SYSTEMUID 18 /* Cygwin returns this for SYSTEM */
++ #define FLAGSEP ';'
+ #define geteuid Geteuid
+ uid_t Geteuid (void);
+
+diff -rc alpine-2.00/pith/conf.c alpine-2.00.maildir/pith/conf.c
+*** alpine-2.00/pith/conf.c 2008-08-22 19:07:05.000000000 -0500
+--- alpine-2.00.maildir/pith/conf.c 2011-01-15 19:11:07.000000000 -0600
+***************
+*** 427,432 ****
+--- 427,435 ----
+
+ CONF_TXT_T cf_text_newsrc_path[] = "Full path and name of NEWSRC file";
+
++ #ifndef _WINDOWS
++ CONF_TXT_T cf_text_maildir_location[] = "Location relative to your HOME directory of the directory where your INBOX\n# for the maildir format is located. Default value is \"Maildir\". If your\n# inbox is located at \"~/Maildir\" you do not need to change this value.\n# A common value is also \".maildir\"";
++ #endif
+
+ /*----------------------------------------------------------------------
+ These are the variables that control a number of pine functions. They
+***************
+*** 627,632 ****
+--- 630,639 ----
+ NULL, cf_text_news_active},
+ {"news-spool-directory", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0,
+ NULL, cf_text_news_spooldir},
++ #ifndef _WINDOWS
++ {"maildir-location", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0,
++ "Maildir Location", cf_text_maildir_location},
++ #endif
+ {"upload-command", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0,
+ NULL, cf_text_upload_cmd},
+ {"upload-command-prefix", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0,
+***************
+*** 2216,2221 ****
+--- 2223,2234 ----
+ mail_parameters(NULL, SET_NEWSSPOOL,
+ (void *)VAR_NEWS_SPOOL_DIR);
+
++ #ifndef _WINDOWS
++ set_current_val(&vars[V_MAILDIR_LOCATION], TRUE, TRUE);
++ if(VAR_MAILDIR_LOCATION && VAR_MAILDIR_LOCATION[0])
++ mail_parameters(NULL, SET_MDINBOXPATH, (void *)VAR_MAILDIR_LOCATION);
++ #endif
++
+ /* guarantee a save default */
+ set_current_val(&vars[V_DEFAULT_SAVE_FOLDER], TRUE, TRUE);
+ if(!VAR_DEFAULT_SAVE_FOLDER || !VAR_DEFAULT_SAVE_FOLDER[0])
+***************
+*** 2832,2837 ****
+--- 2845,2854 ----
+ F_SORT_DEFAULT_SAVE_ALPHA, h_config_sort_save_alpha, PREF_FLDR, 0},
+ {"vertical-folder-list", "Use Vertical Folder List",
+ F_VERTICAL_FOLDER_LIST, h_config_vertical_list, PREF_FLDR, 0},
++ #ifndef _WINDOWS
++ {"use-courier-folder-list", "Courier Style Folder List",
++ F_COURIER_FOLDER_LIST, h_config_courier_list, PREF_FLDR, 0},
++ #endif
+
+ /* Addr book */
+ {"combined-addrbook-display", "Combined Address Book Display",
+***************
+*** 6895,6900 ****
+--- 6912,6923 ----
+
+ break;
+
++ #ifndef _WINDOWS
++ case F_COURIER_FOLDER_LIST:
++ mail_parameters(NULL,SET_COURIERSTYLE,(void *)(F_ON(f->id ,ps)? 1 : 0));
++ break; /* COURIER == 1, CCLIENT == 0, see maildir.h */
++ #endif
++
+ case F_COLOR_LINE_IMPORTANT :
+ case F_DATES_TO_LOCAL :
+ clear_index_cache(ps->mail_stream, 0);
+***************
+*** 7676,7681 ****
+--- 7699,7708 ----
+ return(h_config_newmailwidth);
+ case V_NEWSRC_PATH :
+ return(h_config_newsrc_path);
++ #ifndef _WINDOWS
++ case V_MAILDIR_LOCATION :
++ return(h_config_maildir_location);
++ #endif
+ case V_BROWSER :
+ return(h_config_browser);
+ #if defined(DOS) || defined(OS2)
+diff -rc alpine-2.00/pith/conf.h alpine-2.00.maildir/pith/conf.h
+*** alpine-2.00/pith/conf.h 2008-08-19 19:27:11.000000000 -0500
+--- alpine-2.00.maildir/pith/conf.h 2011-01-15 19:11:07.000000000 -0600
+***************
+*** 249,254 ****
+--- 249,258 ----
+ #define GLO_NEWS_ACTIVE_PATH vars[V_NEWS_ACTIVE_PATH].global_val.p
+ #define VAR_NEWS_SPOOL_DIR vars[V_NEWS_SPOOL_DIR].current_val.p
+ #define GLO_NEWS_SPOOL_DIR vars[V_NEWS_SPOOL_DIR].global_val.p
++ #ifndef _WINDOWS
++ #define VAR_MAILDIR_LOCATION vars[V_MAILDIR_LOCATION].current_val.p
++ #define GLO_MAILDIR_LOCATION vars[V_MAILDIR_LOCATION].global_val.p
++ #endif
+ #define VAR_DISABLE_DRIVERS vars[V_DISABLE_DRIVERS].current_val.l
+ #define VAR_DISABLE_AUTHS vars[V_DISABLE_AUTHS].current_val.l
+ #define VAR_REMOTE_ABOOK_METADATA vars[V_REMOTE_ABOOK_METADATA].current_val.p
+diff -rc alpine-2.00/pith/conftype.h alpine-2.00.maildir/pith/conftype.h
+*** alpine-2.00/pith/conftype.h 2008-08-19 19:27:11.000000000 -0500
+--- alpine-2.00.maildir/pith/conftype.h 2011-01-15 19:11:07.000000000 -0600
+***************
+*** 114,119 ****
+--- 114,122 ----
+ , V_NEWSRC_PATH
+ , V_NEWS_ACTIVE_PATH
+ , V_NEWS_SPOOL_DIR
++ #ifndef _WINDOWS
++ , V_MAILDIR_LOCATION
++ #endif
+ , V_UPLOAD_CMD
+ , V_UPLOAD_CMD_PREFIX
+ , V_DOWNLOAD_CMD
+***************
+*** 380,385 ****
+--- 383,391 ----
+ F_PASS_C1_CONTROL_CHARS,
+ F_SINGLE_FOLDER_LIST,
+ F_VERTICAL_FOLDER_LIST,
++ #ifndef _WINDOWS
++ F_COURIER_FOLDER_LIST,
++ #endif
+ F_TAB_CHK_RECENT,
+ F_AUTO_REPLY_TO,
+ F_VERBOSE_POST,
+diff -rc alpine-2.00/pith/init.c alpine-2.00.maildir/pith/init.c
+*** alpine-2.00/pith/init.c 2007-08-16 17:25:10.000000000 -0500
+--- alpine-2.00.maildir/pith/init.c 2011-01-15 19:11:07.000000000 -0600
+***************
+*** 407,412 ****
+--- 407,415 ----
+ && stricmp(filename, folder_base)){
+ #else
+ if(strncmp(filename, folder_base, folder_base_len) == 0
++ #ifndef _WINDOWS
++ && filename[folder_base_len] != list_cntxt->dir->delim
++ #endif
+ && strcmp(filename, folder_base)){
+ #endif
+ #endif
+diff -rc alpine-2.00/pith/pattern.c alpine-2.00.maildir/pith/pattern.c
+*** alpine-2.00/pith/pattern.c 2008-07-14 13:01:54.000000000 -0500
+--- alpine-2.00.maildir/pith/pattern.c 2011-01-24 19:38:41.000000000 -0600
+***************
+*** 5482,5487 ****
+--- 5482,5496 ----
+ break;
+
+ case '#':
++ #ifndef _WINDOWS
++ if(!struncmp(patfolder, "#md/", 4)
++ || !struncmp(patfolder, "#mc/", 4)){
++ maildir_file_path(patfolder, tmp1);
++ if(!strcmp(patfolder, stream->mailbox))
++ match++;
++ break;
++ }
++ #endif
+ if(!strcmp(patfolder, stream->mailbox))
+ match++;
+
+***************
+*** 7894,7900 ****
+ int we_cancel = 0, width;
+ CONTEXT_S *save_context = NULL;
+ char buf[MAX_SCREEN_COLS+1], sbuf[MAX_SCREEN_COLS+1];
+! char *save_ref = NULL;
+ #define FILTMSG_MAX 30
+
+ if(!stream)
+--- 7903,7909 ----
+ int we_cancel = 0, width;
+ CONTEXT_S *save_context = NULL;
+ char buf[MAX_SCREEN_COLS+1], sbuf[MAX_SCREEN_COLS+1];
+! char *save_ref = NULL, *save_dstfldr = NULL, *save_dstfldr2 = NULL;
+ #define FILTMSG_MAX 30
+
+ if(!stream)
+***************
+*** 7928,7933 ****
+--- 7937,7952 ----
+ if(F_OFF(F_QUELL_FILTER_MSGS, ps_global))
+ we_cancel = busy_cue(buf, NULL, 0);
+
++ #ifndef _WINDOWS
++ if(!struncmp(dstfldr, "#md/", 4) || !struncmp(dstfldr, "#mc/", 4)){
++ char tmp1[MAILTMPLEN];
++ maildir_file_path(dstfldr, tmp1);
++ save_dstfldr2 = dstfldr;
++ save_dstfldr = cpystr(tmp1);
++ dstfldr = save_dstfldr;
++ }
++ #endif
++
+ if(!is_absolute_path(dstfldr)
+ && !(save_context = default_save_context(ps_global->context_list)))
+ save_context = ps_global->context_list;
+***************
+*** 7991,7996 ****
+--- 8010,8020 ----
+ if(we_cancel)
+ cancel_busy_cue(buf[0] ? 0 : -1);
+
++ if(save_dstfldr){
++ fs_give((void **)&save_dstfldr);
++ dstfldr = save_dstfldr2;
++ }
++
+ return(buf[0] != '\0');
+ }
+
+diff -rc alpine-2.00/pith/pine.hlp alpine-2.00.maildir/pith/pine.hlp
+*** alpine-2.00/pith/pine.hlp 2008-08-22 19:07:05.000000000 -0500
+--- alpine-2.00.maildir/pith/pine.hlp 2011-01-15 19:11:07.000000000 -0600
+***************
+*** 21253,21258 ****
+--- 21253,21354 ----
+ &lt;End of help on this topic&gt;
+ </BODY>
+ </HTML>
++ ====== h_config_maildir_location ======
++ <HTML>
++ <HEAD>
++ <TITLE>OPTION: <!--#echo var="VAR_maildir-location"--></TITLE>
++ </HEAD>
++ <BODY>
++ <H1>OPTION: <!--#echo var="VAR_maildir-location"--></H1>
++
++ <P>
++ This option should be used only if you have a Maildir folder which you
++ want to use as your INBOX. If this is not your case (or don't know what
++ this is), you can safely ignore this option.
++
++ <P>
++ This option overrides the default directory Pine uses to find the location of
++ your INBOX, in case this is in Maildir format. The default value of this
++ option is "Maildir", but in some systems, this directory could have been
++ renamed (e.g. to ".maildir"). If this is your case use this option to change
++ the default.
++
++ <P>
++ The value of this option is prefixed with the "~/" string to determine the
++ full path to your INBOX.
++
++ <P>
++ You should probably <A HREF="h_config_maildir">read</A> a few tips that
++ teach you how to configure your maildir for optimal performance. This
++ version also has <A HREF="h_config_courier_list">support</A> for the
++ Courier style file system when a maildir collection is accessed locally.
++
++ <P><UL>
++ <LI><A HREF="h_finding_help">Finding more information and requesting help</A>
++ </UL>
++ <P>
++ &lt;End of help on this topic&gt;
++ </BODY>
++ </HTML>
++ ====== h_config_maildir =====
++ <HTML>
++ <HEAD>
++ <TITLE>Maildir Support</TITLE>
++ </HEAD>
++ <BODY>
++ <H1>Maildir Support</H1>
++
++ This version of Alpine has been enhanced with Maildir support. This text is
++ intended to be a reference on its support.
++ <P>
++
++ A Maildir folder is a directory that contains three directories called
++ cur, tmp and new. A program that delivers mail (e.g. postfix) will put new
++ mail in the new directory. A program that reads mail will look for for old
++ messages in the cur directory, while it will look for new mail in the new
++ directory.
++ <P>
++
++ In order to use maildir support it is better to set your inbox-path to the
++ value &quot;#md/inbox&quot; (without quotes). This assumes that your mail
++ delivery agent is delivering new mail to ~/Maildir/new. If the directory
++ where new mail is being delivered is not called "Maildir", you can set the
++ name of the subdirectory of home where it is being delivered in the <A
++ HREF="h_config_maildir_location"><!--#echo var="VAR_maildir-location"--></A> configuration
++ variable. Most of the time you will not have to worry about the
++ <!--#echo var="VAR_maildirlocation"--> variable, because it will probably be set by your
++ administrator in the pine.conf configuration file.
++ <P>
++
++ One of the advantages of the Maildir support of this version of Alpine is
++ that you do not have to stop using folders in another styles (mbox, mbx,
++ etc.). This is desirable since the usage of a specific mail storage system
++ is a personal decision. Folders in the maildir format that are part of the
++ Mail collection will be recognized without any extra configuration of your
++ part. If your mail/ collection is located under the mail/ directory, then
++ creating a new maildir folder in this collection is done by pressing "A"
++ and entering the string "#driver.md/mail/newfolder". Observe that adding a
++ new folder as "newfolder" may not create such folder in maildir format.
++
++ <P>
++ If you would like to have all folders created in the maildir format by
++ default, you do so by adding a Maildir Collection. In order to convert
++ your current mail/ collection into a maildir collection, edit the
++ collection and change the path variable from &quot;mail/&quot; to
++ &quot;#md/mail&quot;. In a maildir collection folders of any other format
++ are ignored.
++
++ <P> Finally, This version also has
++ <A HREF="h_config_courier_list">support</A> for the Courier style file system
++ when a maildir collection is accessed locally.
++
++ <P>
++ <UL>
++ <LI><A HREF="h_finding_help">Finding more information and requesting help</A>
++ </UL><P>
++ &lt;End of help on this topic&gt;
++ </BODY>
++ </HTML>
+ ====== h_config_literal_sig =====
+ <HTML>
+ <HEAD>
+***************
+*** 29126,29131 ****
+--- 29222,29270 ----
+ <P>
+ &lt;End of help on this topic&gt;
+ </BODY>
++ </HTML>
++ ====== h_config_courier_list =====
++ <HTML>
++ <HEAD>
++ <TITLE>FEATURE: <!--#echo var="FEAT_courier-folder-list"--></TITLE>
++ </HEAD>
++ <BODY>
++ <H1>FEATURE: <!--#echo var="FEAT_courier-folder-list"--></H1>
++
++ In a maildir collection, a folder could be used as a directory to store
++ folders. In the Courier server if you create a folder, then a directory
++ with the same name is created. If you use this patch to access a
++ collection created by the Courier server, then the display of such
++ collection will look confusing. The best way to access a maildir
++ collection created by the Courier server is by using the &quot;#mc/&quot;
++ prefix instead of the &quot;#md/&quot; prefix. If you use this alternate
++ prefix, then this feature applies to you, otherwise you can safely ignore
++ the text that follows.
++ <P>
++ Depending on if you have enabled the option
++ <a href="h_config_separate_fold_dir_view"><!--#echo var="FEAT_separate-folder-and-directory-entries"--></a>
++ a folder may be listed as &quot;folder[.]&quot;, or as two entries in the
++ list by &quot;folder&quot; and &quot;folder.&quot;.
++ <P>
++ If this option is disabled, Pine will list local folders that are in Courier
++ style format, as &quot;folder&quot;, and those that are also directories as
++ &quot;folder[.]&quot;. This makes the default display cleaner.
++ <P>
++ If this feature is enabled then creating folders in a maildir collection
++ will create a directory with the same name. If this feature is disabled, then
++ a folder is considered a directory only if it contains subfolders, so you can
++ not create a directory with the same name as an exisiting folder unless
++ you create a subfolder of that folder first (e.g. if you have a folder
++ called &quot;foo&quot; simply add &quot;foo.bar&quot; directly. This will
++ create the directory &quot;foo&quot; and the subfolder &quot;bar&quot; of it).
++ <P>
++ Observe that this feature works only for maildir collections that are accessed
++ locally. If a collection is accessed remotely then this feature has no value,
++ as the report is created in a server, and Pine only reports what received
++ from the server in this case.
++ <P>
++ &lt;End of help on this topic&gt;
++ </BODY>
+ </HTML>
+ ====== h_config_verbose_post =====
+ <HTML>
+diff -rc alpine-2.00/pith/send.c alpine-2.00.maildir/pith/send.c
+*** alpine-2.00/pith/send.c 2008-08-06 13:25:58.000000000 -0500
+--- alpine-2.00.maildir/pith/send.c 2011-01-15 19:11:07.000000000 -0600
+***************
+*** 256,261 ****
+--- 256,268 ----
+
+ if(exists & FEX_ISFILE){
+ context_apply(tmp, p_cntxt, mbox, sizeof(tmp));
++ #ifndef _WINDOWS
++ if (!struncmp(tmp, "#md/",4) || !struncmp(tmp, "#mc/", 4)){
++ char tmp2[MAILTMPLEN];
++ maildir_file_path(tmp, tmp2);
++ strcpy(tmp, tmp2);
++ }
++ #endif
+ if(!(IS_REMOTE(tmp) || is_absolute_path(tmp))){
+ /*
+ * The mbox is relative to the home directory.
+diff -rc alpine-2.00/README.maildir alpine-2.00.maildir/README.maildir
+*** alpine-2.00/README.maildir 2011-01-24 19:38:50.000000000 -0600
+--- alpine-2.00.maildir/README.maildir 2011-01-15 19:11:07.000000000 -0600
+***************
+*** 0 ****
+--- 1,153 ----
++ ---------------------------------------
++
++ Maildir Driver for Alpine 1.0
++ By Eduardo Chappa <chappa@washington.edu>
++ http://staff.washington.edu/chappa/alpine/
++
++ ---------------------------------------
++ 1. General Information About This Patch
++ ---------------------------------------
++
++ This patch adds support for the maildir format to Alpine. We take the
++ approach that this patch is one more driver among the number of formats
++ supported by Alpine (more generally c-client). This approach differs from
++ older versions of similar patches, in that once a maildir patch was
++ applied, it was assumed that all your folders would be created in the
++ maildir format.
++
++ This patch does not assume that maildir is a preferred format, instead
++ puts maildir in equal footing with other formats (mbox, mbx, mix, etc),
++ and so a maildir folder in the mail/ collection is treated in the same way
++ as any other folder in any other format. In other words, just by reading
++ the name of a folder, or opening it, or doing any operation with it, you
++ can not know in which format the folder is.
++
++ This implies that if you want to add a folder in the maildir format to the
++ mail/ collection, then you must add by pressing "A" in the folder list
++ collection and enter "#driver.md/mail/name_maildir_folder".
++
++ If you only want to use maildir, however, you can do so too. In this case,
++ you must create a maildir collection. In that collection, only maildir
++ folders will be listed. If there is any folder in any other format, that
++ folder will be ignored. In another words, any folder listed there is in
++ maildir format and can be accessed through that collection, conversely,
++ any folder not listed there is not in maildir format and there is no way
++ to access it using this collection.
++
++ In order to create a maildir collection, you could press M S L, and "A" to
++ add a collection. Fill in the required fields as follows:
++
++ Nickname : Anything
++ Server :
++ Path : #md/relative/path/to/maildir/collection/
++ View :
++
++ For example, if "path" is set to "#md/mail/", then Alpine will look for your
++ maildir folders that are in ~/mail/.
++
++ The code in this patch is mostly based in code for the unix driver plus
++ some combinations of the mh, mbx and nntp drivers for the c-client
++ library. Those drivers were designed by Mark Crispin, and bugs in this
++ code are not his bugs, but my own.
++
++ I got all the specification for this patch from
++ http://cr.yp.to/proto/maildir.html. If you know of a place with a better
++ specification for maildir format please let me know. The method this patch
++ uses to create a unique filename for a message is one of the "old
++ fashioned" methods. I realize that this is old fashioned, but it is
++ portable, and portability is the main reason why I decided to use an old
++ fashioned method (most methods are not portable. See the word
++ "Unfortunately" in that document).
++
++ --------------
++ 2. Other Goals
++ --------------
++
++ It is intended that this code will work well with any application
++ written using the c-client library. Of paramount importance is to make the
++ associated imap server work well when the server accesses a folder in
++ Maildir format. The program mailutil should also work flawlessly with this
++ implemetation of the driver.
++
++ It is intended that this driver be fast and stable. We intend not to
++ patch Alpine to make this driver do its work, unless such patching is for
++ fixing bugs in Alpine or to pass parameters to the driver.
++
++ ------------------------------------------------------------------------
++ 3. What are the known bugs of this implementation of the Maildir driver?
++ ------------------------------------------------------------------------
++
++ I don't know any at this time. There have been bugs before, though, but
++ I try to fix bugs as soon as they are reported. A complete list of updates
++ for this patch, which includes bug fixes, improvements and addition of new
++ features can be found at
++
++ http://staff.washington.edu/chappa/alpine/updates/maildir.html
++
++ ----------
++ 4. On UIDs
++ ----------
++
++ This patch keeps uids in the name of the file that contains the message,
++ by adding a ",u=" string to the file name to save the uid of a message. A
++ file is kept between sessions to save information on the last uid assigned
++ and its time of validity. Only one session with writing access can write
++ uids, all others must wait for the other session to assign them. The
++ session assigning uids creates a ".uidtemp" file which other sessions must
++ not disturb.
++
++ Uid support appeared in Alpine 1.00 (snapshot 925), and is experimental,
++ please report any problems.
++
++ --------------------------------------------
++ 5. Configuring Alpine and Setting up a Maildir
++ --------------------------------------------
++
++ Once this approach was chosen, it implied the following:
++
++ * This patch assumes that your INBOX is located at "$HOME/Maildir".
++ This is a directory which should have three subdirectories "cur",
++ "tmp" and "new". Mail is delivered to 'new' and read from 'cur'. I
++ have added a configuration option "maildir-location" which can be
++ used to tell Alpine where your Maildir inbox is, in case your system
++ do not use the above directory (e.g. your system may use
++ "~/.maildir"). In this case define that variable to be the name of
++ the directory where your e-mail is being delivered (e.g.
++ ".maildir").
++
++ * If you want to use the above configuration as your inbox, you must
++ define your inbox-path as "#md/inbox" (no quotes). You can define
++ the inbox-path like above even if you have changed the
++ maildir-location variable. That's the whole point of that variable.
++
++ -----------------------------------
++ 6. What about Courier file systems?
++ -----------------------------------
++
++ In a courier file system all folders are subfolders of a root folder
++ called INBOX. Normally INBOX is located at ~/Maildir and subfolders are
++ "dot" directories in ~/Maildir. For example ~/Maildir/.Trash is a
++ subfolder of INBOX and is accessed with the nickname "INBOX.Trash".
++
++ You can not access folders in this way unless you preceed them with the
++ string "#mc/". The purpose of the string "#mc/" is to warn Alpine that a
++ collection in the Courier format is going to be accessed, so you can
++ SELECT a folder like "#mc/INBOX.Trash", but not "INBOX.Trash"
++
++ You can access a collection through a server, but if you want to access a
++ collection of folders created using the Courier server, you MUST edit your
++ ".pinerc" file and enter the definition of the collection as follows:
++
++ folder-collections="Anything you want" #mc/INBOX.[]
++
++ You can replace the string "#mc/INBOX." by something different, for example
++ "#mc/Courier/." will make Alpine search for your collection in ~/Courier.
++
++ You can not add this directly into Alpine because Alpine fails to accept this
++ value from its input, but it takes it correctly when it is added through
++ the ".pinerc" file.
++
++ You can access your inbox as "#mc/INBOX" or "#md/INBOX". Both definitions
++ point to the same place.
++
++ Last Updated February 9, 2008
diff --git a/extra/rhythmbox/PKGBUILD b/extra/rhythmbox/PKGBUILD
index 7176a7ce2..29a97dc46 100644
--- a/extra/rhythmbox/PKGBUILD
+++ b/extra/rhythmbox/PKGBUILD
@@ -1,9 +1,9 @@
-# $Id: PKGBUILD 125726 2011-05-28 15:54:25Z ibiru $
+# $Id: PKGBUILD 127104 2011-06-10 17:27:06Z ibiru $
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
pkgname=rhythmbox
-pkgver=2.90.1.git20110528
+pkgver=2.90.1.git20110610
pkgrel=1
pkgdesc="An iTunes-like music player/libary"
arch=('i686' 'x86_64')
@@ -11,7 +11,7 @@ license=('GPL')
url="http://www.rhythmbox.org"
depends=('libgpod' 'gvfs-afc' 'libgnome-media-profiles' 'totem-plparser' 'libsoup-gnome' 'gtk3' 'libmusicbrainz3' 'libmtp' 'libnotify'
'lirc-utils' 'libwebkit3' 'libdmapsharing' 'media-player-info' 'pygobject' 'gstreamer0.10-python' 'python-gnomekeyring' 'gstreamer0.10-base-plugins'
- 'gstreamer0.10-good-plugins' 'json-glib' 'desktop-file-utils' 'libpeas' 'python-mako')
+ 'gstreamer0.10-good-plugins' 'json-glib' 'desktop-file-utils' 'libpeas' 'python-mako' 'dconf')
makedepends=('pkgconfig' 'gnome-doc-utils>=0.20.1' 'intltool' 'brasero' 'gnome-common' 'gtk-doc' 'gobject-introspection')
optdepends=('gstreamer0.10-ugly-plugins: Extra media codecs'
'gstreamer0.10-bad-plugins: Extra media codecs'
@@ -21,7 +21,7 @@ options=('!libtool' '!emptydirs' '!strip')
install=rhythmbox.install
#source=(http://ftp.gnome.org/pub/GNOME/sources/${pkgname}/0.13/${pkgname}-${pkgver}.tar.bz2)
source=(ftp://ftp.archlinux.org/other/${pkgname}/${pkgname}-${pkgver}.tar.xz)
-sha256sums=('8e73675d36a90950034862e1aaa8db96267c8c4563823983d3ee2dc239c0a4f0')
+sha256sums=('20e9bf31f3fbd2b4e4db86ab12aeee8175a8a49a5c3ec2081a8ca3880d01fba0')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
diff --git a/testing/kdeaccessibility/PKGBUILD b/testing/kdeaccessibility/PKGBUILD
new file mode 100644
index 000000000..646a47d71
--- /dev/null
+++ b/testing/kdeaccessibility/PKGBUILD
@@ -0,0 +1,98 @@
+# $Id: PKGBUILD 126536 2011-06-06 06:09:32Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgbase=kdeaccessibility
+pkgname=('kdeaccessibility-colorschemes'
+ 'kdeaccessibility-iconthemes'
+ 'kdeaccessibility-jovie'
+ 'kdeaccessibility-kaccessible'
+ 'kdeaccessibility-kmag'
+ 'kdeaccessibility-kmousetool'
+ 'kdeaccessibility-kmouth')
+pkgver=4.6.4
+pkgrel=1
+arch=('i686' 'x86_64')
+url='http://accessibility.kde.org'
+license=('GPL' 'FDL')
+groups=('kde' 'kdeaccessibility')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'kdebase-runtime'
+ 'speech-dispatcher')
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgbase}-${pkgver}.tar.bz2")
+sha1sums=('5a8ede86e6a483379ff62c1d85445c93c8400857')
+
+build() {
+ cd ${srcdir}
+ mkdir build
+ cd build
+ cmake ../${pkgbase}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DWITH_Opentts=OFF
+ make
+}
+
+package_kdeaccessibility-colorschemes() {
+ pkgdesc='KDE Accessibility color schemes'
+ cd $srcdir/build/ColorSchemes
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeaccessibility-iconthemes() {
+ pkgdesc='KDE Accessibility icon themes'
+ cd $srcdir/build/IconThemes
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeaccessibility-jovie() {
+ pkgdesc='A text to speech application'
+ depends=('kdebase-runtime' 'speech-dispatcher')
+ replaces=('kdeaccessibility-kttsd')
+ install='kdeaccessibility.install'
+ cd $srcdir/build/jovie
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/jovie
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeaccessibility-kaccessible() {
+ pkgdesc='Provides accessibility services like focus tracking and a screenreader'
+ depends=('kdebase-runtime' 'speech-dispatcher')
+ install='kdeaccessibility.install'
+ cd $srcdir/build/kaccessible
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeaccessibility-kmag() {
+ pkgdesc='Screen Magnifier'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/utilities/kmag/"
+ install='kdeaccessibility.install'
+ cd $srcdir/build/kmag
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kmag
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeaccessibility-kmousetool() {
+ pkgdesc='Clicks the mouse for you, reducing the effects of RSI'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/utilities/kmousetool/"
+ install='kdeaccessibility.install'
+ cd $srcdir/build/kmousetool
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kmousetool
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeaccessibility-kmouth() {
+ pkgdesc='Speech Synthesizer Frontend'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/utilities/kmouth/"
+ install='kdeaccessibility.install'
+ cd $srcdir/build/kmouth
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kmouth
+ make DESTDIR=$pkgdir install
+}
diff --git a/testing/kdeaccessibility/kdeaccessibility.install b/testing/kdeaccessibility/kdeaccessibility.install
new file mode 100644
index 000000000..e70c054ec
--- /dev/null
+++ b/testing/kdeaccessibility/kdeaccessibility.install
@@ -0,0 +1,11 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdeadmin/PKGBUILD b/testing/kdeadmin/PKGBUILD
new file mode 100644
index 000000000..de420aef1
--- /dev/null
+++ b/testing/kdeadmin/PKGBUILD
@@ -0,0 +1,80 @@
+# $Id: PKGBUILD 126537 2011-06-06 06:09:35Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgbase=kdeadmin
+pkgname=('kdeadmin-kcron'
+ 'kdeadmin-ksystemlog'
+ 'kdeadmin-kuser'
+ 'kdeadmin-system-config-printer-kde')
+pkgver=4.6.4
+pkgrel=1
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL' 'FDL')
+groups=('kde' 'kdeadmin')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'kdebindings-python'
+ 'system-config-printer-common' 'python2-pyqt')
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgbase}-${pkgver}.tar.bz2"
+ 'syslog-path.patch')
+sha1sums=('5f683dbdeec75b4baa025a987692a63912b7e4af'
+ '20095ce6e0f3e5b6800a7c6e52de6fddba62c031')
+
+build() {
+ cd ${srcdir}/${pkgbase}-${pkgver}
+ patch -p1 -i ${srcdir}/syslog-path.patch
+
+ cd ${srcdir}
+ mkdir build
+ cd build
+ cmake ../${pkgbase}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DBUILD_kpackage=OFF \
+ -DBUILD_knetworkconf=OFF \
+ -DBUILD_lilo-config=OFF \
+ -DBUILD_strigi-analyzer=OFF
+ make
+}
+
+package_kdeadmin-kcron() {
+ pkgdesc='Configure and schedule tasks'
+ depends=('kdelibs')
+ cd $srcdir/build/kcron
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kcron
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeadmin-ksystemlog() {
+ pkgdesc='System log viewer tool'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/system/ksystemlog/"
+ cd $srcdir/build/ksystemlog
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/ksystemlog
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeadmin-kuser() {
+ pkgdesc='User Manager'
+ depends=('kdepim-runtime')
+ url="http://kde.org/applications/system/kuser/"
+ install='kdeadmin.install'
+ cd $srcdir/build/kuser
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kuser
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeadmin-system-config-printer-kde() {
+ pkgdesc='Configure local and remote Printers'
+ depends=('kdebindings-python' 'system-config-printer-common' 'python2-pyqt')
+ url="http://kde.org/applications/system/printerapplet/"
+ cd $srcdir/build/system-config-printer-kde
+ make DESTDIR=$pkgdir install
+
+ # Use the python2 executable
+ find ${pkgdir} -name '*.py' | xargs sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python2|'
+}
diff --git a/testing/kdeadmin/kdeadmin.install b/testing/kdeadmin/kdeadmin.install
new file mode 100644
index 000000000..e70c054ec
--- /dev/null
+++ b/testing/kdeadmin/kdeadmin.install
@@ -0,0 +1,11 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdeadmin/syslog-path.patch b/testing/kdeadmin/syslog-path.patch
new file mode 100644
index 000000000..8a9142bf6
--- /dev/null
+++ b/testing/kdeadmin/syslog-path.patch
@@ -0,0 +1,11 @@
+--- kdeadmin-4.6.0/ksystemlog/src/modes/system/systemConfiguration.h~ 2011-01-27 14:24:29.840000005 +0100
++++ kdeadmin-4.6.0/ksystemlog/src/modes/system/systemConfiguration.h 2011-01-27 14:24:53.803333335 +0100
+@@ -39,7 +39,7 @@
+ SystemConfiguration() :
+ GenericLogModeConfiguration(
+ QLatin1String( SYSTEM_LOG_MODE_ID ),
+- QStringList() << QLatin1String( "/var/log/syslog" ),
++ QStringList() << QLatin1String( "/var/log/messages.log" ),
+ QList<int>() << INFORMATION_LOG_LEVEL_ID
+ ) {
+
diff --git a/testing/kdeartwork/PKGBUILD b/testing/kdeartwork/PKGBUILD
new file mode 100644
index 000000000..d3e8a4147
--- /dev/null
+++ b/testing/kdeartwork/PKGBUILD
@@ -0,0 +1,102 @@
+# $Id: PKGBUILD 126538 2011-06-06 06:09:39Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgbase=kdeartwork
+pkgname=('kdeartwork-aurorae'
+ 'kdeartwork-colorschemes'
+ 'kdeartwork-desktopthemes'
+ 'kdeartwork-emoticons'
+ 'kdeartwork-iconthemes'
+ 'kdeartwork-kscreensaver'
+ 'kdeartwork-sounds'
+ 'kdeartwork-styles'
+ 'kdeartwork-wallpapers'
+ 'kdeartwork-weatherwallpapers')
+pkgver=4.6.4
+pkgrel=1
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL' 'FDL')
+groups=('kde' 'kdeartwork')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'xscreensaver' 'eigen'
+ 'kdebase-workspace' 'kdegraphics-libs')
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgbase}-${pkgver}.tar.bz2")
+sha1sums=('460b8bff5f6799f0e2553e1b78112e3192ade2b3')
+
+build() {
+ cd $srcdir
+ mkdir build
+ cd build
+ cmake ../${pkgbase}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package_kdeartwork-aurorae() {
+ pkgdesc='An Aurorae theme based on the Oxygen plasma theme'
+ cd $srcdir/build/aurorae
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeartwork-colorschemes() {
+ pkgdesc='KDE color schemes'
+ cd $srcdir/build/ColorSchemes
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeartwork-desktopthemes() {
+ pkgdesc='KDE desktop themes'
+ cd $srcdir/build/desktopthemes
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeartwork-emoticons() {
+ pkgdesc='KDE emoticons'
+ cd $srcdir/build/emoticons
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeartwork-iconthemes() {
+ pkgdesc='KDE icon themes'
+ cd $srcdir/build/IconThemes
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeartwork-kscreensaver() {
+ pkgdesc='KDE screensaver'
+ depends=('kdebase-workspace' 'kdegraphics-libs')
+ cd $srcdir/build/kscreensaver
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeartwork-sounds() {
+ pkgdesc='KDE sounds'
+ cd $srcdir/build/sounds
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeartwork-styles() {
+ pkgdesc='KDE styles'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/styles
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/kwin-styles
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeartwork-wallpapers() {
+ pkgdesc='KDE wallpapers'
+ cd $srcdir/build/wallpapers
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/HighResolutionWallpapers
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeartwork-weatherwallpapers() {
+ pkgdesc='KDE weather wallpapers'
+ cd $srcdir/build/WeatherWallpapers
+ make DESTDIR=$pkgdir install
+}
diff --git a/testing/kdebase-runtime/PKGBUILD b/testing/kdebase-runtime/PKGBUILD
new file mode 100644
index 000000000..4479b4d31
--- /dev/null
+++ b/testing/kdebase-runtime/PKGBUILD
@@ -0,0 +1,38 @@
+# $Id: PKGBUILD 126530 2011-06-06 06:06:00Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgname=kdebase-runtime
+pkgver=4.6.4
+pkgrel=1
+pkgdesc="KDE Base Runtime Environment"
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL')
+depends=('kdelibs' 'ntrack' 'smbclient' 'libssh' 'libcanberra' 'oxygen-icons'
+ 'xorg-xauth' 'hicolor-icon-theme')
+makedepends=('pkg-config' 'cmake' 'automoc4' 'kdepimlibs' 'openslp' 'xine-lib')
+optdepends=('htdig: to build the search index in khelpcenter'
+ 'rarian: needed by khelpcenter'
+ 'gdb: drkonq crash handler')
+install="${pkgname}.install"
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgname}-${pkgver}.tar.bz2")
+sha1sums=('63f30be47a4b592a0820ed200004543e7cba956d')
+
+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
+ rm -f "${pkgdir}/usr/share/icons/hicolor/index.theme"
+ ln -sf /usr/lib/kde4/libexec/kdesu "${pkgdir}/usr/bin/"
+}
diff --git a/testing/kdebase-runtime/kdebase-runtime.install b/testing/kdebase-runtime/kdebase-runtime.install
new file mode 100644
index 000000000..3f06b8deb
--- /dev/null
+++ b/testing/kdebase-runtime/kdebase-runtime.install
@@ -0,0 +1,12 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+ update-mime-database usr/share/mime &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdebase-workspace/PKGBUILD b/testing/kdebase-workspace/PKGBUILD
new file mode 100644
index 000000000..f89ea885f
--- /dev/null
+++ b/testing/kdebase-workspace/PKGBUILD
@@ -0,0 +1,72 @@
+# $Id: PKGBUILD 126875 2011-06-08 14:37:38Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgname=kdebase-workspace
+pkgver=4.6.4
+pkgrel=2
+pkgdesc="KDE Base Workspace"
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL' 'FDL')
+groups=('kde')
+# note on libxdamage:
+# not detected by namcap because libgl depends on it
+# but nvidia providing libgl does not depend on libxdamage
+depends=('kdepim-runtime' 'lm_sensors' 'libraw1394' 'qimageblitz' 'libqalculate'
+ 'polkit-kde' 'consolekit' 'xorg-xprop' 'libxdamage' 'libxklavier' 'libdmtx'
+ 'xorg-xsetroot' 'libxcomposite' 'libxinerama')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'boost' 'kdebindings-python')
+replaces=('kdmtheme' 'kde-common' 'guidance-power-manager' 'policykit-kde' 'kdebase-kinfocenter')
+conflicts=('kde-common' 'guidance-power-manager' 'policykit-kde' 'kdebase-kinfocenter')
+install="${pkgname}.install"
+backup=('usr/share/config/kdm/kdmrc'
+ 'etc/pam.d/kde'
+ 'etc/pam.d/kde-np'
+ 'etc/pam.d/kscreensaver')
+options=('emptydirs')
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgname}-${pkgver}.tar.bz2"
+ 'kdm-zsh-profile.patch' 'kdm' 'kde.pam' 'kde-np.pam' 'kscreensaver.pam'
+ 'fixpath.patch' 'terminate-server.patch')
+sha1sums=('44aef9ad37cf291e9e7528b2c915f8fc129d735e'
+ '8c2bdefb23a03b753b78d16944d03fa3939d2d99'
+ '5db3a245201bd4a50e65aa2ef583cf5490e4f646'
+ 'f7b38af38549242a240f1a90ab9964ca8a366129'
+ '603cc79c4d2b4eae62bb5f244aeecb3a778b5516'
+ '106635aa1aae51d6f0668b1853f6c49a4fe9d3d8'
+ 'd7b5883f7e65c6839b1f65f94d58026673dd0226'
+ 'ac7bc292c865bc1ab8c02e6341aa7aeaf1a3eeee')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ patch -p0 -i ${srcdir}/kdm-zsh-profile.patch
+ patch -p0 -i ${srcdir}/fixpath.patch
+ patch -p0 -i ${srcdir}/terminate-server.patch
+
+ cd ${srcdir}
+ mkdir build
+ cd build
+ cmake ../${pkgname}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DWITH_Xmms=OFF \
+ -DWITH_Googlegadgets=OFF \
+ -DWITH_NetworkManager=OFF
+ make
+}
+
+package() {
+ cd $srcdir/build
+ make DESTDIR=$pkgdir install
+
+ install -D -m755 ${srcdir}/kdm ${pkgdir}/etc/rc.d/kdm
+ install -D -m644 ${srcdir}/kde.pam ${pkgdir}/etc/pam.d/kde
+ install -D -m644 ${srcdir}/kde-np.pam ${pkgdir}/etc/pam.d/kde-np
+ install -D -m644 ${srcdir}/kscreensaver.pam ${pkgdir}/etc/pam.d/kscreensaver
+ install -d -m755 ${pkgdir}/usr/share/xsessions/
+ ln -sf /usr/share/apps/kdm/sessions/kde-plasma{,-safe}.desktop ${pkgdir}/usr/share/xsessions/
+ install -d -m755 ${pkgdir}/etc/kde/{env,shutdown}
+
+ install -d -g 135 -o 135 ${pkgdir}/var/lib/kdm
+}
diff --git a/testing/kdebase-workspace/fixpath.patch b/testing/kdebase-workspace/fixpath.patch
new file mode 100644
index 000000000..be2b8383e
--- /dev/null
+++ b/testing/kdebase-workspace/fixpath.patch
@@ -0,0 +1,34 @@
+--- startkde.cmake.orig 2009-01-15 14:24:44.000000000 +0100
++++ startkde.cmake 2009-01-15 14:33:08.000000000 +0100
+@@ -34,22 +34,6 @@
+ MALLOC_CHECK_=2
+ export MALLOC_CHECK_
+
+-# in case we have been started with full pathname spec without being in PATH
+-bindir=`echo "$0" | sed -n 's,^\(/.*\)/[^/][^/]*$,\1,p'`
+-if [ -n "$bindir" ]; then
+- qbindir=`$bindir/kde4-config --qt-binaries`
+- if [ -n "$qbindir" ]; then
+- case $PATH in
+- $qbindir|$qbindir:*|*:$qbindir|*:$qbindir:*) ;;
+- *) PATH=$qbindir:$PATH; export PATH;;
+- esac
+- fi
+- case $PATH in
+- $bindir|$bindir:*|*:$bindir|*:$bindir:*) ;;
+- *) PATH=$bindir:$PATH; export PATH;;
+- esac
+-fi
+-
+ # Boot sequence:
+ #
+ # kdeinit is used to fork off processes which improves memory usage
+@@ -206,7 +190,7 @@
+ # For anything else (that doesn't set env vars, or that needs a window manager),
+ # better use the Autostart folder.
+
+-libpath=`kde4-config --path lib | tr : '\n'`
++libpath=`kde4-config --path lib | tr : '\n'`$(echo -e '\n/etc/kde/lib/')
+
+ for prefix in `echo "$libpath" | sed -n -e 's,/lib[^/]*/,/env/,p'`; do
+ for file in "$prefix"*.sh; do
diff --git a/testing/kdebase-workspace/kde-np.pam b/testing/kdebase-workspace/kde-np.pam
new file mode 100644
index 000000000..81eeef47b
--- /dev/null
+++ b/testing/kdebase-workspace/kde-np.pam
@@ -0,0 +1,7 @@
+#%PAM-1.0
+auth required pam_nologin.so
+auth required pam_permit.so
+account required pam_unix.so
+password required pam_unix.so
+session required pam_unix.so
+session required pam_limits.so \ No newline at end of file
diff --git a/testing/kdebase-workspace/kde.pam b/testing/kdebase-workspace/kde.pam
new file mode 100644
index 000000000..1a259390f
--- /dev/null
+++ b/testing/kdebase-workspace/kde.pam
@@ -0,0 +1,7 @@
+#%PAM-1.0
+auth required pam_unix.so
+auth required pam_nologin.so
+account required pam_unix.so
+password required pam_unix.so
+session required pam_unix.so
+session required pam_limits.so \ No newline at end of file
diff --git a/testing/kdebase-workspace/kdebase-workspace.install b/testing/kdebase-workspace/kdebase-workspace.install
new file mode 100644
index 000000000..f7d6d305b
--- /dev/null
+++ b/testing/kdebase-workspace/kdebase-workspace.install
@@ -0,0 +1,25 @@
+post_install() {
+ groupadd -g 135 kdm &>/dev/null
+ useradd -u 135 -g kdm -d /var/lib/kdm -s /bin/false -r -M kdm &>/dev/null
+ chown -R 135:135 var/lib/kdm &>/dev/null
+ xdg-icon-resource forceupdate --theme hicolor &>/dev/null
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ getent group kdm >/dev/null 2>&1 || groupadd -g 135 kdm &>/dev/null
+ getent passwd kdm >/dev/null 2>&1 || useradd -u 135 -g kdm -d /var/lib/kdm -s /bin/false -r -M kdm &>/dev/null
+ chown -R 135:135 var/lib/kdm &>/dev/null
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+ update-desktop-database -q
+}
+
+post_remove() {
+ if getent passwd kdm >/dev/null 2>&1; then
+ userdel kdm
+ fi
+ if getent group kdm >/dev/null 2>&1; then
+ groupdel kdm
+ fi
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
diff --git a/testing/kdebase-workspace/kdm b/testing/kdebase-workspace/kdm
new file mode 100644
index 000000000..799d58f4b
--- /dev/null
+++ b/testing/kdebase-workspace/kdm
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=$(pidof -o %PPID /usr/bin/kdm)
+case "$1" in
+ start)
+ stat_busy "Starting KDE Desktop Manager"
+ [ -z "$PID" ] && /usr/bin/kdm &>/dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon kdm
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping KDE Desktop Manager"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon kdm
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/testing/kdebase-workspace/kdm-zsh-profile.patch b/testing/kdebase-workspace/kdm-zsh-profile.patch
new file mode 100644
index 000000000..779456b39
--- /dev/null
+++ b/testing/kdebase-workspace/kdm-zsh-profile.patch
@@ -0,0 +1,11 @@
+--- kdm/kfrontend/genkdmconf.c 2008-02-13 09:40:49.000000000 +0000
++++ kdm/kfrontend/genkdmconf.c 2008-05-16 12:47:36.000000000 +0000
+@@ -662,7 +662,7 @@
+ " [ -d /etc/zsh ] && zdir=/etc/zsh || zdir=/etc\n"
+ " zhome=${ZDOTDIR:-$HOME}\n"
+ " # zshenv is always sourced automatically.\n"
+-" [ -f $zdir/zprofile ] && . $zdir/zprofile\n"
++" [ -f /etc/profile ] && . /etc/profile\n"
+ " [ -f $zhome/.zprofile ] && . $zhome/.zprofile\n"
+ " [ -f $zdir/zlogin ] && . $zdir/zlogin\n"
+ " [ -f $zhome/.zlogin ] && . $zhome/.zlogin\n"
diff --git a/testing/kdebase-workspace/kscreensaver.pam b/testing/kdebase-workspace/kscreensaver.pam
new file mode 100644
index 000000000..b4d80c21f
--- /dev/null
+++ b/testing/kdebase-workspace/kscreensaver.pam
@@ -0,0 +1 @@
+auth required pam_unix_auth.so
diff --git a/testing/kdebase-workspace/terminate-server.patch b/testing/kdebase-workspace/terminate-server.patch
new file mode 100644
index 000000000..094591317
--- /dev/null
+++ b/testing/kdebase-workspace/terminate-server.patch
@@ -0,0 +1,11 @@
+--- kdm/config.def 2009-08-27 10:17:39.000000000 +0200
++++ kdm/config.def 2009-10-31 00:40:21.000000000 +0100
+@@ -1448,7 +1448,7 @@
+
+ Key: TerminateServer
+ Type: bool
+-Default: false
++Default: true
+ User: core
+ Instance: #:*/!
+ Merge: xdm
diff --git a/testing/kdebase/PKGBUILD b/testing/kdebase/PKGBUILD
new file mode 100644
index 000000000..c16031161
--- /dev/null
+++ b/testing/kdebase/PKGBUILD
@@ -0,0 +1,129 @@
+# $Id: PKGBUILD 126534 2011-06-06 06:09:24Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgbase=kdebase
+pkgname=('kdebase-dolphin'
+ 'kdebase-kdepasswd'
+ 'kdebase-kdialog'
+ 'kdebase-keditbookmarks'
+ 'kdebase-kfind'
+ 'kdebase-konqueror'
+ 'kdebase-konsole'
+ 'kdebase-kwrite'
+ 'kdebase-lib'
+ 'kdebase-plasma')
+pkgver=4.6.4
+pkgrel=1
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL' 'FDL')
+groups=('kde' 'kdebase')
+makedepends=('kdebase-workspace' 'pkgconfig' 'cmake' 'automoc4')
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgbase}-${pkgver}.tar.bz2")
+sha1sums=('aef0d3f2ed8cc54cbe1ae6025091c9e0a43235c4')
+
+build() {
+ cd ${srcdir}
+ mkdir build
+ cd build
+ cmake ../${pkgbase}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package_kdebase-dolphin() {
+ pkgdesc='File Manager'
+ depends=('kdebase-runtime' 'kdebase-lib')
+ optdepends=('ruby: servicemenu installation')
+ url="http://kde.org/applications/system/dolphin/"
+ cd $srcdir/build/dolphin
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/dolphin
+ make DESTDIR=$pkgdir install
+}
+
+package_kdebase-kdepasswd() {
+ pkgdesc='Change Password'
+ depends=('kdebase-runtime' 'kdebase-lib')
+ cd $srcdir/build/kdepasswd
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kdepasswd
+ make DESTDIR=$pkgdir install
+}
+
+package_kdebase-kdialog() {
+ pkgdesc='A utility for displaying dialog boxes from shell scripts'
+ depends=('kdebase-runtime')
+ cd $srcdir/build/kdialog
+ make DESTDIR=$pkgdir install
+}
+
+package_kdebase-keditbookmarks() {
+ pkgdesc='Bookmark Organizer and Editor'
+ depends=('kdebase-runtime')
+ cd $srcdir/build/keditbookmarks
+ make DESTDIR=$pkgdir install
+}
+
+package_kdebase-kfind() {
+ pkgdesc='Find Files/Folders'
+ depends=('kdebase-runtime' 'kdebase-lib')
+ url="http://kde.org/applications/utilities/kfind/"
+ install='kdebase.install'
+ cd $srcdir/build/kfind
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kfind
+ make DESTDIR=$pkgdir install
+}
+
+package_kdebase-konqueror() {
+ pkgdesc='KDE File Manager & Web Browser'
+ depends=('kdebase-dolphin' 'kdebase-keditbookmarks')
+ optdepends=('kwebkitpart: to enable webkit engine')
+ url="http://kde.org/applications/internet/konqueror/"
+ install='kdebase.install'
+ conflicts=('kdebase-nsplugins')
+ replaces=('kdebase-nsplugins')
+ for i in konqueror doc/konqueror nsplugins; do
+ cd $srcdir/build/${i}
+ make DESTDIR=$pkgdir install
+ done
+}
+
+package_kdebase-konsole() {
+ pkgdesc='Terminal'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/system/konsole/"
+ cd $srcdir/build/konsole
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/konsole/doc/manual
+ make DESTDIR=$pkgdir install
+}
+
+package_kdebase-kwrite() {
+ pkgdesc='Text Editor'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/utilities/kwrite/"
+ cd $srcdir/build/kwrite
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kwrite
+ make DESTDIR=$pkgdir install
+}
+
+package_kdebase-lib() {
+ pkgdesc='KDE libraries for the basic desktop applications'
+ groups=()
+ depends=('kdelibs')
+ cd $srcdir/build/lib
+ make DESTDIR=$pkgdir install
+}
+
+package_kdebase-plasma() {
+ pkgdesc='Display the contents of folders (User´s home folder as default)'
+ depends=('kdebase-workspace' 'kdebase-lib')
+ cd $srcdir/build/plasma
+ make DESTDIR=$pkgdir install
+}
diff --git a/testing/kdebase/kdebase.install b/testing/kdebase/kdebase.install
new file mode 100644
index 000000000..e70c054ec
--- /dev/null
+++ b/testing/kdebase/kdebase.install
@@ -0,0 +1,11 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdebindings/PKGBUILD b/testing/kdebindings/PKGBUILD
new file mode 100644
index 000000000..edd902881
--- /dev/null
+++ b/testing/kdebindings/PKGBUILD
@@ -0,0 +1,71 @@
+# $Id: PKGBUILD 107102 2011-01-21 11:16:03Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgbase=kdebindings
+pkgname=('kdebindings-csharp'
+ 'kdebindings-python'
+ 'kdebindings-ruby'
+ 'kdebindings-smoke')
+pkgver=4.6.4
+pkgrel=1
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'python2-pyqt' 'kdepim-runtime' 'mono'
+ 'kdegraphics-okular' 'qwt' 'boost' 'qscintilla' 'ruby')
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgbase}-${pkgver}.tar.bz2")
+sha1sums=('ee5d85598e278bda76f7937c0a832723785ffe49')
+
+build() {
+ export MONO_SHARED_DIR="${srcdir}/build/.mono"
+ mkdir -p "$MONO_SHARED_DIR"
+
+ cd ${srcdir}/build
+
+ cmake ../${pkgbase}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DRUBY_SITE_LIB_DIR="/usr/lib/ruby/site_ruby/1.9.1" \
+ -DRUBY_SITE_ARCH_DIR="/usr/lib/ruby/site_ruby/1.9.1/${CARCH}-linux" \
+ -DBUILD_falcon=OFF \
+ -DBUILD_java=OFF \
+ -DBUILD_php=OFF \
+ -DWITH_PolkitQt=OFF
+ make
+}
+
+package_kdebindings-csharp() {
+ pkgdesc='KDE bindings for mono'
+ depends=('kdebindings-smoke' 'mono')
+ export MONO_SHARED_DIR="${srcdir}/build/.mono"
+ mkdir -p "$MONO_SHARED_DIR"
+ cd $srcdir/build/csharp
+ make DESTDIR=$pkgdir install
+}
+
+package_kdebindings-python() {
+ pkgdesc='KDE bindings for python'
+ depends=('kdepim-runtime' 'python2-pyqt' 'qscintilla')
+ cd $srcdir/build/python
+ make DESTDIR=$pkgdir install
+
+ # Use the python2 executable
+ find "${pkgdir}" -name '*.py' | xargs sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python2|'
+}
+
+package_kdebindings-ruby() {
+ pkgdesc='KDE Bindings for ruby'
+ depends=('kdebindings-smoke' 'ruby')
+ cd $srcdir/build/ruby
+ make DESTDIR=$pkgdir install
+}
+
+package_kdebindings-smoke() {
+ pkgdesc='Language independent library for Qt and KDE bindings'
+ depends=('qscintilla' 'kdegraphics-okular' 'kdepim-runtime')
+ cd $srcdir/build/smoke
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/generator/smokebase
+ make DESTDIR=$pkgdir install
+}
diff --git a/testing/kdeedu/PKGBUILD b/testing/kdeedu/PKGBUILD
new file mode 100644
index 000000000..b12e6a06c
--- /dev/null
+++ b/testing/kdeedu/PKGBUILD
@@ -0,0 +1,273 @@
+# $Id: PKGBUILD 127099 2011-06-10 17:21:18Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgbase=kdeedu
+pkgname=('kdeedu-blinken'
+ 'kdeedu-cantor'
+ 'kdeedu-kalgebra'
+ 'kdeedu-kalzium'
+ 'kdeedu-kanagram'
+ 'kdeedu-kbruch'
+ 'kdeedu-kgeography'
+ 'kdeedu-khangman'
+ 'kdeedu-kig'
+ 'kdeedu-kiten'
+ 'kdeedu-klettres'
+ 'kdeedu-kmplot'
+ 'kdeedu-kstars'
+ 'kdeedu-ktouch'
+ 'kdeedu-kturtle'
+ 'kdeedu-kwordquiz'
+ 'kdeedu-libkdeedu'
+ 'kdeedu-marble'
+ 'kdeedu-parley'
+ 'kdeedu-rocs'
+ 'kdeedu-step')
+pkgver=4.6.4
+pkgrel=2
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL' 'FDL')
+groups=('kde' 'kdeedu')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'ocaml' 'facile' 'cfitsio' 'gpsd'
+ 'kdebase-runtime' 'libqalculate' 'gsl' 'boost' 'libindi' 'r' 'libspectre'
+ 'python2' 'avogadro')
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgbase}-${pkgver}.tar.bz2"
+ 'gpsd-2.96.patch'
+ 'remove-libkdeedu-libscience.patch')
+sha1sums=('c58c2afbedccfa12d25e47202da995940cc9acb4'
+ 'fd6b6b81945d951bb6ad0bb735df33c11bb2008e'
+ 'cd4e18f2b30d42f6e2bcc518ad72fd49839fd8dc')
+
+build() {
+ cd ${srcdir}/${pkgbase}-${pkgver}
+ patch -Np1 -i ${srcdir}/gpsd-2.96.patch
+ patch -p1 -i ${srcdir}/remove-libkdeedu-libscience.patch
+
+ cd ${srcdir}
+ mkdir build
+ cd build
+ cmake ../${pkgbase}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=OFF \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package_kdeedu-blinken() {
+ pkgdesc='A memory enhancement game'
+ depends=('kdebase-runtime' 'kdeedu-libkdeedu')
+ install='kdeedu.install'
+ cd $srcdir/build/blinken
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/blinken/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-cantor() {
+ pkgdesc='KDE Frontend to Mathematical Software'
+ depends=('kdeedu-libkdeedu' 'libspectre')
+ optdepends=('kdeedu-kalgebra: backend'
+ 'maxima: backend'
+ 'r: backend')
+ install='kdeedu.install'
+ cd $srcdir/build/cantor
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/cantor/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-kalgebra() {
+ pkgdesc='Math Expression Solver and Plotter'
+ depends=('kdebase-runtime')
+ install='kdeedu.install'
+ cd $srcdir/build/kalgebra
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/kalgebra/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-kalzium() {
+ pkgdesc='KDE Periodic Table of Elements'
+ depends=('kdebase-runtime' 'kdeedu-libkdeedu' 'avogadro')
+ install='kdeedu.install'
+ cd $srcdir/build/kalzium
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/kalzium/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-kanagram() {
+ pkgdesc='KDE Letter Order Game'
+ depends=('kdebase-runtime' 'kdeedu-libkdeedu')
+ install='kdeedu.install'
+ cd $srcdir/build/kanagram
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/kanagram/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-kbruch() {
+ pkgdesc='Practice exercises with fractions'
+ depends=('kdelibs' 'kdebase-runtime')
+ install='kdeedu.install'
+ cd $srcdir/build/kbruch
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/kbruch/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-kgeography() {
+ pkgdesc='A Geography Learning Program'
+ depends=('kdebase-runtime')
+ install='kdeedu.install'
+ cd $srcdir/build/kgeography
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/kgeography/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-khangman() {
+ pkgdesc='KDE Hangman Game'
+ depends=('kdebase-runtime' 'kdeedu-libkdeedu')
+ install='kdeedu.install'
+ cd $srcdir/build/khangman
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/khangman/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-kig() {
+ pkgdesc='Explore Geometric Constructions'
+ depends=('kdebase-runtime' 'boost-libs' 'python2')
+ install='kdeedu.install'
+ cd $srcdir/build/kig
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/kig/doc
+ make DESTDIR=$pkgdir install
+
+ # Use the python2 executable
+ sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python2|' ${pkgdir}/usr/bin/pykig.py
+}
+
+package_kdeedu-kiten() {
+ pkgdesc='Japanese Reference and Study Tool'
+ depends=('kdebase-runtime')
+ install='kdeedu.install'
+ cd $srcdir/build/kiten
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/kiten/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-klettres() {
+ pkgdesc='a KDE program to learn the alphabet'
+ depends=('kdebase-runtime')
+ install='kdeedu.install'
+ cd $srcdir/build/klettres
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/klettres/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-kmplot() {
+ pkgdesc='Function Plotter'
+ depends=('kdebase-runtime')
+ install='kdeedu.install'
+ cd $srcdir/build/kmplot
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/kmplot/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-kstars() {
+ pkgdesc='Desktop Planetarium'
+ depends=('kdebase-runtime' 'libindi')
+ install='kdeedu.install'
+ cd $srcdir/build/kstars
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/kstars/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-ktouch() {
+ pkgdesc='Touch Typing Tutor'
+ depends=('kdebase-runtime')
+ install='kdeedu.install'
+ cd $srcdir/build/ktouch
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/ktouch/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-kturtle() {
+ pkgdesc='Educational Programming Environment'
+ depends=('kdebase-runtime')
+ install='kdeedu.install'
+ cd $srcdir/build/kturtle
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/kturtle/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-kwordquiz() {
+ pkgdesc='A flashcard and vocabulary learning program'
+ depends=('kdebase-runtime' 'kdeedu-libkdeedu')
+ install='kdeedu.install'
+ cd $srcdir/build/kwordquiz
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/kwordquiz/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-libkdeedu() {
+ pkgdesc='Support library for KDE Educational Software'
+ groups=()
+ depends=('kdelibs')
+ install='kdeedu.install'
+ replaces=('kdeedu-data')
+ conflicts=('kdeedu-data')
+ cd $srcdir/build/libkdeedu
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-marble() {
+ pkgdesc='Desktop Globe'
+ depends=('kdebase-runtime' 'gpsd')
+ install='kdeedu.install'
+ cd $srcdir/build/marble
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/marble/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-parley() {
+ pkgdesc='Vocabulary Trainer'
+ depends=('kdebase-runtime' 'kdeedu-libkdeedu' 'kdebindings-python')
+ install='kdeedu.install'
+ cd $srcdir/build/parley
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/parley/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-rocs() {
+ pkgdesc='Graph Theory Tool for Professors and Students.'
+ depends=('kdebase-runtime' 'kdeedu-libkdeedu')
+ install='kdeedu.install'
+ cd $srcdir/build/rocs
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/rocs/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeedu-step() {
+ pkgdesc='Simulate physics experiments'
+ depends=('kdebase-runtime' 'gsl' 'libqalculate')
+ install='kdeedu.install'
+ cd $srcdir/build/step
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/step/doc
+ make DESTDIR=$pkgdir install
+}
diff --git a/testing/kdeedu/gpsd-2.96.patch b/testing/kdeedu/gpsd-2.96.patch
new file mode 100644
index 000000000..ec515e99d
--- /dev/null
+++ b/testing/kdeedu/gpsd-2.96.patch
@@ -0,0 +1,43 @@
+Index: kdeedu-4.5.5/marble/src/plugins/positionprovider/gpsd/GpsdConnection.cpp
+===================================================================
+--- kdeedu-4.5.5.orig/marble/src/plugins/positionprovider/gpsd/GpsdConnection.cpp
++++ kdeedu-4.5.5/marble/src/plugins/positionprovider/gpsd/GpsdConnection.cpp
+@@ -18,6 +18,9 @@ using namespace Marble;
+
+ GpsdConnection::GpsdConnection( QObject* parent )
+ : QObject( parent ),
++#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
++ m_gpsd("localhost", DEFAULT_GPSD_PORT),
++#endif
+ m_timer( 0 )
+ {
+ connect( &m_timer, SIGNAL( timeout() ), this, SLOT( update() ) );
+@@ -26,7 +29,11 @@ GpsdConnection::GpsdConnection( QObject*
+ void GpsdConnection::initialize()
+ {
+ m_timer.stop();
++#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
++ gps_data_t* data;
++#else
+ gps_data_t* data = m_gpsd.open();
++#endif
+ if ( data ) {
+ m_status = PositionProviderStatusAcquiring;
+ emit statusChanged( m_status );
+@@ -73,8 +80,16 @@ void GpsdConnection::initialize()
+ void GpsdConnection::update()
+ {
+ #if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 3 ) && defined( PACKET_SET )
++#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
++ if ( m_gpsd.waiting(0) ) {
++#else
+ if ( m_gpsd.waiting() ) {
++#endif
++#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
++ gps_data_t* data = m_gpsd.read();
++#else
+ gps_data_t* data = m_gpsd.poll();
++#endif
+ if ( data && data->set & PACKET_SET ) {
+ emit gpsdInfo( *data );
+ }
diff --git a/testing/kdeedu/kdeedu.install b/testing/kdeedu/kdeedu.install
new file mode 100644
index 000000000..e70c054ec
--- /dev/null
+++ b/testing/kdeedu/kdeedu.install
@@ -0,0 +1,11 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdeedu/remove-libkdeedu-libscience.patch b/testing/kdeedu/remove-libkdeedu-libscience.patch
new file mode 100644
index 000000000..a8643d49f
--- /dev/null
+++ b/testing/kdeedu/remove-libkdeedu-libscience.patch
@@ -0,0 +1,10 @@
+--- kdeedu-4.6.4/libkdeedu/CMakeLists.txt~ 2011-06-10 16:59:34.922935038 +0000
++++ kdeedu-4.6.4/libkdeedu/CMakeLists.txt 2011-06-10 16:59:56.279802081 +0000
+@@ -8,7 +8,6 @@
+
+ add_subdirectory(keduvocdocument)
+ add_subdirectory(kdeeduui)
+-add_subdirectory(libscience)
+ add_subdirectory(data)
+ #add_subdirectory(widgets)
+ add_subdirectory(qtmmlwidget)
diff --git a/testing/kdegames/PKGBUILD b/testing/kdegames/PKGBUILD
new file mode 100644
index 000000000..e57ff75ec
--- /dev/null
+++ b/testing/kdegames/PKGBUILD
@@ -0,0 +1,514 @@
+# $Id: PKGBUILD 126539 2011-06-06 06:09:42Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgbase=kdegames
+pkgname=('kdegames-bomber'
+ 'kdegames-bovo'
+ 'kdegames-granatier'
+ 'kdegames-kajongg'
+ 'kdegames-kapman'
+ 'kdegames-katomic'
+ 'kdegames-kbattleship'
+ 'kdegames-kblackbox'
+ 'kdegames-kblocks'
+ 'kdegames-kbounce'
+ 'kdegames-kbreakout'
+ 'kdegames-kdiamond'
+ 'kdegames-kfourinline'
+ 'kdegames-kgoldrunner'
+ 'kdegames-kigo'
+ 'kdegames-killbots'
+ 'kdegames-kiriki'
+ 'kdegames-kjumpingcube'
+ 'kdegames-klines'
+ 'kdegames-klickety'
+ 'kdegames-kmahjongg'
+ 'kdegames-kmines'
+ 'kdegames-knetwalk'
+ 'kdegames-kolf'
+ 'kdegames-kollision'
+ 'kdegames-konquest'
+ 'kdegames-kpatience'
+ 'kdegames-kreversi'
+ 'kdegames-kshisen'
+ 'kdegames-ksirk'
+ 'kdegames-kspaceduel'
+ 'kdegames-ksquares'
+ 'kdegames-ksudoku'
+ 'kdegames-ktron'
+ 'kdegames-ktuberling'
+ 'kdegames-kubrick'
+ 'kdegames-libkdegames'
+ 'kdegames-libkmahjongg'
+ 'kdegames-lskat'
+ 'kdegames-palapeli')
+pkgver=4.6.4
+pkgrel=1
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL' 'FDL')
+groups=('kde' 'kdegames')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'ggz-client-libs' 'twisted'
+ 'kdebindings-python' 'openal')
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgbase}-${pkgver}.tar.bz2")
+sha1sums=('a5f6d07d8149fe00dbb61ae667eea741887966f3')
+
+build() {
+ cd $srcdir
+ mkdir build
+ cd build
+ cmake ../${pkgbase}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package_kdegames-bomber() {
+ pkgdesc='Arcade Bombing Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/bomber/"
+ install='kdegames.install'
+ cd $srcdir/build/bomber
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/bomber
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-bovo() {
+ pkgdesc='Five-in-a-row Board Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/bovo/"
+ install='kdegames.install'
+ cd $srcdir/build/bovo
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/bovo
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-granatier() {
+ pkgdesc='Granatier'
+ depends=('kdebase-runtime' 'kdegames-libkdegames' 'openal')
+ url="http://kde.org/applications/games/granatier/"
+ install='kdegames.install'
+ cd $srcdir/build/granatier
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/granatier
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kajongg() {
+ pkgdesc='The ancient Chinese board game for 4 players'
+ depends=('kdegames-libkdegames' 'kdegames-libkmahjongg' 'kdebindings-python' 'twisted')
+ install='kdegames.install'
+ cd $srcdir/build/kajongg
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kajongg
+ make DESTDIR=$pkgdir install
+
+ # Use the python2 executable
+ find "${pkgdir}" -name '*.py' | xargs sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python2|'
+}
+
+package_kdegames-kapman() {
+ pkgdesc='Eat pills escaping ghosts'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/kapman/"
+ install='kdegames.install'
+ cd $srcdir/build/kapman
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kapman
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-katomic() {
+ pkgdesc='Sokoban-like Logic Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/katomic/"
+ install='kdegames.install'
+ cd $srcdir/build/katomic
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/katomic
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kbattleship() {
+ pkgdesc='Battleship Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames' 'ggz-client-libs')
+ url="http://kde.org/applications/games/kbattleship/"
+ install='kdegames-kbattleship.install'
+ cd $srcdir/build/kbattleship
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kbattleship
+ make DESTDIR=$pkgdir install
+ install -D -m644 $srcdir/${pkgbase}-${pkgver}/kbattleship/src/module.dsc \
+ $pkgdir/usr/share/ggz/kbattleship.dsc
+}
+
+package_kdegames-kblackbox() {
+ pkgdesc='Blackbox Logic Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/kblackbox/"
+ install='kdegames.install'
+ cd $srcdir/build/kblackbox
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kblackbox
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kblocks() {
+ pkgdesc='Falling Blocks Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/kblocks/"
+ install='kdegames.install'
+ cd $srcdir/build/kblocks
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kblocks
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kbounce() {
+ pkgdesc='Ball Bouncing Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/kbounce/"
+ install='kdegames.install'
+ cd $srcdir/build/kbounce
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kbounce
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kbreakout() {
+ pkgdesc='Breakout-like Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/kbreakout/"
+ install='kdegames.install'
+ cd $srcdir/build/kbreakout
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kbreakout
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kdiamond() {
+ pkgdesc='Three-in-a-row game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/kdiamond/"
+ install='kdegames.install'
+ cd $srcdir/build/kdiamond
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kdiamond
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kfourinline() {
+ pkgdesc='Four-in-a-row Board Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/kfourinline/"
+ install='kdegames-kfourinline.install'
+ cd $srcdir/build/kfourinline
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kfourinline
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kgoldrunner() {
+ pkgdesc='A game of action and puzzle-solving'
+ depends=('kdebase-runtime' 'kdegames-libkdegames' 'openal')
+ url="http://kde.org/applications/games/kgoldrunner/"
+ install='kdegames.install'
+ cd $srcdir/build/kgoldrunner
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kgoldrunner
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kigo() {
+ pkgdesc='Go Board Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames' 'gnugo')
+ url="http://kde.org/applications/games/kigo/"
+ install='kdegames-kigo.install'
+ cd $srcdir/build/kigo
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kigo
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-killbots() {
+ pkgdesc='Killbots'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/killbots/"
+ install='kdegames.install'
+ cd $srcdir/build/killbots
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/killbots
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kiriki() {
+ pkgdesc='Yahtzee-like Dice Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/kiriki/"
+ install='kdegames.install'
+ cd $srcdir/build/kiriki
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kiriki
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kjumpingcube() {
+ pkgdesc='Territory Capture Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/kjumpingcube/"
+ install='kdegames.install'
+ cd $srcdir/build/kjumpingcube
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kjumpingcube
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-klickety() {
+ pkgdesc='Board Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ replaces=('kdegames-ksame')
+ conflicts=('kdegames-ksame')
+ url="http://kde.org/applications/games/ksame/"
+ install='kdegames.install'
+ cd $srcdir/build/klickety
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/klickety
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-klines() {
+ pkgdesc='Tactical Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/klines/"
+ install='kdegames.install'
+ cd $srcdir/build/klines
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/klines
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kmahjongg() {
+ pkgdesc='Mahjongg Solitaire'
+ depends=('kdebase-runtime' 'kdegames-libkdegames' 'kdegames-libkmahjongg')
+ url="http://kde.org/applications/games/kmahjongg/"
+ install='kdegames.install'
+ cd $srcdir/build/kmahjongg
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kmahjongg
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kmines() {
+ pkgdesc='Minesweeper-like Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/kmines/"
+ install='kdegames.install'
+ cd $srcdir/build/kmines
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kmines
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-knetwalk() {
+ pkgdesc='Network Construction Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/knetwalk/"
+ install='kdegames.install'
+ cd $srcdir/build/knetwalk
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/knetwalk
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kolf() {
+ pkgdesc='Miniature Golf'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/kolf/"
+ install='kdegames-kolf.install'
+ cd $srcdir/build/kolf
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kolf
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kollision() {
+ pkgdesc='A simple ball dodging game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/kollision/"
+ install='kdegames.install'
+ cd $srcdir/build/kollision
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kollision
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-konquest() {
+ pkgdesc='Galactic Strategy Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/konquest/"
+ install='kdegames.install'
+ cd $srcdir/build/konquest
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/konquest
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kpatience() {
+ pkgdesc='Patience Card Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/kpatience/"
+ install='kdegames.install'
+ replaces=('kdegames-kpat')
+ cd $srcdir/build/kpat
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kpat
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kreversi() {
+ pkgdesc='Reversi Board Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames' 'ggz-client-libs')
+ url="http://kde.org/applications/games/kreversi/"
+ install='kdegames-kreversi.install'
+ cd $srcdir/build/kreversi
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kreversi
+ make DESTDIR=$pkgdir install
+ install -D -m644 $srcdir/${pkgbase}-${pkgver}/kreversi/module.dsc \
+ $pkgdir/usr/share/ggz/kreversi.dsc
+}
+
+package_kdegames-kshisen() {
+ pkgdesc='Shisen-Sho Mahjongg-like Tile Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames' 'kdegames-libkmahjongg')
+ url="http://kde.org/applications/games/kshisen/"
+ install='kdegames.install'
+ cd $srcdir/build/kshisen
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kshisen
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-ksirk() {
+ pkgdesc='World Domination Strategy Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/ksirk/"
+ install='kdegames.install'
+ cd $srcdir/build/ksirk
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/ksirk
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kspaceduel() {
+ pkgdesc='Space Arcade Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/kspaceduel/"
+ install='kdegames-kspaceduel.install'
+ cd $srcdir/build/kspaceduel
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kspaceduel
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-ksquares() {
+ pkgdesc='Connect the dots to create squares'
+ depends=('kdebase-runtime' 'kdegames-libkdegames' 'ggz-client-libs')
+ url="http://kde.org/applications/games/ksquares/"
+ install='kdegames-ksquares.install'
+ cd $srcdir/build/ksquares
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/ksquares
+ make DESTDIR=$pkgdir install
+ install -D -m644 $srcdir/${pkgbase}-${pkgver}/ksquares/src/module.dsc \
+ $pkgdir/usr/share/ggz/ksquares.dsc
+}
+
+package_kdegames-ksudoku() {
+ pkgdesc='KSudoku, Sudoku game & more for KDE'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/ksudoku/"
+ install='kdegames.install'
+ cd $srcdir/build/ksudoku
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/ksudoku
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-ktron() {
+ pkgdesc='Tron-like Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/ktron/"
+ install='kdegames.install'
+ cd $srcdir/build/ktron
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/ktron
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-ktuberling() {
+ pkgdesc='Picture Game for Children'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/ktuberling/"
+ install='kdegames-ktuberling.install'
+ cd $srcdir/build/ktuberling
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/ktuberling
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-kubrick() {
+ pkgdesc='A 3-D game based on Rubik´s Cube'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/kubrick/"
+ install='kdegames.install'
+ cd $srcdir/build/kubrick
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kubrick
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-libkdegames() {
+ pkgdesc='KDE game library'
+ groups=()
+ depends=('kdelibs')
+ cd $srcdir/build/libkdegames
+ make DESTDIR=$pkgdir install
+ for i in $srcdir/${pkgbase}-${pkgver}/cmake/modules/*.cmake; do
+ install -D -m644 $i $pkgdir/usr/share/apps/cmake/modules/$(basename $i)
+ done
+}
+
+package_kdegames-libkmahjongg() {
+ pkgdesc='Library used for loading and rendering of Mahjongg tilesets'
+ groups=()
+ depends=('kdelibs')
+ cd $srcdir/build/libkmahjongg
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-lskat() {
+ pkgdesc='Card Game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/lskat/"
+ install='kdegames-lskat.install'
+ cd $srcdir/build/lskat
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/lskat
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegames-palapeli() {
+ pkgdesc='Jigsaw puzzle game'
+ depends=('kdebase-runtime' 'kdegames-libkdegames')
+ url="http://kde.org/applications/games/palapeli/"
+ install='kdegames-palapeli.install'
+ cd $srcdir/build/palapeli
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/palapeli
+ make DESTDIR=$pkgdir install
+}
diff --git a/testing/kdegames/kdegames-kbattleship.install b/testing/kdegames/kdegames-kbattleship.install
new file mode 100644
index 000000000..ac4516ed0
--- /dev/null
+++ b/testing/kdegames/kdegames-kbattleship.install
@@ -0,0 +1,24 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+ update-desktop-database -q
+ ggz-config -i -f -m usr/share/ggz/kbattleship.dsc >& /dev/null
+}
+
+pre_remove() {
+ if [ -f usr/share/ggz/kbattleship.dsc ]; then
+ ggz-config -r -m usr/share/ggz/kbattleship.dsc >& /dev/null
+ fi
+}
+
+pre_upgrade() {
+ pre_remove
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+ update-desktop-database -q
+}
diff --git a/testing/kdegames/kdegames-kfourinline.install b/testing/kdegames/kdegames-kfourinline.install
new file mode 100644
index 000000000..9b20edb30
--- /dev/null
+++ b/testing/kdegames/kdegames-kfourinline.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/kdegames/kdegames-kigo.install b/testing/kdegames/kdegames-kigo.install
new file mode 100644
index 000000000..9b20edb30
--- /dev/null
+++ b/testing/kdegames/kdegames-kigo.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/kdegames/kdegames-kolf.install b/testing/kdegames/kdegames-kolf.install
new file mode 100644
index 000000000..9b20edb30
--- /dev/null
+++ b/testing/kdegames/kdegames-kolf.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/kdegames/kdegames-kreversi.install b/testing/kdegames/kdegames-kreversi.install
new file mode 100644
index 000000000..4623e6e49
--- /dev/null
+++ b/testing/kdegames/kdegames-kreversi.install
@@ -0,0 +1,22 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+ ggz-config -i -f -m usr/share/ggz/kreversi.dsc >& /dev/null
+}
+
+pre_remove() {
+ if [ -f usr/share/ggz/kreversi.dsc ]; then
+ ggz-config -r -m usr/share/ggz/kreversi.dsc >& /dev/null
+ fi
+}
+
+pre_upgrade() {
+ pre_remove
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
diff --git a/testing/kdegames/kdegames-kspaceduel.install b/testing/kdegames/kdegames-kspaceduel.install
new file mode 100644
index 000000000..9b20edb30
--- /dev/null
+++ b/testing/kdegames/kdegames-kspaceduel.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/kdegames/kdegames-ksquares.install b/testing/kdegames/kdegames-ksquares.install
new file mode 100644
index 000000000..5a619897d
--- /dev/null
+++ b/testing/kdegames/kdegames-ksquares.install
@@ -0,0 +1,22 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+ ggz-config -i -f -m usr/share/ggz/ksquares.dsc >& /dev/null
+}
+
+pre_remove() {
+ if [ -f usr/share/ggz/ksquares.dsc ]; then
+ ggz-config -r -m usr/share/ggz/ksquares.dsc >& /dev/null
+ fi
+}
+
+pre_upgrade() {
+ pre_remove
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
diff --git a/testing/kdegames/kdegames-ktuberling.install b/testing/kdegames/kdegames-ktuberling.install
new file mode 100644
index 000000000..9b20edb30
--- /dev/null
+++ b/testing/kdegames/kdegames-ktuberling.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/kdegames/kdegames-lskat.install b/testing/kdegames/kdegames-lskat.install
new file mode 100644
index 000000000..9b20edb30
--- /dev/null
+++ b/testing/kdegames/kdegames-lskat.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/kdegames/kdegames-palapeli.install b/testing/kdegames/kdegames-palapeli.install
new file mode 100644
index 000000000..c77e68041
--- /dev/null
+++ b/testing/kdegames/kdegames-palapeli.install
@@ -0,0 +1,13 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+ update-mime-database usr/share/mime &> /dev/null
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdegames/kdegames.install b/testing/kdegames/kdegames.install
new file mode 100644
index 000000000..e70c054ec
--- /dev/null
+++ b/testing/kdegames/kdegames.install
@@ -0,0 +1,11 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdegraphics/PKGBUILD b/testing/kdegraphics/PKGBUILD
new file mode 100644
index 000000000..713f57cbd
--- /dev/null
+++ b/testing/kdegraphics/PKGBUILD
@@ -0,0 +1,141 @@
+# $Id: PKGBUILD 126531 2011-06-06 06:06:03Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgbase=kdegraphics
+pkgname=('kdegraphics-gwenview'
+ 'kdegraphics-kamera'
+ 'kdegraphics-kcolorchooser'
+ 'kdegraphics-kgamma'
+ 'kdegraphics-kolourpaint'
+ 'kdegraphics-kruler'
+ 'kdegraphics-ksnapshot'
+ 'kdegraphics-libs'
+ 'kdegraphics-okular')
+pkgver=4.6.4
+pkgrel=1
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL' 'FDL')
+groups=('kde' 'kdegraphics')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'qimageblitz' 'sane' 'lcms'
+ 'libxxf86vm' 'poppler-qt' 'libspectre' 'chmlib' 'djvulibre'
+ 'ebook-tools' 'kdebase-runtime')
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgbase}-${pkgver}.tar.bz2")
+sha1sums=('a208cef52de6345996a7cc68b1c09944da7253aa')
+
+build() {
+ cd ${srcdir}
+ mkdir build
+ cd build
+ cmake ../${pkgbase}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package_kdegraphics-gwenview() {
+ pkgdesc='A simple image viewer'
+ depends=('kdebase-runtime' 'kdegraphics-libs')
+ url="http://kde.org/applications/graphics/gwenview/"
+ replaces=('gwenview' 'gwenview-i18n')
+ install='kdegraphics.install'
+ cd $srcdir/build/gwenview
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/gwenview/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegraphics-kamera() {
+ pkgdesc='Configure Kamera'
+ depends=('kdelibs' 'libgphoto2')
+ cd $srcdir/build/kamera
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/kamera/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegraphics-kcolorchooser() {
+ pkgdesc='Color Chooser'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/graphics/kcolorchooser/"
+ install='kdegraphics.install'
+ cd $srcdir/build/kcolorchooser
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegraphics-kgamma() {
+ pkgdesc='A monitor calibration tool'
+ # note on libxxf86vm:
+ # not detected by namcap because libgl depends on it
+ # but nvidia providing libgl does not depend on libxxf86vm
+ depends=('kdebase-runtime' 'libxxf86vm')
+ install='kdegraphics.install'
+ cd $srcdir/build/kgamma
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/kgamma/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegraphics-kolourpaint() {
+ pkgdesc='Paint Program'
+ depends=('kdebase-runtime' 'qimageblitz' 'kdegraphics-libs')
+ url="http://kde.org/applications/graphics/kolourpaint/"
+ install='kdegraphics.install'
+ cd $srcdir/build/kolourpaint
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/kolourpaint/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegraphics-kruler() {
+ pkgdesc='Screen Ruler'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/graphics/kruler/"
+ install='kdegraphics.install'
+ cd $srcdir/build/kruler
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/kruler/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegraphics-ksnapshot() {
+ pkgdesc='Screen Capture Program'
+ depends=('kdebase-runtime' 'kdegraphics-libs')
+ url="http://kde.org/applications/graphics/ksnapshot/"
+ install='kdegraphics.install'
+ cd $srcdir/build/ksnapshot
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/ksnapshot/doc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdegraphics-libs() {
+ pkgdesc='Support library for KDE Graphics Software'
+ groups=()
+ depends=('kdelibs' 'sane' 'lcms')
+ conflicts=('kdegraphics-ksaneplugin' 'kdegraphics-strigi-analyzer'
+ 'kdegraphics-svgpart' 'kdegraphics-thumbnailers')
+ replaces=('libkexiv2' 'libkdcraw' 'kdegraphics-ksaneplugin'
+ 'kdegraphics-strigi-analyzer' 'kdegraphics-svgpart' 'kdegraphics-thumbnailers')
+ install='kdegraphics.install'
+ for i in libs ksaneplugin strigi-analyzer svgpart thumbnailers; do
+ cd $srcdir/build/${i}
+ make DESTDIR=$pkgdir install
+ done
+ install -D -m644 $srcdir/${pkgbase}-${pkgver}/cmake/modules/FindKSane.cmake \
+ $pkgdir/usr/share/apps/cmake/modules/FindKSane.cmake
+}
+
+package_kdegraphics-okular() {
+ pkgdesc='Document Viewer'
+ depends=('kdebase-runtime' 'qimageblitz' 'poppler-qt' 'chmlib' 'djvulibre'
+ 'ebook-tools' 'libspectre')
+ url="http://kde.org/applications/graphics/okular/"
+ install='kdegraphics.install'
+ cd $srcdir/build/okular
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/okular
+ make DESTDIR=$pkgdir install
+}
diff --git a/testing/kdegraphics/kdegraphics.install b/testing/kdegraphics/kdegraphics.install
new file mode 100644
index 000000000..e70c054ec
--- /dev/null
+++ b/testing/kdegraphics/kdegraphics.install
@@ -0,0 +1,11 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdelibs/PKGBUILD b/testing/kdelibs/PKGBUILD
new file mode 100644
index 000000000..7368231c5
--- /dev/null
+++ b/testing/kdelibs/PKGBUILD
@@ -0,0 +1,63 @@
+# $Id: PKGBUILD 126527 2011-06-06 06:05:44Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgname=kdelibs
+pkgver=4.6.4
+pkgrel=1
+pkgdesc="KDE Core Libraries"
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL' 'FDL')
+depends=('strigi' 'attica' 'libxss' 'xz' 'openssl' 'soprano' 'krb5'
+ 'shared-desktop-ontologies' 'qca' 'libdbusmenu-qt' 'polkit-qt' 'grantlee'
+ 'shared-mime-info' 'enchant' 'giflib' 'jasper' 'openexr' 'xdg-utils'
+ 'phonon' 'hicolor-icon-theme' 'upower' 'udisks' 'libxcursor'
+ 'docbook-xsl')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'intltool' 'avahi' 'libgl'
+ 'hspell')
+replaces=('arts' 'kdelibs-experimental')
+install='kdelibs.install'
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgname}-${pkgver}.tar.bz2"
+ 'kde-applications-menu.patch' 'archlinux-menu.patch'
+ 'abs-syntax-highlight.patch')
+sha1sums=('088778bdda8b8c7a7b192abbf0d2a0660a20626d'
+ '86ee8c8660f19de8141ac99cd6943964d97a1ed7'
+ '63a850ab4196b9d06934f2b4a13acd9f7739bc67'
+ 'd994f262356af5b9e4e9619646e471bd98c91efb')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+
+ # avoid file conflict with gnome-menu
+ patch -p1 -i $srcdir/kde-applications-menu.patch
+ # add Archlinux menu entry
+ patch -p1 -i $srcdir/archlinux-menu.patch
+ # add syntax highlightning for PKGBUILD and .install files
+ patch -p1 -i $srcdir/abs-syntax-highlight.patch
+
+ cd ${srcdir}
+ mkdir build
+ cd build
+ cmake ../${pkgname}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DKDE_DISTRIBUTION_TEXT='Arch Linux' \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DSYSCONF_INSTALL_DIR=/etc \
+ -DHTML_INSTALL_DIR=/usr/share/doc/kde/html \
+ -DKDE_DEFAULT_HOME='.kde4' \
+ -DWITH_FAM=OFF \
+ -DKAUTH_BACKEND=PolkitQt-1
+ make
+}
+
+package() {
+ cd $srcdir/build
+ make DESTDIR=$pkgdir install
+
+ # cert bundle seems to be hardcoded
+ # link it to the one from ca-certificates
+ rm -f $pkgdir/usr/share/apps/kssl/ca-bundle.crt
+ ln -sf /etc/ssl/certs/ca-certificates.crt $pkgdir/usr/share/apps/kssl/ca-bundle.crt
+}
diff --git a/testing/kdelibs/abs-syntax-highlight.patch b/testing/kdelibs/abs-syntax-highlight.patch
new file mode 100644
index 000000000..477479a9b
--- /dev/null
+++ b/testing/kdelibs/abs-syntax-highlight.patch
@@ -0,0 +1,12 @@
+diff -Nura kdelibs-4.3.0.orig/kate/syntax/data/bash.xml kdelibs-4.3.0/kate/syntax/data/bash.xml
+--- kdelibs-4.3.0.orig/kate/syntax/data/bash.xml 2009-04-15 12:26:37.000000000 +0200
++++ kdelibs-4.3.0/kate/syntax/data/bash.xml 2009-07-30 13:24:01.000000000 +0200
+@@ -8,7 +8,7 @@
+ <!ENTITY noword "(?![\w$+-])"> <!-- no word, $, + or - following -->
+ <!ENTITY pathpart "([\w_@.&#37;*?+-]|\\ )"> <!-- valid character in a file name -->
+ ]>
+-<language name="Bash" version="2.12" kateversion="2.4" section="Scripts" extensions="*.sh;*.bash;*.ebuild;*.eclass;.bashrc;.bash_profile;.bash_login;.profile" mimetype="application/x-shellscript" casesensitive="1" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
++<language name="Bash" version="2.12" kateversion="2.4" section="Scripts" extensions="*.sh;*.bash;*.ebuild;*.eclass;.bashrc;.bash_profile;.bash_login;.profile;PKGBUILD;*.install" mimetype="application/x-shellscript" casesensitive="1" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
+
+ <!-- (c) 2004 by Wilbert Berendsen (wilbert@kde.nl)
+ Changes by Matthew Woehlke (mw_triad@users.sourceforge.net)
diff --git a/testing/kdelibs/archlinux-menu.patch b/testing/kdelibs/archlinux-menu.patch
new file mode 100644
index 000000000..546784fa2
--- /dev/null
+++ b/testing/kdelibs/archlinux-menu.patch
@@ -0,0 +1,22 @@
+--- kdelibs-4.3.98/kded/applications.menu 2010-01-31 19:28:11.000000000 +0000
++++ kdelibs-4.3.98/kded/applications.menu 2010-01-31 22:25:53.556043077 +0000
+@@ -16,11 +16,19 @@
+ </DefaultLayout>
+ <Layout>
+ <Merge type="menus"/>
++ <Menuname>Arch Linux</Menuname>
+ <Menuname>Applications</Menuname>
+ <Merge type="files"/>
+ </Layout>
+
+ <Menu>
++ <Name>Arch Linux</Name>
++ <Directory>Archlinux.directory</Directory>
++ <Include>
++ <Category>Archlinux</Category>
++ </Include>
++ </Menu>
++ <Menu>
+ <Name>Applications</Name>
+ <Directory>kde-unknown.directory</Directory>
+ <OnlyUnallocated/>
diff --git a/testing/kdelibs/kde-applications-menu.patch b/testing/kdelibs/kde-applications-menu.patch
new file mode 100644
index 000000000..4b513298a
--- /dev/null
+++ b/testing/kdelibs/kde-applications-menu.patch
@@ -0,0 +1,22 @@
+--- kdelibs-4.3.98/kded/CMakeLists.txt 2009-10-02 14:55:17.000000000 +0000
++++ kdelibs-4.3.98/kded/CMakeLists.txt 2010-01-31 22:16:13.946933892 +0000
+@@ -69,7 +69,7 @@
+ if (WIN32)
+ install( FILES applications.menu DESTINATION ${SHARE_INSTALL_PREFIX}/xdg/menus )
+ else (WIN32)
+-install( FILES applications.menu DESTINATION ${SYSCONF_INSTALL_DIR}/xdg/menus )
++install( FILES applications.menu DESTINATION ${SYSCONF_INSTALL_DIR}/xdg/menus RENAME kde-applications.menu )
+ endif (WIN32)
+ install( FILES kdedmodule.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} )
+ install( FILES kded.upd DESTINATION ${DATA_INSTALL_DIR}/kconf_update )
+--- kdelibs-4.3.98/kded/kbuildsycoca.cpp 2009-12-04 23:10:18.000000000 +0000
++++ kdelibs-4.3.98/kded/kbuildsycoca.cpp 2010-01-31 22:16:13.962766572 +0000
+@@ -302,7 +302,7 @@
+ if (!m_trackId.isEmpty())
+ g_vfolder->setTrackId(m_trackId);
+
+- VFolderMenu::SubMenu *kdeMenu = g_vfolder->parseMenu("applications.menu", true);
++ VFolderMenu::SubMenu *kdeMenu = g_vfolder->parseMenu("kde-applications.menu", true);
+
+ KServiceGroup::Ptr entry = g_bsgf->addNew("/", kdeMenu->directoryFile, KServiceGroup::Ptr(), false);
+ entry->setLayoutInfo(kdeMenu->layoutList);
diff --git a/testing/kdelibs/kdelibs.install b/testing/kdelibs/kdelibs.install
new file mode 100644
index 000000000..ce5c32e1b
--- /dev/null
+++ b/testing/kdelibs/kdelibs.install
@@ -0,0 +1,12 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+ update-mime-database usr/share/mime &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+} \ No newline at end of file
diff --git a/testing/kdemultimedia/PKGBUILD b/testing/kdemultimedia/PKGBUILD
new file mode 100644
index 000000000..5a501bab1
--- /dev/null
+++ b/testing/kdemultimedia/PKGBUILD
@@ -0,0 +1,109 @@
+# $Id: PKGBUILD 126540 2011-06-06 06:09:45Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgbase=kdemultimedia
+pkgname=('kdemultimedia-dragonplayer'
+ 'kdemultimedia-ffmpegthumbs'
+ 'kdemultimedia-juk'
+ 'kdemultimedia-kioslave'
+ 'kdemultimedia-kmix'
+ 'kdemultimedia-kscd'
+ 'kdemultimedia-mplayerthumbs')
+pkgver=4.6.4
+pkgrel=1
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL' 'FDL')
+groups=('kde' 'kdemultimedia')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'kdebase-runtime' 'tunepimp'
+ 'ffmpeg' 'mplayer' 'pulseaudio' 'libmusicbrainz3')
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgbase}-${pkgver}.tar.bz2"
+ 'mplayerthumbs.config')
+sha1sums=('22178350b72e142b9f5e65a4bb85027f82b14988'
+ 'ba016fa2563c14ffcba852c62506b66bfc6ee683')
+
+build() {
+ cd ${srcdir}
+ mkdir build
+ cd build
+ cmake ../${pkgbase}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DWITH_Xine=OFF
+ make
+}
+
+package_kdemultimedia-dragonplayer() {
+ pkgdesc='Video Player'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/multimedia/dragonplayer/"
+ install='kdemultimedia.install'
+ cd $srcdir/build/dragonplayer
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/dragonplayer
+ make DESTDIR=$pkgdir install
+}
+
+package_kdemultimedia-ffmpegthumbs() {
+ pkgdesc='Video Files (ffmpegthumbs)'
+ depends=('kdebase-runtime' 'ffmpeg')
+ install='kdemultimedia.install'
+ cd $srcdir/build/ffmpegthumbs
+ make DESTDIR=$pkgdir install
+}
+
+package_kdemultimedia-juk() {
+ pkgdesc='Music Player'
+ depends=('kdebase-runtime' 'tunepimp')
+ url="http://kde.org/applications/multimedia/juk"
+ install='kdemultimedia.install'
+ cd $srcdir/build/juk
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/juk
+ make DESTDIR=$pkgdir install
+}
+
+package_kdemultimedia-kioslave() {
+ pkgdesc='Audio CD Browser'
+ depends=('kdelibs' 'libmusicbrainz3' 'cdparanoia')
+ conflicts=('kdemultimedia-libkcddb' 'kdemultimedia-libkcompactdisc')
+ replaces=('kdemultimedia-libkcddb' 'kdemultimedia-libkcompactdisc')
+ for i in kioslave doc/kioslave libkcddb libkcompactdisc; do
+ cd $srcdir/build/${i}
+ make DESTDIR=$pkgdir install
+ done
+}
+
+package_kdemultimedia-kmix() {
+ pkgdesc='Sound Mixer'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/multimedia/kmix"
+ install='kdemultimedia.install'
+ cd $srcdir/build/kmix
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kmix
+ make DESTDIR=$pkgdir install
+}
+
+package_kdemultimedia-kscd() {
+ pkgdesc='CD Player'
+ depends=('kdebase-runtime' 'libmusicbrainz3')
+ url="http://kde.org/applications/multimedia/kscd"
+ install='kdemultimedia.install'
+ cd $srcdir/build/kscd
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kcontrol/cddbretrieval
+ make DESTDIR=$pkgdir install
+}
+
+package_kdemultimedia-mplayerthumbs() {
+ pkgdesc='Video Files (MPlayerThumbs)'
+ depends=('kdebase-runtime' 'mplayer')
+ replaces=('mplayerthumbs')
+ conflicts=('mplayerthumbs')
+ cd $srcdir/build/mplayerthumbs
+ make DESTDIR=$pkgdir install
+ install -D -m644 $srcdir/mplayerthumbs.config $pkgdir/usr/share/config/mplayerthumbs
+}
diff --git a/testing/kdemultimedia/kdemultimedia.install b/testing/kdemultimedia/kdemultimedia.install
new file mode 100644
index 000000000..e70c054ec
--- /dev/null
+++ b/testing/kdemultimedia/kdemultimedia.install
@@ -0,0 +1,11 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdemultimedia/mplayerthumbs.config b/testing/kdemultimedia/mplayerthumbs.config
new file mode 100644
index 000000000..761a17953
--- /dev/null
+++ b/testing/kdemultimedia/mplayerthumbs.config
@@ -0,0 +1,2 @@
+[MPlayerThumbsCfg]
+backend=0
diff --git a/testing/kdenetwork/PKGBUILD b/testing/kdenetwork/PKGBUILD
new file mode 100644
index 000000000..a4acbfbfb
--- /dev/null
+++ b/testing/kdenetwork/PKGBUILD
@@ -0,0 +1,116 @@
+# $Id: PKGBUILD 126547 2011-06-06 06:35:00Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgbase=kdenetwork
+pkgname=('kdenetwork-filesharing'
+ 'kdenetwork-kdnssd'
+ 'kdenetwork-kget'
+ 'kdenetwork-kopete'
+ 'kdenetwork-kppp'
+ 'kdenetwork-krdc'
+ 'kdenetwork-krfb')
+pkgver=4.6.4
+pkgrel=1
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL' 'FDL')
+groups=('kde' 'kdenetwork')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'boost' 'speex' 'ortp' 'libotr'
+ 'qca-ossl' 'kdebase-workspace' 'kdebase-lib' 'libvncserver' 'libmsn'
+ 'ppp' 'v4l-utils' 'libidn' 'rdesktop' 'qimageblitz' 'libxdamage' 'libgadu'
+ 'telepathy-qt4' 'libktorrent')
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgbase}-${pkgver}.tar.bz2")
+sha1sums=('63bb58a457aed790e109a9dbeab73abb8c7ea1b2')
+
+build() {
+ cd ${srcdir}
+ mkdir build
+ cd build
+ cmake ../${pkgbase}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DMOZPLUGIN_INSTALL_DIR=/usr/lib/mozilla/plugins/ \
+ -DWITH_Xmms=OFF \
+ -DWITH_WLM_MEDIASTREAMER=OFF \
+ -DWITH_LibMeanwhile=OFF \
+ -DWITH_msiLBC=OFF
+ make
+}
+
+package_kdenetwork-filesharing() {
+ pkgdesc='Konqueror properties dialog plugin to share a directory with the local network'
+ depends=('kdelibs' 'smbclient')
+ install='kdenetwork.install'
+ cd $srcdir/build/filesharing
+ make DESTDIR=$pkgdir install
+}
+
+package_kdenetwork-kdnssd() {
+ pkgdesc='Monitors the network for DNS-SD services'
+ depends=('kdelibs')
+ cd $srcdir/build/kdnssd
+ make DESTDIR=$pkgdir install
+}
+
+package_kdenetwork-kget() {
+ pkgdesc='Download Manager'
+ depends=('kdebase-workspace' 'kdebase-lib' 'libktorrent')
+ optdepends=('python2: YouTube plugin')
+ url="http://kde.org/applications/internet/kget/"
+ install='kdenetwork.install'
+ cd $srcdir/build/kget
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kget
+ make DESTDIR=$pkgdir install
+
+ # Use the python2 executable
+ find ${pkgdir} -name '*.py' | xargs sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python2|'
+}
+
+package_kdenetwork-kopete() {
+ pkgdesc='Instant Messenger'
+ depends=('kdebase-runtime' 'kdepimlibs' 'qca-ossl' 'libotr' 'libmsn'
+ 'libidn' 'qimageblitz' 'v4l-utils' 'libgadu')
+ url="http://kde.org/applications/internet/kopete/"
+ install='kdenetwork.install'
+ cd $srcdir/build/kopete
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kopete
+ make DESTDIR=$pkgdir install
+}
+
+package_kdenetwork-kppp() {
+ pkgdesc='Internet Dial-Up Tool'
+ depends=('kdebase-runtime' 'ppp')
+ url="http://kde.org/applications/internet/kppp/"
+ install='kdenetwork.install'
+ cd $srcdir/build/kppp
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kppp
+ make DESTDIR=$pkgdir install
+}
+
+package_kdenetwork-krdc() {
+ pkgdesc='Remote Desktop Client'
+ depends=('kdebase-runtime' 'libvncserver' 'rdesktop' 'telepathy-qt4')
+ optdepends=('kdebase-keditbookmarks: to edit bookmarks')
+ url="http://kde.org/applications/internet/krdc/"
+ cd $srcdir/build/krdc
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/krdc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdenetwork-krfb() {
+ pkgdesc='Desktop Sharing'
+ # note on libxdamage:
+ # not detected by namcap because libgl depends on it
+ # but nvidia providing libgl does not depend on libxdamage
+ depends=('kdebase-runtime' 'libvncserver' 'libxdamage')
+ cd $srcdir/build/krfb
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/krfb
+ make DESTDIR=$pkgdir install
+}
diff --git a/testing/kdenetwork/kdenetwork.install b/testing/kdenetwork/kdenetwork.install
new file mode 100644
index 000000000..e70c054ec
--- /dev/null
+++ b/testing/kdenetwork/kdenetwork.install
@@ -0,0 +1,11 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdepim-runtime/PKGBUILD b/testing/kdepim-runtime/PKGBUILD
new file mode 100644
index 000000000..27a5401b3
--- /dev/null
+++ b/testing/kdepim-runtime/PKGBUILD
@@ -0,0 +1,37 @@
+# $Id: PKGBUILD 127098 2011-06-10 17:12:13Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgname=kdepim-runtime
+pkgver=4.6.0
+pkgrel=2
+pkgdesc='KDE PIM Runtime Environment'
+arch=('i686' 'x86_64')
+url='http://pim.kde.org'
+license=('GPL' 'LGPL' 'FDL')
+depends=('kdepimlibs' 'kdebase-runtime')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'boost')
+install=${pkgname}.install
+source=("http://download.kde.org/stable/kdepim-${pkgver}/src/${pkgname}-${pkgver}.tar.bz2"
+ 'disable-l10n.patch')
+sha1sums=('2a2e29ba805ae2c94fa4da6371693e59575d3ed8'
+ 'd4f8c39911cf288973a30d4b71087906ebb26359')
+
+build() {
+ cd "${srcdir}"/${pkgname}-${pkgver}
+ patch -p1 -i "${srcdir}"/disable-l10n.patch
+
+ 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
+}
diff --git a/testing/kdepim-runtime/disable-l10n.patch b/testing/kdepim-runtime/disable-l10n.patch
new file mode 100644
index 000000000..b49cd54a8
--- /dev/null
+++ b/testing/kdepim-runtime/disable-l10n.patch
@@ -0,0 +1,10 @@
+--- kdepim-runtime-4.6.0/CMakeLists.txt~ 2011-06-10 16:49:12.130427269 +0000
++++ kdepim-runtime-4.6.0/CMakeLists.txt 2011-06-10 16:56:52.871414776 +0000
+@@ -194,7 +194,3 @@
+ update_xdg_mimetypes(${XDG_MIME_INSTALL_DIR})
+
+ macro_display_feature_log()
+-
+-find_package(Msgfmt REQUIRED)
+-find_package(Gettext REQUIRED)
+-add_subdirectory(po)
diff --git a/testing/kdepim-runtime/kdepim-runtime.install b/testing/kdepim-runtime/kdepim-runtime.install
new file mode 100644
index 000000000..c77e68041
--- /dev/null
+++ b/testing/kdepim-runtime/kdepim-runtime.install
@@ -0,0 +1,13 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+ update-mime-database usr/share/mime &> /dev/null
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdepim/PKGBUILD b/testing/kdepim/PKGBUILD
new file mode 100644
index 000000000..1f014e745
--- /dev/null
+++ b/testing/kdepim/PKGBUILD
@@ -0,0 +1,253 @@
+# $Id: PKGBUILD 126753 2011-06-07 06:46:18Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgbase=kdepim
+pkgname=('kdepim-akonadiconsole'
+ 'kdepim-akregator'
+ 'kdepim-blogilo'
+ 'kdepim-console'
+ 'kdepim-kaddressbook'
+ 'kdepim-kalarm'
+ 'kdepim-kjots'
+ 'kdepim-kleopatra'
+ 'kdepim-kmail'
+ 'kdepim-knode'
+ 'kdepim-knotes'
+ 'kdepim-kontact'
+ 'kdepim-korganizer'
+ 'kdepim-kresources'
+ 'kdepim-ktimetracker'
+ 'kdepim-libkdepim'
+ 'kdepim-wizards')
+pkgver=4.6.0
+pkgrel=1
+arch=('i686' 'x86_64')
+url='http://pim.kde.org'
+license=('GPL' 'LGPL' 'FDL')
+groups=('kde' 'kdepim')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'boost' 'kdepim-runtime' 'libxss'
+ 'pilot-link' 'kde-agent')
+source=("http://download.kde.org/stable/${pkgbase}-${pkgver}/src/${pkgbase}-${pkgver}.tar.bz2")
+sha1sums=('283ea87b68a4750194d785361f6534af59edacf9')
+
+build() {
+ cd "${srcdir}"
+ mkdir build
+ cd build
+ cmake ../${pkgbase}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DKDEPIM_BUILD_MOBILE=OFF
+ make
+}
+
+package_kdepim-akonadiconsole() {
+ pkgdesc='Akonadi Management and Debugging Console'
+ depends=('kdepim-libkdepim')
+ url='http://pim.kde.org'
+ install='kdepim.install'
+ cd "${srcdir}"/build/akonadiconsole
+ make DESTDIR="${pkgdir}" install
+}
+
+package_kdepim-akregator() {
+ pkgdesc='A Feed Reader for KDE'
+ depends=('kdepim-libkdepim')
+ url="http://kde.org/applications/internet/akregator/"
+ install='kdepim.install'
+ cd "${srcdir}"/build/akregator
+ make DESTDIR="${pkgdir}" install
+ cd "${srcdir}"/build/doc/akregator
+ make DESTDIR="${pkgdir}" install
+ cd "${srcdir}"/build/kontact/plugins/akregator
+ make DESTDIR="${pkgdir}" install
+}
+
+package_kdepim-blogilo() {
+ pkgdesc='A KDE Blogging Client'
+ depends=('kdepim-runtime')
+ url="http://kde.org/applications/internet/blogilo/"
+ replaces=('blogilo')
+ conflicts=('blogilo')
+ install='kdepim.install'
+ cd "${srcdir}"/build/blogilo
+ make DESTDIR="${pkgdir}" install
+ cd "${srcdir}"/build/doc/blogilo
+ make DESTDIR="${pkgdir}" install
+}
+
+package_kdepim-console() {
+ pkgdesc='Command line tool for accessing calendar files'
+ depends=('kdepim-runtime')
+ url='http://pim.kde.org'
+ install='kdepim.install'
+ cd "${srcdir}"/build/console
+ make DESTDIR="${pkgdir}" install
+}
+
+package_kdepim-kaddressbook() {
+ pkgdesc='Contact Manager'
+ depends=('kdepim-libkdepim')
+ url="http://kde.org/applications/office/kaddressbook/"
+ install='kdepim.install'
+ cd "${srcdir}"/build/kaddressbook
+ make DESTDIR="${pkgdir}" install
+ cd "${srcdir}"/build/kontact/plugins/kaddressbook
+ make DESTDIR="${pkgdir}" install
+ cd "${srcdir}"/build/plugins/kaddressbook
+ make DESTDIR="${pkgdir}" install
+}
+
+package_kdepim-kalarm() {
+ pkgdesc='Personal Alarm Scheduler'
+ depends=('kdepim-libkdepim')
+ url="http://kde.org/applications/utilities/kalarm/"
+ install='kdepim.install'
+ cd "${srcdir}"/build/kalarm
+ make DESTDIR="${pkgdir}" install
+ cd "${srcdir}"/build/doc/kalarm
+ make DESTDIR="${pkgdir}" install
+}
+
+package_kdepim-kjots() {
+ pkgdesc='Note Taker'
+ depends=('kdepim-libkdepim')
+ url="http://kde.org/applications/utilities/kjots/"
+ install='kdepim.install'
+ cd "${srcdir}"/build/kjots
+ make DESTDIR="${pkgdir}" install
+ cd "${srcdir}"/build/doc/kjots
+ make DESTDIR="${pkgdir}" install
+ cd "${srcdir}"/build/kontact/plugins/kjots
+ make DESTDIR="${pkgdir}" install
+}
+
+package_kdepim-kleopatra() {
+ pkgdesc='Certificate Manager and Unified Crypto GUI'
+ depends=('kdepim-libkdepim')
+ url="http://kde.org/applications/utilities/kleopatra/"
+ install='kdepim-kleopatra.install'
+ cd "${srcdir}"/build/kleopatra
+ make DESTDIR="${pkgdir}" install
+ cd "${srcdir}"/build/doc/kleopatra
+ make DESTDIR="${pkgdir}" install
+}
+
+package_kdepim-kmail() {
+ pkgdesc='Mail Client'
+ depends=('kdepim-libkdepim')
+ url="http://kde.org/applications/internet/kmail/"
+ install='kdepim-kmail.install'
+ conflicts=('kdepim-kmailcvt' 'kdepim-ksendemail' 'kdepim-libksieve'
+ 'kdepim-mimelib' 'kdepim-plugins')
+ replaces=('kdepim-kmailcvt' 'kdepim-ksendemail' 'kdepim-libksieve'
+ 'kdepim-mimelib' 'kdepim-plugins')
+ optdepends=('cyrus-sasl-plugins: CRAM-MD5 authentication')
+ for i in kmail doc/kmail kmailcvt ksendemail libksieve mailcommon \
+ nepomuk_email_feeder ontologies templateparser kontact/plugins/kmail; do
+ cd "${srcdir}"/build/${i}
+ make DESTDIR="${pkgdir}" install
+ done
+}
+
+package_kdepim-knode() {
+ pkgdesc='News Reader'
+ depends=('kdepim-libkdepim')
+ url="http://kde.org/applications/internet/knode/"
+ install='kdepim.install'
+ cd "${srcdir}"/build/knode
+ make DESTDIR="${pkgdir}" install
+ cd "${srcdir}"/build/doc/knode
+ make DESTDIR="${pkgdir}" install
+ cd "${srcdir}"/build/kontact/plugins/knode
+ make DESTDIR="${pkgdir}" install
+}
+
+package_kdepim-knotes() {
+ pkgdesc='Popup Notes'
+ depends=('kdepim-libkdepim')
+ url="http://kde.org/applications/utilities/knotes/"
+ install='kdepim.install'
+ cd "${srcdir}"/build/knotes
+ make DESTDIR="${pkgdir}" install
+ cd "${srcdir}"/build/doc/knotes
+ make DESTDIR="${pkgdir}" install
+ cd "${srcdir}"/build/kontact/plugins/knotes
+ make DESTDIR="${pkgdir}" install
+}
+
+package_kdepim-kontact() {
+ pkgdesc='Personal Information Manager'
+ depends=('kdepim-libkdepim')
+ url="http://kde.org/applications/office/kontact/"
+ install='kdepim.install'
+ conflcits=('kdepim-kontactinterfaces')
+ replaces=('kdepim-kontactinterfaces')
+ for i in kontact/src doc/kontact \
+ kontact/plugins/summary kontact/plugins/specialdates; do
+ cd "${srcdir}"/build/${i}
+ make DESTDIR="${pkgdir}" install
+ done
+}
+
+package_kdepim-korganizer() {
+ pkgdesc='Calendar and Scheduling Program'
+ depends=('kdepim-libkdepim')
+ url="http://kde.org/applications/office/korganizer"
+ install='kdepim-korganizer.install'
+ cd "${srcdir}"/build/korganizer
+ make DESTDIR="${pkgdir}" install
+ cd "${srcdir}"/build/doc/korganizer
+ make DESTDIR="${pkgdir}" install
+ cd "${srcdir}"/build/kontact/plugins/korganizer
+ make DESTDIR="${pkgdir}" install
+}
+
+package_kdepim-kresources() {
+ pkgdesc='KDE PIM resources'
+ depends=('kdepim-libkdepim')
+ url='http://pim.kde.org'
+ cd "${srcdir}"/build/kresources
+ make DESTDIR="${pkgdir}" install
+}
+
+package_kdepim-ktimetracker() {
+ pkgdesc='Personal Time Tracker'
+ depends=('kdepim-kresources')
+ url="http://kde.org/applications/utilities/ktimetracker/"
+ install='kdepim.install'
+ cd "${srcdir}"/build/ktimetracker
+ make DESTDIR="${pkgdir}" install
+ cd "${srcdir}"/build/doc/ktimetracker
+ make DESTDIR="${pkgdir}" install
+ cd "${srcdir}"/build/kontact/plugins/ktimetracker
+ make DESTDIR="${pkgdir}" install
+}
+
+package_kdepim-libkdepim() {
+ pkgdesc='Library for KDE PIM'
+ groups=()
+ depends=('kde-agent' 'kdepim-runtime')
+ url='http://pim.kde.org'
+ conflicts=('kdepim-icons' 'kdepim-libkleo' 'kdepim-libkpgp'
+ 'kdepim-strigi-analyzer' 'kdepim-akonadi')
+ replaces=('kdepim-icons' 'kdepim-libkleo' 'kdepim-libkpgp'
+ 'kdepim-strigi-analyzer' 'kdepim-akonadi')
+ for i in akonadi_next calendarsupport calendarviews incidenceeditor-ng \
+ kdgantt2 libkdepim libkdepimdbusinterfaces libkleo libkpgp \
+ messagecomposer messagecore messagelist messageviewer icons \
+ strigi-analyzer plugins/messageviewer plugins/ktexteditor; do
+ cd "${srcdir}"/build/${i}
+ make DESTDIR="${pkgdir}" install
+ done
+}
+
+package_kdepim-wizards() {
+ pkgdesc='KDE Groupware Wizard'
+ depends=('kdepim-kresources')
+ url='http://pim.kde.org'
+ cd "${srcdir}"/build/wizards
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/testing/kdepim/kdepim-kleopatra.install b/testing/kdepim/kdepim-kleopatra.install
new file mode 100644
index 000000000..81ce5c4b0
--- /dev/null
+++ b/testing/kdepim/kdepim-kleopatra.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/kdepim/kdepim-kmail.install b/testing/kdepim/kdepim-kmail.install
new file mode 100644
index 000000000..81ce5c4b0
--- /dev/null
+++ b/testing/kdepim/kdepim-kmail.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/kdepim/kdepim-korganizer.install b/testing/kdepim/kdepim-korganizer.install
new file mode 100644
index 000000000..81ce5c4b0
--- /dev/null
+++ b/testing/kdepim/kdepim-korganizer.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/kdepim/kdepim.install b/testing/kdepim/kdepim.install
new file mode 100644
index 000000000..e70c054ec
--- /dev/null
+++ b/testing/kdepim/kdepim.install
@@ -0,0 +1,11 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdepimlibs/PKGBUILD b/testing/kdepimlibs/PKGBUILD
new file mode 100644
index 000000000..84a193b31
--- /dev/null
+++ b/testing/kdepimlibs/PKGBUILD
@@ -0,0 +1,32 @@
+# $Id: PKGBUILD 126528 2011-06-06 06:05:50Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgname=kdepimlibs
+pkgver=4.6.4
+pkgrel=1
+pkgdesc="KDE PIM Libraries"
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL')
+depends=('kdelibs' 'gpgme' 'akonadi' 'libical' )
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'boost' 'cyrus-sasl' 'openldap')
+install='kdepimlibs.install'
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgname}-${pkgver}.tar.bz2")
+sha1sums=('b7e48da0a3fa9c4d435ed2224909a5441450334f')
+
+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
+}
diff --git a/testing/kdepimlibs/kdepimlibs.install b/testing/kdepimlibs/kdepimlibs.install
new file mode 100644
index 000000000..99262607c
--- /dev/null
+++ b/testing/kdepimlibs/kdepimlibs.install
@@ -0,0 +1,11 @@
+post_install() {
+ update-mime-database usr/share/mime &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+} \ No newline at end of file
diff --git a/testing/kdeplasma-addons/PKGBUILD b/testing/kdeplasma-addons/PKGBUILD
new file mode 100644
index 000000000..d8482c9bf
--- /dev/null
+++ b/testing/kdeplasma-addons/PKGBUILD
@@ -0,0 +1,603 @@
+# $Id: PKGBUILD 126542 2011-06-06 06:09:53Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgbase=kdeplasma-addons
+pkgname=('kdeplasma-addons-applets-bball'
+ 'kdeplasma-addons-applets-binary-clock'
+ 'kdeplasma-addons-applets-blackboard'
+ 'kdeplasma-addons-applets-bookmarks'
+ 'kdeplasma-addons-applets-bubblemon'
+ 'kdeplasma-addons-applets-calculator'
+ 'kdeplasma-addons-applets-charselect'
+ 'kdeplasma-addons-applets-comic'
+ 'kdeplasma-addons-applets-community'
+ 'kdeplasma-addons-applets-dict'
+ 'kdeplasma-addons-applets-eyes'
+ 'kdeplasma-addons-applets-fifteenpuzzle'
+ 'kdeplasma-addons-applets-filewatcher'
+ 'kdeplasma-addons-applets-frame'
+ 'kdeplasma-addons-applets-fuzzy-clock'
+ 'kdeplasma-addons-applets-incomingmsg'
+ 'kdeplasma-addons-applets-kdeobservatory'
+ 'kdeplasma-addons-applets-kimpanel'
+ 'kdeplasma-addons-applets-knowledgebase'
+ 'kdeplasma-addons-applets-kolourpicker'
+ 'kdeplasma-addons-applets-konqprofiles'
+ 'kdeplasma-addons-applets-konsoleprofiles'
+ 'kdeplasma-addons-applets-lancelot'
+ 'kdeplasma-addons-applets-leavenote'
+ 'kdeplasma-addons-applets-life'
+ 'kdeplasma-addons-applets-luna'
+ 'kdeplasma-addons-applets-magnifique'
+ 'kdeplasma-addons-applets-mediaplayer'
+ 'kdeplasma-addons-applets-microblog'
+ 'kdeplasma-addons-applets-news'
+ 'kdeplasma-addons-applets-notes'
+ 'kdeplasma-addons-applets-nowplaying'
+ 'kdeplasma-addons-applets-paste'
+ 'kdeplasma-addons-applets-pastebin'
+ 'kdeplasma-addons-applets-plasmaboard'
+ 'kdeplasma-addons-applets-previewer'
+ 'kdeplasma-addons-applets-qalculate'
+ 'kdeplasma-addons-applets-rememberthemilk'
+ 'kdeplasma-addons-applets-rssnow'
+ 'kdeplasma-addons-applets-showdashboard'
+ 'kdeplasma-addons-applets-showdesktop'
+ 'kdeplasma-addons-applets-social-news'
+ 'kdeplasma-addons-applets-spellcheck'
+ 'kdeplasma-addons-applets-systemloadviewer'
+ 'kdeplasma-addons-applets-timer'
+ 'kdeplasma-addons-applets-unitconverter'
+ 'kdeplasma-addons-applets-weather'
+ 'kdeplasma-addons-applets-weatherstation'
+ 'kdeplasma-addons-applets-webslice'
+ 'kdeplasma-addons-containments'
+ 'kdeplasma-addons-libs'
+ 'kdeplasma-addons-runners-audioplayercontrol'
+ 'kdeplasma-addons-runners-browserhistory'
+ 'kdeplasma-addons-runners-characters'
+ 'kdeplasma-addons-runners-contacts'
+ 'kdeplasma-addons-runners-converter'
+ 'kdeplasma-addons-runners-datetime'
+ 'kdeplasma-addons-runners-events'
+ 'kdeplasma-addons-runners-katesessions'
+ 'kdeplasma-addons-runners-konquerorsessions'
+ 'kdeplasma-addons-runners-konsolesessions'
+ 'kdeplasma-addons-runners-kopete'
+ 'kdeplasma-addons-runners-mediawiki'
+ 'kdeplasma-addons-runners-spellchecker'
+ 'kdeplasma-addons-wallpapers-mandelbrot'
+ 'kdeplasma-addons-wallpapers-marble'
+ 'kdeplasma-addons-wallpapers-pattern'
+ 'kdeplasma-addons-wallpapers-virus'
+ 'kdeplasma-addons-wallpapers-weather')
+pkgver=4.6.4
+pkgrel=1
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL')
+groups=('kde' 'kdeplasma-addons')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'kdebase-workspace' 'kdegraphics-libs'
+ 'kdeedu-marble' 'eigen' 'scim' 'qwt' 'boost')
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgbase}-${pkgver}.tar.bz2")
+sha1sums=('8d107bf8cc6b6b9d66e9178b5f18bdc1751a957f')
+
+build() {
+ cd ${srcdir}
+ mkdir build
+ cd build
+ cmake ../${pkgbase}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package_kdeplasma-addons-applets-bball() {
+ pkgdesc='A bouncy ball for plasma'
+ depends=('kdebase-workspace')
+ install='kdeplasma-addons-applets.install'
+ cd $srcdir/build/applets/bball
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-binary-clock() {
+ pkgdesc='Time displayed in binary format'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/binary-clock
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-blackboard() {
+ pkgdesc='Black Board'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/blackboard
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-bookmarks() {
+ pkgdesc='Quick Access to the Bookmarks'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/bookmarks
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-bubblemon() {
+ pkgdesc='A pretty bubble that monitors your system.'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/bubblemon
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-calculator() {
+ pkgdesc='Calculate simple sums'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/calculator
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-charselect() {
+ pkgdesc='View, select, and copy characters from a font collection'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/charselect
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-comic() {
+ pkgdesc='View comic strips from the Internet'
+ depends=('kdebase-workspace' 'kdeplasma-addons-libs')
+ cd $srcdir/build/applets/comic
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-community() {
+ pkgdesc='Communicate using the Social Desktop'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/community
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-dict() {
+ pkgdesc='Look up the meaning of words and their translation into different languages'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/dict
+ make DESTDIR=$pkgdir install
+ # FIXME
+ # /usr/share/icons/oxygen/scalable/apps/accessories-dictionary.svgz
+ rm -rf $pkgdir/usr/share/icons
+}
+
+package_kdeplasma-addons-applets-eyes() {
+ pkgdesc='XEyes clone'
+ depends=('kdebase-workspace')
+ install='kdeplasma-addons-applets.install'
+ cd $srcdir/build/applets/eyes
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-fifteenpuzzle() {
+ pkgdesc='Put the pieces in order'
+ depends=('kdebase-workspace')
+ install='kdeplasma-addons-applets.install'
+ cd $srcdir/build/applets/fifteenPuzzle
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-filewatcher() {
+ pkgdesc='Watch for changes in specified files'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/fileWatcher
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-frame() {
+ pkgdesc='Display your favorite pictures'
+ depends=('kdebase-workspace' 'kdegraphics-libs')
+ cd $srcdir/build/applets/frame
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-fuzzy-clock() {
+ pkgdesc='Time displayed in a less precise format'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/fuzzy-clock
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-incomingmsg() {
+ pkgdesc='Notification of new messages'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/incomingmsg
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-kdeobservatory() {
+ pkgdesc='Visualize the KDE ecosystem'
+ depends=('kdebase-workspace' 'qwt')
+ install='kdeplasma-addons-applets.install'
+ cd $srcdir/build/applets/kdeobservatory
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-kimpanel() {
+ pkgdesc='A generic input method panel for Oriental languages'
+ depends=('kdebase-workspace')
+ optdepends=('scim: SCIM backend'
+ 'fcitx: FCITX backend')
+ cd $srcdir/build/applets/kimpanel
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-knowledgebase() {
+ pkgdesc='Opendesktop Knowledgebase'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/knowledgebase
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-kolourpicker() {
+ pkgdesc='Pick a color from the desktop'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/kolourpicker
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-konqprofiles() {
+ pkgdesc='List and launch Konqueror profiles'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/konqprofiles
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-konsoleprofiles() {
+ pkgdesc='List and launch Konsole profiles'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/konsoleprofiles
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-lancelot() {
+ pkgdesc='Launcher to start applications'
+ depends=('kdebase-workspace' 'kdeplasma-addons-libs')
+ replaces=('lancelot')
+ provides=('lancelot')
+ conflicts=('lancelot')
+ install='kdeplasma-addons-applets-lancelot.install'
+ cd $srcdir/build/applets/lancelot
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-leavenote() {
+ pkgdesc='Leave notes for users while they are away'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/leavenote
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-life() {
+ pkgdesc='Life'
+ depends=('kdebase-workspace')
+ install='kdeplasma-addons-applets.install'
+ cd $srcdir/build/applets/life
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-luna() {
+ pkgdesc='Display moon phases for your location'
+ depends=('kdebase-workspace')
+ install='kdeplasma-addons-applets.install'
+ cd $srcdir/build/applets/luna
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-magnifique() {
+ pkgdesc='A magnification glass for the Plasma desktop'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/magnifique
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-mediaplayer() {
+ pkgdesc='Widget that can play video and sound'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/mediaplayer
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-microblog() {
+ pkgdesc='Update and view your microblog status.'
+ depends=('kdebase-workspace' 'kdeplasma-addons-libs')
+ cd $srcdir/build/applets/microblog
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-news() {
+ pkgdesc='Show news from various sources'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/news
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-notes() {
+ pkgdesc='Desktop sticky notes'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/notes
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-nowplaying() {
+ pkgdesc='Displays currently playing audio'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/nowplaying
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-paste() {
+ pkgdesc='Paste text snippets'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/paste
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-pastebin() {
+ pkgdesc='Paste text/images to a remote server'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/pastebin
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-plasmaboard() {
+ pkgdesc='A virtual, on-screen keyboard'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/plasmaboard
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-previewer() {
+ pkgdesc='Preview This File'
+ depends=('kdebase-workspace')
+ install='kdeplasma-addons-applets.install'
+ cd $srcdir/build/applets/previewer
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-qalculate() {
+ pkgdesc='A powerful mathematical equation solver'
+ depends=('kdebase-workspace')
+ install='kdeplasma-addons-applets.install'
+ cd $srcdir/build/applets/qalculate
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-rememberthemilk() {
+ pkgdesc='Remember The Milk Todo list applet'
+ depends=('kdebase-workspace' 'kdeplasma-addons-libs')
+ cd $srcdir/build/applets/rememberthemilk
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-rssnow() {
+ pkgdesc='Show news from various sources'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/rssnow
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-showdashboard() {
+ pkgdesc='Show the Plasma widget dashboard above other windows'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/showdashboard
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-showdesktop() {
+ pkgdesc='Show the Plasma desktop'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/showdesktop
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-social-news() {
+ pkgdesc='Stay informed with the Social Desktop'
+ replaces=('kdeplasma-addons-applets-opendesktop' 'kdeplasma-addons-applets-opendesktop-activities')
+ conflicts=('kdeplasma-addons-applets-opendesktop' 'kdeplasma-addons-applets-opendesktop-activities')
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/social-news
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-spellcheck() {
+ pkgdesc='Fast spell checking'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/spellcheck
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-systemloadviewer() {
+ pkgdesc='Tiny CPU/RAM/Swap monitor'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/systemloadviewer
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-timer() {
+ pkgdesc='Countdown over a specified time period'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/applets/timer
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-unitconverter() {
+ pkgdesc='Plasmoid for converting units'
+ depends=('kdebase-workspace' 'kdeplasma-addons-libs')
+ cd $srcdir/build/applets/unitconverter
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-weather() {
+ pkgdesc='Displays Weather information'
+ depends=('kdebase-workspace' 'kdeplasma-addons-libs')
+ cd $srcdir/build/applets/weather
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-weatherstation() {
+ pkgdesc='Weather reports with an LCD display style'
+ depends=('kdebase-workspace' 'kdeplasma-addons-libs')
+ cd $srcdir/build/applets/weatherstation
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-applets-webslice() {
+ pkgdesc='Show a part of a webpage'
+ depends=('kdebase-workspace' 'kdeplasma-addons-libs')
+ cd $srcdir/build/applets/webslice
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-containments() {
+ pkgdesc='Activities types for Plasma shells'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/containments
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-libs() {
+ pkgdesc='Plasma Addon Library'
+ depends=('kdebase-workspace')
+ groups=()
+ replaces=('kdeplasma-addons-dataengines')
+ provides=('kdeplasma-addons-dataengines')
+ conflicts=('kdeplasma-addons-dataengines')
+ cd $srcdir/build/libs
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/dataengines
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-runners-audioplayercontrol() {
+ pkgdesc='Allows to control MPRIS audio players (it is able to search through Amarok´s collection, too)'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/runners/audioplayercontrol
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-runners-browserhistory() {
+ pkgdesc='Searches in Konqueror´s history'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/runners/browserhistory
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-runners-characters() {
+ pkgdesc='special Characters'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/runners/characters
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-runners-contacts() {
+ pkgdesc='Finds entries in your address book'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/runners/contacts
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-runners-converter() {
+ pkgdesc='Convert values to different units'
+ depends=('kdebase-workspace' 'kdeplasma-addons-libs')
+ cd $srcdir/build/runners/converter
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-runners-datetime() {
+ pkgdesc='The current date and time, locally or in any timezone'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/runners/datetime
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-runners-events() {
+ pkgdesc='Calendar Events runner'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/runners/events
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-runners-katesessions() {
+ pkgdesc='Matches Kate Sessions'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/runners/katesessions
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-runners-konquerorsessions() {
+ pkgdesc='Matches Konqueror Sessions'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/runners/konquerorsessions
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-runners-konsolesessions() {
+ pkgdesc='Matches Konsole Sessions'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/runners/konsolesessions
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-runners-kopete() {
+ pkgdesc='Kopete Contact runner'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/runners/kopete
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-runners-mediawiki() {
+ pkgdesc='Search on Wikitravel'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/runners/mediawiki
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-runners-spellchecker() {
+ pkgdesc='Check the spelling of a word'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/runners/spellchecker
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-wallpapers-mandelbrot() {
+ pkgdesc='Mandelbrot'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/wallpapers/mandelbrot
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-wallpapers-marble() {
+ pkgdesc='Globe'
+ depends=('kdebase-workspace' 'kdeedu-marble')
+ cd $srcdir/build/wallpapers/marble
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-wallpapers-pattern() {
+ pkgdesc='Pattern'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/wallpapers/pattern
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-wallpapers-virus() {
+ pkgdesc='Virus'
+ depends=('kdebase-workspace')
+ cd $srcdir/build/wallpapers/virus
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeplasma-addons-wallpapers-weather() {
+ pkgdesc='Weather'
+ depends=('kdebase-workspace' 'kdeplasma-addons-libs')
+ cd $srcdir/build/wallpapers/weather
+ make DESTDIR=$pkgdir install
+}
diff --git a/testing/kdeplasma-addons/kdeplasma-addons-applets-lancelot.install b/testing/kdeplasma-addons/kdeplasma-addons-applets-lancelot.install
new file mode 100644
index 000000000..ce5c32e1b
--- /dev/null
+++ b/testing/kdeplasma-addons/kdeplasma-addons-applets-lancelot.install
@@ -0,0 +1,12 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+ update-mime-database usr/share/mime &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+} \ No newline at end of file
diff --git a/testing/kdeplasma-addons/kdeplasma-addons-applets.install b/testing/kdeplasma-addons/kdeplasma-addons-applets.install
new file mode 100644
index 000000000..c4ef46ba8
--- /dev/null
+++ b/testing/kdeplasma-addons/kdeplasma-addons-applets.install
@@ -0,0 +1,11 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+} \ No newline at end of file
diff --git a/testing/kdeplasma-applets-networkmanagement/PKGBUILD b/testing/kdeplasma-applets-networkmanagement/PKGBUILD
new file mode 100644
index 000000000..e609c334b
--- /dev/null
+++ b/testing/kdeplasma-applets-networkmanagement/PKGBUILD
@@ -0,0 +1,35 @@
+# $Id: PKGBUILD 105813 2011-01-12 00:25:58Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Jakub Schmidtke <sjakub-at-gmail.com>
+
+pkgname=kdeplasma-applets-networkmanagement
+epoch=1
+pkgver=git20110610
+_commit=0c83d81a374ac56538b1f6257215c81478888333
+pkgrel=1
+pkgdesc="KDE control panel and widget network connections"
+arch=('i686' 'x86_64')
+url="http://www.kde.org/"
+license=('GPL')
+depends=('kdebase-workspace' 'networkmanager')
+makedepends=('cmake' 'python2' 'automoc4' 'mobile-broadband-provider-info')
+optdepends=('mobile-broadband-provider-info: allow to add new mobile connection')
+install=${pkgname}.install
+source=("${pkgname}-${pkgver}.tar.gz"::"http://quickgit.kde.org/?p=networkmanagement.git&a=snapshot&h=${_commit}")
+md5sums=('23e6c100571c23b58ba557b7a28dd053')
+
+build() {
+ cd "${srcdir}"
+ mkdir build
+ cd build
+ cmake ../networkmanagement \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DDBUS_SYSTEM_POLICY_DIR=/etc/dbus-1/system.d
+ make
+}
+
+package() {
+ cd ${srcdir}/build
+ make DESTDIR=${pkgdir} install
+}
diff --git a/testing/kdeplasma-applets-networkmanagement/kdeplasma-applets-networkmanagement.install b/testing/kdeplasma-applets-networkmanagement/kdeplasma-applets-networkmanagement.install
new file mode 100644
index 000000000..e70c054ec
--- /dev/null
+++ b/testing/kdeplasma-applets-networkmanagement/kdeplasma-applets-networkmanagement.install
@@ -0,0 +1,11 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdesdk/PKGBUILD b/testing/kdesdk/PKGBUILD
new file mode 100644
index 000000000..34fbf0237
--- /dev/null
+++ b/testing/kdesdk/PKGBUILD
@@ -0,0 +1,243 @@
+# $Id: PKGBUILD 126543 2011-06-06 06:10:01Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgbase=kdesdk
+pkgname=('kdesdk-cervisia'
+ 'kdesdk-dolphin-plugins'
+ 'kdesdk-kapptemplate'
+ 'kdesdk-kate'
+ 'kdesdk-kcachegrind'
+ 'kdesdk-kdeaccounts-plugin'
+ 'kdesdk-kdepalettes'
+ 'kdesdk-kioslave'
+ 'kdesdk-kmtrace'
+ 'kdesdk-kompare'
+ 'kdesdk-kpartloader'
+ 'kdesdk-kprofilemethod'
+ 'kdesdk-kstartperf'
+ 'kdesdk-kuiviewer'
+ 'kdesdk-lokalize'
+ 'kdesdk-okteta'
+ 'kdesdk-poxml'
+ 'kdesdk-scripts'
+ 'kdesdk-strigi-analyzer'
+ 'kdesdk-umbrello')
+pkgver=4.6.4
+pkgrel=1
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL' 'FDL')
+groups=('kde' 'kdesdk')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'boost' 'kdepim-runtime' 'subversion'
+ 'antlr2' 'kdebase-konqueror')
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgbase}-${pkgver}.tar.bz2"
+ 'fix-python2-path.patch')
+sha1sums=('6ed75cff6808aabaf3d9c3dc8601960717707c6b'
+ 'd05ca0231869c484fd3861955d960a60aff7dcfb')
+
+build() {
+ cd ${srcdir}/${pkgbase}-${pkgver}
+
+ # Fix python2 path
+ patch -Np1 -i ${srcdir}/fix-python2-path.patch
+ sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
+ -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
+ $(find . -name '*.py')
+
+ cd ${srcdir}
+ mkdir build
+ cd build
+ cmake ../${pkgbase}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package_kdesdk-cervisia() {
+ pkgdesc='CVS Frontend'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/development/cervisia/"
+ install='kdesdk.install'
+ cd $srcdir/build/cervisia
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/cervisia
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-dolphin-plugins() {
+ pkgdesc='Extra Dolphin plugins'
+ depends=('kdebase-dolphin' 'subversion' 'git' 'kdesdk-kompare')
+ install='kdesdk.install'
+ cd $srcdir/build/dolphin-plugins/git
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/dolphin-plugins/svn
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-kapptemplate() {
+ pkgdesc='KDE Template Generator'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/development/kapptemplate/"
+ install='kdesdk.install'
+ cd $srcdir/build/kapptemplate
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kapptemplate
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-kate() {
+ pkgdesc='Advanced Text Editor'
+ depends=('kdebase-runtime' 'kdebase-lib')
+ url="http://kde.org/applications/utilities/kate/"
+ install='kdesdk-kate.install'
+ cd $srcdir/build/kate
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kate
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-kcachegrind() {
+ pkgdesc='Visualization of Performance Profiling Data'
+ depends=('kdebase-runtime' 'python2')
+ optdepends=('php: PHP support')
+ url="http://kde.org/applications/development/kcachegrind/"
+ install='kdesdk.install'
+ cd $srcdir/build/kcachegrind
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kcachegrind
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-kdeaccounts-plugin() {
+ pkgdesc='KDE Repository Accounts'
+ depends=('kdepim-runtime')
+ cd $srcdir/build/kdeaccounts-plugin
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-kdepalettes() {
+ pkgdesc='Palettes for the Gimp that match the KDE standard color palette'
+ optdepends=('gimp')
+ install -D -m644 $srcdir/${pkgbase}-${pkgver}/kdepalettes/KDE_Gimp \
+ $pkgdir/usr/share/gimp/2.0/palettes/KDE.gpl
+}
+
+package_kdesdk-kioslave() {
+ pkgdesc='KDED Subversion Module'
+ depends=('kdebase-runtime' 'subversion')
+ cd $srcdir/build/kioslave
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-kmtrace() {
+ pkgdesc='A KDE tool to assist with malloc debugging using glibc´s "mtrace" functionality'
+ depends=('kdebase-runtime')
+ cd $srcdir/build/kmtrace
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kmtrace
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-kompare() {
+ pkgdesc='Diff/Patch Frontend'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/development/kompare/"
+ install='kdesdk.install'
+ cd $srcdir/build/kompare
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kompare
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-kpartloader() {
+ pkgdesc='A test application for KParts'
+ depends=('kdebase-runtime')
+ install='kdesdk.install'
+ cd $srcdir/build/kpartloader
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-kprofilemethod() {
+ pkgdesc='Macros helping to profile'
+ cd $srcdir/build/kprofilemethod
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-kstartperf() {
+ pkgdesc='Startup time measurement tool for KDE applications'
+ depends=('kdebase-runtime')
+ cd $srcdir/build/kstartperf
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-kuiviewer() {
+ pkgdesc='Qt Designer UI File Viewer'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/development/kuiviewer/"
+ install='kdesdk.install'
+ cd $srcdir/build/kuiviewer
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-lokalize() {
+ pkgdesc='Computer-Aided Translation System'
+ depends=('kdebase-runtime' 'kdebindings-python')
+ url="http://kde.org/applications/development/lokalize/"
+ optdepends=('translate-toolkit: enable extra python script')
+ install='kdesdk.install'
+ cd $srcdir/build/lokalize
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/lokalize
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-okteta() {
+ pkgdesc='Hex Editor'
+ depends=('kdebase-runtime')
+ replaces=('kdeutils-okteta')
+ conflicts=('kdeutils-okteta')
+ url="http://kde.org/applications/utilities/okteta"
+ install='kdesdk-okteta.install'
+ cd $srcdir/build/okteta
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/okteta
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-poxml() {
+ pkgdesc='Translates DocBook XML files using gettext po files'
+ depends=('qt' 'antlr2')
+ cd $srcdir/build/poxml
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/poxml
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-scripts() {
+ pkgdesc='KDE SDK scripts'
+ depends=('python2')
+ cd $srcdir/build/scripts
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/scripts
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-strigi-analyzer() {
+ pkgdesc='Strigi-Analyzer for KDE SDK'
+ depends=('kdelibs')
+ cd $srcdir/build/strigi-analyzer
+ make DESTDIR=$pkgdir install
+}
+
+package_kdesdk-umbrello() {
+ pkgdesc='UML Modeller'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/development/umbrello/"
+ install='kdesdk.install'
+ cd $srcdir/build/umbrello
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/umbrello
+ make DESTDIR=$pkgdir install
+}
diff --git a/testing/kdesdk/fix-python2-path.patch b/testing/kdesdk/fix-python2-path.patch
new file mode 100644
index 000000000..c2c0745d1
--- /dev/null
+++ b/testing/kdesdk/fix-python2-path.patch
@@ -0,0 +1,64 @@
+--- kdesdk-4.5.80/kcachegrind/converters/hotshot2calltree~ 2010-11-24 11:53:38.586666671 +0100
++++ kdesdk-4.5.80/kcachegrind/converters/hotshot2calltree 2010-11-24 11:53:38.623333337 +0100
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ # _*_ coding: latin1 _*_
+
+ #
+--- kdesdk-4.5.80/lokalize/scripts/msgmerge.py~ 2010-11-24 11:22:42.120000002 +0100
++++ kdesdk-4.5.80/lokalize/scripts/msgmerge.py 2010-11-24 11:22:42.146666670 +0100
+@@ -114,7 +114,7 @@
+ print >>sys.stderr, "Execution failed:", e
+
+ cmd='%s/odf/xliffmerge.py -i %s -t %s -o %s' % (ourPath,xliffpathname,xlifftemplatepathname,xliffpathname)
+- if os.name!='nt': cmd='python '+cmd
++ if os.name!='nt': cmd='python2 '+cmd
+ else: cmd=cmd.replace('/','\\')
+ os.system(cmd)
+
+--- kdesdk-4.5.80/lokalize/scripts/xliff2odf.py~ 2010-11-24 11:24:10.853333336 +0100
++++ kdesdk-4.5.80/lokalize/scripts/xliff2odf.py 2010-11-24 11:24:10.883333336 +0100
+@@ -42,7 +42,7 @@
+ xliff2odf.convertxliff(xliffinput, translatedodfpathname, odf)
+
+ ourpath=([p for p in sys.path if os.path.exists(p+'/xliff2odf.py')]+[''])[0]
+- os.system('python "'+ourpath+'/xliff2odf-standalone.py" "%s" "%s" &'%(translatedodfpathname, Editor.currentEntryId()))
++ os.system('python2 "'+ourpath+'/xliff2odf-standalone.py" "%s" "%s" &'%(translatedodfpathname, Editor.currentEntryId()))
+
+ try: convert()
+ except: print 'error occured'
+--- kdesdk-4.5.80/scripts/rename_source_files~ 2010-11-24 11:45:41.040000004 +0100
++++ kdesdk-4.5.80/scripts/rename_source_files 2010-11-24 11:45:41.093333336 +0100
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#! /usr/bin/env python2
+ #
+ # Copyright David Faure <faure@kde.org>, License LGPL v2
+ #
+--- kdesdk-4.5.80/scripts/svn2log.sh~ 2010-11-24 11:46:24.863333337 +0100
++++ kdesdk-4.5.80/scripts/svn2log.sh 2010-11-24 11:46:24.896666669 +0100
+@@ -17,6 +17,6 @@
+ svn cat svn://anonsvn.kde.org/home/kde/trunk/kde-common/accounts > /tmp/accounts.$PPID
+
+ echo "Creating changelog...";
+-svn log -v --xml $1 | python $CURRENT/svn2log.py --users=/tmp/accounts.$PPID --users-charset=UTF8
++svn log -v --xml $1 | python2 $CURRENT/svn2log.py --users=/tmp/accounts.$PPID --users-charset=UTF8
+
+ rm /tmp/accounts.$PPID
+--- kdesdk-4.5.80/scripts/kde_generate_export_header~ 2010-11-24 11:48:49.696666669 +0100
++++ kdesdk-4.5.80/scripts/kde_generate_export_header 2010-11-24 11:48:49.753333338 +0100
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#! /usr/bin/env python2
+
+ import os, sys, string
+
+--- kdesdk-4.5.80/scripts/reviewboarddiff~ 2010-11-24 11:49:37.686666670 +0100
++++ kdesdk-4.5.80/scripts/reviewboarddiff 2010-11-24 11:49:37.740000003 +0100
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ # encoding: utf-8
+ #
+ # Generates reviewboard compatible diffs from git-svn repositories.
diff --git a/testing/kdesdk/kdesdk-kate.install b/testing/kdesdk/kdesdk-kate.install
new file mode 100644
index 000000000..a60d358ce
--- /dev/null
+++ b/testing/kdesdk/kdesdk-kate.install
@@ -0,0 +1,12 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+ update-mime-database usr/share/mime &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdesdk/kdesdk-okteta.install b/testing/kdesdk/kdesdk-okteta.install
new file mode 100644
index 000000000..3f06b8deb
--- /dev/null
+++ b/testing/kdesdk/kdesdk-okteta.install
@@ -0,0 +1,12 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+ update-mime-database usr/share/mime &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdesdk/kdesdk.install b/testing/kdesdk/kdesdk.install
new file mode 100644
index 000000000..e70c054ec
--- /dev/null
+++ b/testing/kdesdk/kdesdk.install
@@ -0,0 +1,11 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdetoys/PKGBUILD b/testing/kdetoys/PKGBUILD
new file mode 100644
index 000000000..b280bf58c
--- /dev/null
+++ b/testing/kdetoys/PKGBUILD
@@ -0,0 +1,56 @@
+# $Id: PKGBUILD 126544 2011-06-06 06:10:05Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgbase=kdetoys
+pkgname=('kdetoys-amor'
+ 'kdetoys-kteatime'
+ 'kdetoys-ktux')
+pkgver=4.6.4
+pkgrel=1
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL' 'FDL')
+groups=('kde' 'kdetoys')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'kdebase-workspace')
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgbase}-${pkgver}.tar.bz2")
+sha1sums=('12a0228010a1720649807cb8efe71f572bd24af3')
+
+build() {
+ cd $srcdir
+ mkdir build
+ cd build
+ cmake ../${pkgbase}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package_kdetoys-amor() {
+ pkgdesc='On-Screen Creature'
+ depends=('kdebase-runtime')
+ install='kdetoys.install'
+ cd $srcdir/build/amor
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/amor
+ make DESTDIR=$pkgdir install
+}
+
+package_kdetoys-kteatime() {
+ pkgdesc='Tea Cooker'
+ depends=('kdebase-runtime')
+ install='kdetoys.install'
+ cd $srcdir/build/kteatime
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kteatime
+ make DESTDIR=$pkgdir install
+}
+
+package_kdetoys-ktux() {
+ pkgdesc='KTux'
+ depends=('kdebase-workspace' )
+ install='kdetoys.install'
+ cd $srcdir/build/ktux
+ make DESTDIR=$pkgdir install
+}
diff --git a/testing/kdetoys/kdetoys.install b/testing/kdetoys/kdetoys.install
new file mode 100644
index 000000000..e70c054ec
--- /dev/null
+++ b/testing/kdetoys/kdetoys.install
@@ -0,0 +1,11 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdeutils/PKGBUILD b/testing/kdeutils/PKGBUILD
new file mode 100644
index 000000000..3307f045e
--- /dev/null
+++ b/testing/kdeutils/PKGBUILD
@@ -0,0 +1,180 @@
+# $Id: PKGBUILD 126545 2011-06-06 06:10:08Z andrea $
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+
+pkgbase=kdeutils
+pkgname=('kdeutils-ark'
+ 'kdeutils-filelight'
+ 'kdeutils-kcalc'
+ 'kdeutils-kcharselect'
+ 'kdeutils-kdf'
+ 'kdeutils-kfloppy'
+ 'kdeutils-kgpg'
+ 'kdeutils-kremotecontrol'
+ 'kdeutils-ktimer'
+ 'kdeutils-kwallet'
+ 'kdeutils-printer-applet'
+ 'kdeutils-superkaramba'
+ 'kdeutils-sweeper')
+pkgver=4.6.4
+pkgrel=1
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL' 'FDL')
+groups=('kde' 'kdeutils')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'kdebase-lib' 'kdebase-workspace'
+ 'kdebindings-python' 'system-config-printer-common' 'libarchive' 'qimageblitz'
+ 'qjson')
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgbase}-${pkgver}.tar.bz2")
+sha1sums=('787653b60ce17e0e5900f9ec30f198b8d7bf1edf')
+
+build() {
+ cd ${srcdir}
+ mkdir build
+ cd build
+ cmake ../${pkgbase}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package_kdeutils-ark() {
+ pkgdesc='Archiving Tool'
+ depends=('kdebase-runtime' 'kdebase-lib' 'libarchive')
+ optdepends=('p7zip' 'zip' 'unzip' 'unrar')
+ url="http://kde.org/applications/utilities/ark/"
+ cd $srcdir/build/ark
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/ark
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeutils-filelight() {
+ pkgdesc='View disk usage information'
+ depends=('kdebase-runtime' 'qimageblitz')
+ replaces=('filelight')
+ conflicts=('filelight')
+ install='kdeutils.install'
+ url="http://methylblue.com/filelight/"
+ cd $srcdir/build/filelight
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/filelight
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeutils-kcalc() {
+ pkgdesc='Scientific Calculator'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/utilities/kcalc/"
+ cd $srcdir/build/kcalc
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kcalc
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeutils-kcharselect() {
+ pkgdesc='Character Selector'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/utilities/kcharselect/"
+ cd $srcdir/build/kcharselect
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kcharselect
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeutils-kdf() {
+ pkgdesc='View Disk Usage'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/system/kdiskfree/"
+ install='kdeutils.install'
+ cd $srcdir/build/kdf
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kdf
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeutils-kfloppy() {
+ pkgdesc='Floppy Formatter'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/utilities/kfloppy/"
+ install='kdeutils.install'
+ cd $srcdir/build/kfloppy
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kfloppy
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeutils-kgpg() {
+ pkgdesc='A GnuPG frontend'
+ depends=('kdepim-runtime' 'kde-agent')
+ url="http://kde.org/applications/utilities/kgpg"
+ install='kdeutils.install'
+ cd $srcdir/build/kgpg
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kgpg
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeutils-kremotecontrol() {
+ pkgdesc='Configure your remote controls for use with applications'
+ replaces=('kdeutils-kdelirc')
+ conflicts=('kdeutils-kdelirc')
+ depends=('kdebase-workspace')
+ url="http://kde.org/applications/utilities/kremotecontrol"
+ install='kdeutils.install'
+ cd $srcdir/build/kremotecontrol
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kcontrol/kremotecontrol
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeutils-ktimer() {
+ pkgdesc='Countdown Launcher'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/utilities/ktimer"
+ install='kdeutils.install'
+ cd $srcdir/build/ktimer
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/ktimer
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeutils-kwallet() {
+ pkgdesc='Wallet Management Tool'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/system/kwalletmanager/"
+ install='kdeutils.install'
+ cd $srcdir/build/kwallet
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kwallet
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeutils-printer-applet() {
+ pkgdesc='System tray icon for managing print jobs'
+ depends=('kdebase-runtime' 'kdebindings-python' 'system-config-printer-common')
+ url="http://kde.org/applications/system/printerapplet/"
+ cd $srcdir/build/printer-applet
+ make DESTDIR=$pkgdir install
+
+ # Use the python2 executable
+ find "${pkgdir}" -name '*.py' | xargs sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python2|'
+}
+
+package_kdeutils-superkaramba() {
+ pkgdesc='An engine for cool desktop eyecandy'
+ depends=('kdebase-runtime' 'kdebindings-python' 'qimageblitz')
+ url="http://kde.org/applications/utilities/superkaramba"
+ install='kdeutils.install'
+ cd $srcdir/build/superkaramba
+ make DESTDIR=$pkgdir install
+}
+
+package_kdeutils-sweeper() {
+ pkgdesc='System Cleaner'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/utilities/sweeper/"
+ cd $srcdir/build/sweeper
+ make DESTDIR=$pkgdir install
+}
diff --git a/testing/kdeutils/kdeutils.install b/testing/kdeutils/kdeutils.install
new file mode 100644
index 000000000..e70c054ec
--- /dev/null
+++ b/testing/kdeutils/kdeutils.install
@@ -0,0 +1,11 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/kdewebdev/PKGBUILD b/testing/kdewebdev/PKGBUILD
new file mode 100644
index 000000000..c56e2c824
--- /dev/null
+++ b/testing/kdewebdev/PKGBUILD
@@ -0,0 +1,67 @@
+# $Id: PKGBUILD 126546 2011-06-06 06:10:12Z andrea $
+# Maintainer: Pierre Schmitz <pierre@archlinux.de>
+
+pkgbase=kdewebdev
+pkgname=('kdewebdev-kfilereplace'
+ 'kdewebdev-kimagemapeditor'
+ 'kdewebdev-klinkstatus'
+ 'kdewebdev-kommander')
+pkgver=4.6.4
+pkgrel=1
+arch=('i686' 'x86_64')
+url='http://www.kde.org'
+license=('GPL' 'LGPL' 'FDL')
+groups=('kde' 'kdewebdev')
+makedepends=('pkgconfig' 'cmake' 'automoc4' 'ruby' 'tidyhtml' 'kdepim-runtime'
+ 'boost')
+source=("http://download.kde.org/stable/${pkgver}/src/${pkgbase}-${pkgver}.tar.bz2")
+sha1sums=('ef6b5142afd5b97ad8c1bffe0557e25477371344')
+
+build() {
+ cd $srcdir
+ mkdir build
+ cd build
+ cmake ../${pkgbase}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package_kdewebdev-kfilereplace() {
+ pkgdesc='Search & Replace Tool'
+ depends=('kdebase-runtime')
+ url="http://kde.org/applications/utilities/kfilereplace/"
+ install='kdewebdev.install'
+ cd $srcdir/build/kfilereplace
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kfilereplace
+ make DESTDIR=$pkgdir install
+}
+
+package_kdewebdev-kimagemapeditor() {
+ pkgdesc='HTML Image Map Editor'
+ depends=('kdebase-runtime')
+ install='kdewebdev.install'
+ cd $srcdir/build/kimagemapeditor
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/kimagemapeditor
+ make DESTDIR=$pkgdir install
+}
+
+package_kdewebdev-klinkstatus() {
+ pkgdesc='Link Checker'
+ depends=('kdepim-runtime' 'tidyhtml')
+ install='kdewebdev.install'
+ cd $srcdir/build/klinkstatus
+ make DESTDIR=$pkgdir install
+ cd $srcdir/build/doc/klinkstatus
+ make DESTDIR=$pkgdir install
+}
+
+package_kdewebdev-kommander() {
+ pkgdesc='Executor for Kommander dialogs'
+ depends=('kdebase-runtime')
+ cd $srcdir/build/kommander
+ make DESTDIR=$pkgdir install
+}
diff --git a/testing/kdewebdev/kdewebdev.install b/testing/kdewebdev/kdewebdev.install
new file mode 100644
index 000000000..e70c054ec
--- /dev/null
+++ b/testing/kdewebdev/kdewebdev.install
@@ -0,0 +1,11 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/testing/rrdtool/PKGBUILD b/testing/rrdtool/PKGBUILD
new file mode 100644
index 000000000..8c95ca2d4
--- /dev/null
+++ b/testing/rrdtool/PKGBUILD
@@ -0,0 +1,37 @@
+# $Id: PKGBUILD 127048 2011-06-10 06:18:26Z eric $
+# Maintainer: Eric Bélanger <eric@archlinux.org>
+
+pkgname=rrdtool
+pkgver=1.4.5
+pkgrel=2
+pkgdesc="Data logging and graphing application"
+arch=('i686' 'x86_64')
+url="http://www.rrdtool.org"
+license=('GPL' 'custom')
+depends=('libpng' 'libxml2' 'pango' 'tcp_wrappers')
+makedepends=('intltool' 'ruby' 'python2' 'tcl' 'lua')
+optdepends=('tcl: to use corresponding binding' \
+ 'python2: to use corresponding binding' \
+ 'ruby: to use corresponding binding' \
+ 'lua: to use corresponding binding')
+options=('!libtool' '!emptydirs' '!makeflags')
+source=(http://oss.oetiker.ch/rrdtool/pub/rrdtool-${pkgver}.tar.gz)
+md5sums=('4d116dba9a0888d8aaac179e35d3980a')
+sha1sums=('56638e8aedd5d5522152e86746e382b75dc48c35')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ sed -i 's|-lrrd|-lrrd -L/usr/lib/perl5/core_perl/CORE/ -lperl -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE |' \
+ bindings/perl-shared/Makefile.PL
+ ./configure --prefix=/usr --localstatedir=/var --disable-rpath \
+ --enable-perl --enable-perl-site-install --with-perl-options='INSTALLDIRS=vendor' \
+ --enable-ruby --enable-ruby-site-install --enable-python \
+ --enable-lua --enable-lua-site-install --enable-tcl
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+ install -D -m644 COPYRIGHT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}