# Maintainer: Figue # Contributor: Pirea Radu pkgname=cubieboard-livesuit pkgver=306 pkgrel=4 pkgdesc="LiveSuit is a tool to flash Images to the NAND of Allwinner devices, such as Cubieboard1, Cubieboard2, and Cubietruck. This package use the ZIP that comes from official Cubieboard download page." arch=('i686' 'x86_64') url="http://cubieboard.org" license=('GPL') depends=('libpng12' 'qt4' 'linux-headers') makedepends=('git' 'dkms') conflicts=() install=${pkgname}.install source_x86_64=("${pkgname}"::'git+https://github.com/linux-sunxi/sunxi-livesuite.git' "http://dl.cubieboard.org/software/tools/livesuit/LiveSuitV${pkgver}_For_Linux64.zip" "50-awusb.rules" "awusb-fix.patch") source_i686=("${pkgname}"::'git+https://github.com/linux-sunxi/sunxi-livesuite.git' "http://dl.cubieboard.org/software/tools/livesuit/LiveSuitV${pkgver}_For_Linux32.zip" "50-awusb.rules" "awusb-fix.patch") sha256sums_i686=('SKIP' '91553f7dc0a8dc467a6f584b8faea73ddbd6fa6ba39fb3701d208d519a7173be' '21e03a459c30fbf92bef5b086f8c93c6ac7071d97e7855dce7627e624969081f' '033a91cd366b1ecd13ea44e49ee454830623b4db42c76d74e084360a8f33f966') sha256sums_x86_64=('SKIP' '12c042080e6b49e3edff7052cbb9ff0a89badce12be04d1443b1c9d5163d9bf3' '21e03a459c30fbf92bef5b086f8c93c6ac7071d97e7855dce7627e624969081f' '033a91cd366b1ecd13ea44e49ee454830623b4db42c76d74e084360a8f33f966') build() { # LiveSuit if [ "$CARCH" = "x86_64" ]; then cd ${srcdir}/LiveSuit_For_Linux64 elif [ "$CARCH" = "i686" ]; then cd ${srcdir}/LiveSuit_For_Linux32 fi tail -n +60 LiveSuit.run > LiveSuit.tar.bz2 tar xjvf LiveSuit.tar.bz2 # Kernel module awusb cd ${srcdir}/${pkgname}/awusb patch -Np1 -i ${srcdir}/awusb-fix.patch # Kernels greater than 5.4 fails to build function ver { printf "%03d%03d%03d" $(echo "$1" | tr '.' ' '); } kernel_ver=$(uname -r | cut -d'-' -f1) if [ "$(ver $kernel_ver)" -gt "$(ver 5.4)" ]; then sed -E -e 's:SUBDIRS=([^ ]+) :M=\1 &:g' -i Makefile ; fi make } package() { # LiveSuit if [ "$CARCH" = "x86_64" ]; then cd ${srcdir}/LiveSuit_For_Linux64 elif [ "$CARCH" = "i686" ]; then cd ${srcdir}/LiveSuit_For_Linux32 fi mkdir -p "${pkgdir}/opt/${pkgname}" cp -r LiveSuit/* ${pkgdir}/opt/${pkgname}/ # Kernel module awusb mkdir -p ${pkgdir}/usr/lib/modules/`uname -r`/kernel/ ${pkgdir}/etc/udev/rules.d cp ${srcdir}/${pkgname}/awusb/awusb.ko ${pkgdir}/usr/lib/modules/`uname -r`/kernel/ cp ${srcdir}/50-awusb.rules ${pkgdir}/etc/udev/rules.d/ }