summaryrefslogtreecommitdiff
path: root/extra/gparted/PKGBUILD
blob: eaf8f656a0ec0b82f0ecccc3da8d2a1dfc0ba737 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# $Id: PKGBUILD 185866 2013-05-19 16:28:55Z giovanni $
# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Andrew Simmons <andrew.simmons@gmail.com>
# Contributor: György Balló <ballogy@freestart.hu>

pkgname=gparted
pkgver=0.16.1
pkgrel=3
pkgdesc="A Partition Magic clone, frontend to GNU Parted"
arch=('i686' 'x86_64')
url="http://gparted.sourceforge.net"
license=('GPL')
depends=('parted' 'gtkmm' 'hicolor-icon-theme')
makedepends=('intltool' 'pkg-config' 'gnome-doc-utils')
optdepends=('dosfstools: for FAT16 and FAT32 partitions'
            'jfsutils: for jfs partitions'
            'f2fs-tools: for Flash-Friendly File System'
            'btrfs-progs: for btrfs partitions'
            'exfat-utils: for exFAT partitions'
            'ntfs-3g: for ntfs partitions'
            'reiserfsprogs: for reiser partitions'
            'xfsprogs: for xfs partitions'
            'nilfs-utils: for nilfs2 support'
            'polkit-gnome: to run gparted directly from menu'
            'gpart: for recovering corrupt partition tables'
            'mtools: utilities to access MS-DOS disks')
install=gparted.install
source=("http://downloads.sourceforge.net/project/${pkgname}/${pkgname}/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.bz2"
        'org.archlinux.pkexec.gparted.policy')
md5sums=('3f399bff031b5ce14d11a8c346f4b89c'
         '122ed3120c846376bead22b25f6a3b19')

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

  sed -i "s:@gksuprog@ @installdir@/gparted %f:@installdir@/gparted_polkit %f:g" gparted.desktop.in.in
  ./configure --prefix=/usr \
              --sbindir=/usr/bin
  make
}

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

  make DESTDIR="${pkgdir}" install

  # Install policy file
  install -Dm644 "${srcdir}/org.archlinux.pkexec.gparted.policy" "${pkgdir}/usr/share/polkit-1/actions/org.archlinux.pkexec.gparted.policy"

  # Install launcher script
  echo '#!/bin/sh' > ${pkgdir}/usr/bin/gparted_polkit
  echo 'if [ $(which pkexec) ]; then' >> ${pkgdir}/usr/bin/gparted_polkit
  echo '  pkexec --disable-internal-agent "/usr/bin/gparted" "$@"' >> ${pkgdir}/usr/bin/gparted_polkit
  echo 'else' >> ${pkgdir}/usr/bin/gparted_polkit
  echo '  /usr/bin/gparted "$@"' >> ${pkgdir}/usr/bin/gparted_polkit
  echo 'fi' >> ${pkgdir}/usr/bin/gparted_polkit
  chmod 755 ${pkgdir}/usr/bin/gparted_polkit
}