File PKGBUILD of Package imagewriter

pkgname="imagewriter"
pkgver=1.10.1420800585.134a9b3
pkgrel=9
pkgdesc="A graphical utility for writing raw disk images & hybrid isos to USB keys"
url="https://github.com/mbarringer/imagewriter"
license=(
 "GPL2"
)
# http://download.opensuse.org/tumbleweed/repo/src-oss/src/imagewriter-1.10.1420800585.134a9b3-1.10.src.rpm
# curl -L -o imagewriter-1.10.1420800585.134a9b3-1.10.src.rpm http://download.opensuse.org/tumbleweed/repo/src-oss/src/imagewriter-1.10.1420800585.134a9b3-1.10.src.rpm
source=(
    "imagewriter-1.10.1420800585.134a9b3-1.10.src.rpm"
)
sha512sums=(
 "d415b2118641a98fd56e74dc2de784b3cb2de8c1d7fc384e1f28e388e86bc95ecbed65e809308f17ee6acc2e077e1baf50446bd293279a3868689ee86e92f58e"
)
arch=(
 "i686"
 "x86_64"
)
depends=(
 "qt4"
 "udisks2"
)
optdepends=(
 "xdg-su: NEEDED by non-KDE users!"
 "kdebase-runtime: provides kdesu"
)
_release="1.10"
prepare () 
{ 
    cd $srcdir;
    tar xvf $pkgname-$pkgver.tar.xz;
    if [ -e /usr/bin/kdesu ]; then
        sed 's/\/usr\/bin\/xdg-su -c \/usr\/bin\//kdesu /' -i $pkgname-$pkgver/$pkgname.desktop;
    else
        sed 's/\/usr\/bin\/xdg-su -c \/usr\/bin\//xdg-su -s /' -i $pkgname-$pkgver/$pkgname.desktop;
    fi
}
build () 
{ 
    cd "$srcdir/$pkgname-$pkgver";
    CFLAGS="$CFLAGS -DKIOSKHACK";
    qmake-qt4 PREFIX="$pkgdir/usr" DEFINES=USEUDISKS2 $pkgname.pro;
    make
}
package () 
{ 
    cd "$srcdir/$pkgname-$pkgver";
    make DESTDIR="$pkgdir/" install
}