summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0f1b5d0c09a0b18929bd37dfa29e0a84d8a7f055 (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
# Maintainer: Jefferson Gonzalez <jgmdev@gmail.com>
# Contributor: François M. <francois5537 @ gmail.com>

pkgname=manager-accounting
pkgver=16.9.44
pkgrel=1
pkgdesc='Manager is free accounting software for small business'
arch=('i686' 'x86_64')
license=('custom')
url="http://www.manager.io/"
depends=('mono' 'gtk2' 'gtk-sharp-2' 'webkit-sharp')
makedepends=('unzip')
install=manager-accounting.install
options=('!makeflags')
source=(
  "LICENSE"
  "fix-path.patch"
  "https://mngr.s3.amazonaws.com/manager-accounting.zip"
)
sha256sums=(
  'bd144763506372341487683b0f28ad627e7e8923ea8ef8569541b55f4b987061'
  '81e73bbae1a386dc76bd1f8b018868864c802cb242667d18b9d6f005518859f7'
  'SKIP'
)

pkgver() {
  cd "$srcdir"
  echo $(ls *.dsc | egrep -o '[0-9]+\.[0-9]+\.[0-9]+')
}

prepare() {
  cd "$srcdir"

  # Get current version of application
  pkgver=$(ls *.dsc | egrep -o '[0-9]+\.[0-9]+\.[0-9]+')

  # Check checksum
  chksum=($(sed '15q;d' "${pkgname}_${pkgver}.dsc"))
  filesum=($(sha256sum "${pkgname}_${pkgver}.tar.gz"))
  if [ $chksum != $filesum  ]; then
      error "Checksums not matching"
      exit
  fi

  # Extract, patch
  tar --strip-components=1 -zxvf "${pkgname}_${pkgver}.tar.gz"
  patch -p1 -i fix-path.patch
}

package() {
  install -d $pkgdir/usr/{bin,lib,share/{applications,icons}}
  cp -r opt/manager-accounting $pkgdir/usr/lib/
  cp -r usr/share/icons/* $pkgdir/usr/share/icons/
  ln -s /usr/lib/manager-accounting/manager-accounting $pkgdir/usr/bin/manager-accounting
  install -m644 usr/share/applications/$pkgname.desktop $pkgdir/usr/share/applications/
  install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}