updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / kde4powersave-svn / PKGBUILD
blobb1a54e910ecea9cb2b90ad86c0f1d7baaf5d7924
1 # KDE4PowerSave Subversion Package
2 # Contributor: Dylon Edwards <deltaecho@archlinux.us>
4 pkgname=kde4powersave-svn
5 pkgver=896544
6 pkgrel=2
8 url="http://websvn.kde.org/trunk/playground/utils/kde4powersave/"
9 arch=('i686' 'x86_64')
10 pkgdesc="KDE4PowerSave is the KDE 4 frontend for powermanagement."
12 license=('GPL')
14 depends=('qt>=4.4.0' 'kdelibs>=4.1.0' 'kdebase-workspace>=4.1.0' 'phonon>=4.1.0' 'libx11' 'libxpm' 'perl')
16 makedepends=('subversion' 'cmake' 'automoc4' 'gcc')
18 provides=('kde4powersave')
20 source=()
21 md5sums=()
23 _svntrunk="svn://anonsvn.kde.org/home/kde/trunk/playground/utils/"
24 _svnmod="kde4powersave"
26 # Create the package
27 build() {
28         # Enter the source directory
29         cd "${srcdir}"
31         # Get the latest SVN source
32         msg "Connecting to the SVN server..."
34         # Update source if it already exists
35         if [ -d "${_svnmod}/.svn" ]; then
36                 svn up "${_svnmod}" || return 1
37         else
38                 svn co "${_svntrunk}/${_svnmod}" || return 1
39         fi
41         # Enter the svn dir
42         cd "${_svnmod}"
43         
44         # Create the build files in the build directory
45         cmake -DCMAKE_INSTALL_PREFIX=/usr . || return 1
46         
47         # Make the package
48         make || return 1
49         
50         # Install the files to the fakeroot directory
51         install -m 755 "${srcdir}/${_svnmod}/lib/plasma_applet_powersave.so" \
52                 -D "${pkgdir}/usr/lib/kde4/plasma_applet_powersave.so"
53         install -m 644 "${srcdir}/${_svnmod}/plasma-powersave-default.desktop" \
54                 -D "${pkgdir}/usr/share/kde4/services/plasma-powersave-default.desktop"
55         
56         # Only install battery.svg if it doesn't yet exist (unlikely)
57         [ ! -f "${KDEDIR}/usr/share/apps/desktoptheme/default/widgets/battery.svg" ] || \
58                 install -m 644 "${srcdir}/${_svnmod}/battery.svg" \
59                         -D "${pkgdir}/usr/share/apps/desktoptheme/default/widgets/battery.svg"
61         # Only install battery-oxygen.svg if it doesn't yet exist (also unlikely)
62         [ ! -f "${KDEDIR}/usr/share/apps/desktoptheme/default/widgets/battery-oxygen.svg" ] || \
63                 install -m 644 "${srcdir}/${_svnmod}/battery-oxygen.svg" \
64                         -D "${pkgdir}/usr/share/apps/desktoptheme/default/widgets/battery-oxygen.svg"