# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Andrew Simmons <andrew.simmons@gmail.com>
# Contributor: György Balló <ballogy@freestart.hu>

pkgname=gparted
pkgver=1.6.0
pkgrel=2
pkgdesc='A Partition Magic clone, frontend to GNU Parted'
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url='https://gparted.org/'
license=('GPL-2.0-or-later' 'GFDL-1.2-or-later')
depends=('parted' 'gtkmm3')
makedepends=('intltool' 'itstool' 'pkg-config' 'yelp-tools' 'polkit')
optdepends=('dosfstools: for FAT16 and FAT32 partitions'
            'jfsutils: for jfs partitions'
            'f2fs-tools: for Flash-Friendly File System'
            'btrfs-progs: for btrfs partitions'
            'exfatprogs: for exFAT partitions'
            'ntfs-3g: for ntfs partitions'
            'udftools: for UDF file system support'
            'xfsprogs: for xfs partitions'
            'nilfs-utils: for nilfs2 support'
            'polkit: to run gparted from application menu'
            'gpart: for recovering corrupt partition tables'
            'mtools: utilities to access MS-DOS disks'
            'xorg-xhost: authorization from wayland')
validpgpkeys=('BB09FFB87563FA2E1A22146817A6D3FF338C9570') # "Curtis Gedak <gedakc@gmail.com>"
source=("https://downloads.sourceforge.net/project/${pkgname}/${pkgname}/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.gz"{,.sig})
sha256sums=('9b9f51b3ce494ddcb59a55e1ae6679c09436604e331dbf5a536d60ded6c6ea5b'
            'SKIP')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  ./configure --prefix=/usr \
      --sbindir=/usr/bin \
      --libexecdir=/usr/lib/gparted \
      --enable-online-resize \
      --enable-libparted-dmraid \
      --enable-xhost-root
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}" install

  # Install policy file
  install -D -m0644 org.gnome.gparted.policy \
      "${pkgdir}"/usr/share/polkit-1/actions/org.gnome.gparted.policy
}
