summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ffb0c0a5f172875a7a1248d5c5d0742fd06754f5 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Maintainer: ChacaS0 <chk-chaca@gmail.com>

pkgname=tempest
pkgver=0.1.1
pkgrel=1
pkgdesc="TEMPest is \a CLI tool to help manage temporary content - writtent in
go"
arch=('x86_64' 'i686')
url="https://chacas0.github.io/tempest/"
license=('MIT')
depends=('git' 'go')
makedepends=('dep')
#options=('!strip' '!emptydirs')
#source=("https://github.com/ChacaS0/tempest/archive/v$pkgver.tar.gz")
#sha256sums=('b08305a9b82f39e71d5f00884aeb4086ff8c8bf29c085fd320572092e55444f1')
_gourl=github.com/ChacaS0/tempest

build() {
  export GOROOT=/usr/lib/go

  #rm -rf build
  #mkdir -p build/go
  #cd build/go

  #for f in "$GOROOT/"*; do
  #  ln -s "$f"
  #done

  #rm pkg
  #mkdir pkg
  #cd pkg

  #for f in "$GOROOT/pkg/"*; do
  #  ln -s "$f"
  #done

  #platform=`for f in "$GOROOT/pkg/"*; do echo \`basename $f\`; done|grep linux`

  #rm -f "$platform"
  #mkdir "$platform"
  #cd "$platform"

  #for f in "$GOROOT/pkg/$platform/"*.h; do
  #  ln -s "$f"
  #done

  #export GOROOT="$srcdir/build/go"

  # GOPATH
  if [[ -z "${GOPATH}" ]]; then
    export GOPATH="$HOME/gocode"
  fi
  
  # GOBIN
  if [[ -z "${GOBIN}" ]]; then
    export GOBIN="$GOPATH/bin"
  fi
  echo "Downloading and installing TEMPest using go get..."
  go get -u -t -v "$_gourl"

  

  # Prepare executable
  #if [ -d "$srcdir/build/src" ]; then
  #  cd "$srcdir/build/src/$_gourl"
  #  go build -o "$srcdir/build/$pkgname"
  #else
  #  echo 'Old sources for a previous version of this package are already present!'
  #  echo 'Build in a chroot or uninstall the previous version.'
  #  return 1
  #fi
}

package() {
#  export GOROOT="$GOPATH"
#
#  # Package go package files
#  for f in "$srcdir/build/go/pkg/"* "$srcdir/build/pkg/"*; do
#    # If it's a directory
#    if [ -d "$f" ]; then
#      cd "$f"
#      mkdir -p "$pkgdir/$GOROOT/pkg/`basename $f`"
#      for z in *; do
#        # Check if the directory name matches
#        if [ "$z" == `echo $_gourl | cut -d/ -f1` ]; then
#          cp -r $z "$pkgdir/$GOROOT/pkg/`basename $f`"
#        fi
#      done
#      cd ..
#    fi
#  done
#
#  # Package source files
#  if [ -d "$srcdir/build/src" ]; then
#    mkdir -p "$pkgdir/$GOROOT/src/pkg"
#    cp -r "$srcdir/build/src/"* "$pkgdir/$GOROOT/src/pkg/"
#    find "$pkgdir" -depth -type d -name .git -exec rm -r {} \;
#  fi
#
#  # Package license (if available)
#  for f in LICENSE COPYING; do
#    if [ -e "$srcdir/build/src/$_gourl/$f" ]; then
#      install -Dm644 "$srcdir/build/src/$_gourl/$f" \
#        "$pkgdir/usr/share/licenses/$pkgname/$f"
#    fi
#  done
#
#  # Package executables
#  if [ -e "$srcdir/build/$pkgname" ]; then
#    install -Dm755 "$srcdir/build/$pkgname" \
#      "$pkgdir/usr/bin/$pkgname"
#  fi
if ! tempest > /dev/null 2>&1; then                                            
   sudo ln -s $GOBIN/tempest /usr/bin/tempest
   sudo chmod +x /usr/bin/tempest
fi 
echo "Ready to start, run tempest help to get started !"

}

#install() {
#  # symbolic link to bin
#  if ! tempest > /dev/null 2>&1; then
#    ln -s $GOBIN/tempest /usr/bin/tempest
#  fi
#}