updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / phonon-mplayer-git / PKGBUILD
bloba6d15dfcda6f34e79c5f8f8ff69670f8c9b80039
1 # Maintainer:  Jekyll Wu <adaptee at gmail dot com>
2 # Contributor: Xavion <Xavion (dot) 0 (at) Gmail (dot) com>
3 # Contributor: Rick W. Chen <stuffcorpse@archlinux.us>
4 # Contributor: Pierre Schmitz <pierre@archlinux.de>
5 # Contributor: Marek Kubica <marek@xivilization.net>
7 realname=phonon
8 bename=mplayer
9 pkgname=${realname}-${bename}-git
10 pkgver=20111126
11 pkgrel=1
12 pkgdesc="Mplayer backend for phonon, the multimedia API of KDE."
13 arch=("i686" "x86_64")
14 url="http://projects.kde.org/projects/kdesupport/${realname}/${realname}-${bename}"
15 license=("LGPL")
16 depends=("${realname}" "${bename}")
17 makedepends=("pkg-config" "cmake" "automoc4" "git")
18 provides=("${realname}-${bename}" "${realname}-backend")
19 conflicts=("${realname}-${bename}" )
20 source=('fix_find_config.patch')
21 md5sums=('55a20d7146371fbf1f1139a2ed874604')
23 _gitroot="git://anongit.kde.org/${realname}-${bename}.git"
24 _gitname="${realname}-${bename}"
26 build() {
28     # Config
29     [ ${CARCH} = 'x86_64' ] && CXXFLAGS="$CXXFLAGS -fPIC"
31     cd ${srcdir}
33     # Repository
34     msg "Connecting to GIT server...."
35     if [ -d ${_gitname} ] ; then
36         cd ${_gitname} && git pull origin
37         msg "The local files are updated."
38     else
39         git clone ${_gitroot} ${_gitname}
40         msg "GIT checkout done"
41     fi
44     if [ -d "${srcdir}/${_gitname}-build" ]; then
45         rm "${srcdir}/${_gitname}-build/" -rf
46     fi
47     cp -r "${srcdir}/${_gitname}" "${srcdir}/${_gitname}-build"
49     # Patch
50     cd "${srcdir}/${_gitname}-build"
51     patch -Np1 -i ${srcdir}/fix_find_config.patch
53     # Build
54     msg "Starting make..."
56     { type -P kde4-config &>/dev/null && _prefix=$(kde4-config --prefix) ; } || _prefix=/usr
57     cmake \
58             -DCMAKE_BUILD_TYPE=Release \
59             -DCMAKE_INSTALL_PREFIX=$_prefix \
60             -DPLUGIN_INSTALL_DIR=$_prefix/lib/kde4 \
61             -DSERVICES_INSTALL_DIR=$_prefix/share/kde4/services \
62             ./
64     make || return 1
68 package () {
69     cd "${srcdir}/${_gitname}-build"
70     make DESTDIR=${pkgdir} install || return 1