# Maintainer (aur): Salan54 <salan at fremenil dot com>
# Created: 2013-03-17
# Maintainer: Aurélien Desbrières <aurelien@hackers.camp>


# parabola changes and rationale:
#  - added support for armv7h


pkgname=zulucrypt
pkgver=6.2.0
pkgrel=1
_altpkgname=zuluCrypt
pkgdesc="A cli and gui frontend to cryptsetup"
url="https://mhogomchungu.github.io/${_altpkgname}"
arch=('x86_64' 'i686')
arch+=('armv7h')
license=('GPL')
depends=('cryptsetup' 'qt5-base' 'libpwquality' 'libsecret' 'libxkbcommon-x11' )
optdepends=('kwalletmanager: retrieve volume keys from kde kwallet')
makedepends=('cmake')
source=("https://github.com/mhogomchungu/zuluCrypt/releases/download/${pkgver}/${_altpkgname}-${pkgver}.tar.xz")
md5sums=('ca53ef782f84ac62d0e95ec0fc03ad1c')
sha256sums=('090f3d561add1c5a5fc5158bf346155d43e2b42e7c47939a403ae2f8dcf8eaa3')

build() {
  cd "${srcdir}/${_altpkgname}-${pkgver}"
  mkdir -p build
  cd build
  cmake -DCMAKE_INSTALL_PREFIX=/usr/ -DLIB_SUFFIX=lib -DNOGUI=false -DQT5=true -DHOMEMOUNTPREFIX=false -DCMAKE_BUILD_TYPE=release . ..
  make
}

package() {
  echo "changelog updated"
  cp "${srcdir}/${_altpkgname}-${pkgver}"/changelog ../${pkgname}.changelog
  cd "${srcdir}/${_altpkgname}-${pkgver}/build"
  make DESTDIR="$pkgdir" install
  mkdir -p ${pkgdir}/etc/modules-load.d
  echo 'loop' > "${pkgdir}/etc/modules-load.d/${pkgname}.conf"
}
