summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e1ece9516fac432961bb58a2a8b3e8032bd6c889 (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
59
60
# Maintainer: Chipster Julien <julien dot chipster @ archlinux dot fr>

pkgname=mailmotiond
pkgver=0.1
pkgrel=4
pkgdesc="It send email with attachment when it found any picture on specified directory (designed to work with motion)"
arch=('any')
url="https://github.com/Chipsterjulien/go-mailmotiond"
license=('WTFPL')
makedepends=('go' 'git')
options=('!strip' '!emptydirs')
conflit=('mailmotiond')
backup=('etc/mailmotiond/mailmotiond.conf')
source=("$pkgname-$pkgver.tar.gz")
install=mailmotiond.install
sha256sums=('4cf9b6c6dc8e44b6ef0e94b3b14d3fd78b45b7fe44e7d6f460b3c139fc0d77fa')

build() {
  GOPATH_exist=1
  if [ -z $GOPATH ]; then
    # path don't exit
    GOPATH_exist=0

    # create gopath directory
    mkdir -p .gopath/{bin,src}
    # export var
    export GOPATH=~/.gopath
  fi

  # Getting some lib
  go get github.com/scorredoira/email
  go get bitbucket.org/zombiezen/cardcpx/natsort
  go get github.com/vaughan0/go-ini

  cd "$pkgname-$pkgver"

  go build

  if [ $GOPATH_exist == 0 ]; then
    rm -rf ~/.gopath
    export GOPATH=
  fi
}

package() {
  cd "$pkgname-$pkgver"
  	
	# Create directory and copy files
	install -Dm644 "cfg/mailmotiond.conf" "$pkgdir/etc/mailmotiond/mailmotiond.conf"
	install -Dm644 "cfg/mailmotiond.service" "$pkgdir/usr/lib/systemd/system/mailmotiond.service"
	install -Dm644 "cfg/errors.log" "$pkgdir/var/log/mailmotiond/errors.log"

  #install -Dm755 "$pkgname-$pkgver" "$pkgdir/usr/bin/$pkgname"
  #install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  
  install -Dm755 "$pkgname-$pkgver" "$pkgdir/usr/bin/mailmotiond"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/mailmotiond/LICENSE"
}

# vim:set ts=2 sw=2 et: