Advertisement
Guest User

Untitled

a guest
Aug 25th, 2015
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. # Maintainer: Nicolas Leclercq <nicolas.private@gmail.com>
  2. # Contributor: Charles B. Johnson <mail@cbjohnson.info>
  3. # Contributor: Daichi Shinozaki <dsdseg@gmail.com>
  4. # Contributor: Ben Alex <ben.alex@acegi.com.au>
  5.  
  6. pkgname='influxdb'
  7. _gitname='influxdb'
  8. pkgver='0.9.2.1'
  9. pkgrel='1'
  10. epoch=
  11. pkgdesc='Scalable datastore for metrics, events, and real-time analytics'
  12. arch=('i686' 'x86_64' 'armv6h')
  13. url='http://influxdb.org/'
  14. license=('MIT')
  15. groups=()
  16. depends=()
  17. makedepends=('autoconf' 'protobuf' 'bison' 'flex' 'go' 'gawk' 'mercurial' 'git' 'collectd')
  18. checkdepends=()
  19. optdepends=()
  20. provides=('influxdb')
  21. conflicts=()
  22. replaces=()
  23. backup=('etc/influxdb.conf')
  24. options=()
  25. install="$pkgname.install"
  26. source=("$pkgname.service"
  27. "$pkgname.install")
  28. changelog=
  29. noextract=()
  30. md5sums=('SKIP'
  31. 'SKIP')
  32.  
  33. prepare()
  34. {
  35. export GOPATH=${srcdir}
  36. gitsrc=${srcdir}/src/github.com/influxdb
  37.  
  38. if [ ! -d "${gitsrc}" ]; then
  39. # clone influxdb git repo
  40. mkdir -p ${gitsrc};
  41. cd ${gitsrc};
  42. echo "Cloning influxdb git repo ..."
  43. git clone -q https://github.com/influxdb/influxdb;
  44.  
  45. else
  46. echo "Git repository already cloned, skipping"
  47. fi;
  48.  
  49. # checkout wanted version
  50. cd ${gitsrc};
  51. echo "Switching to ${pkgver} branch ..."
  52. cd ${gitsrc}/influxdb
  53. git checkout -q "v${pkgver}"
  54. commit=`git rev-parse HEAD`
  55. }
  56. build()
  57. {
  58. if [ -d ${srcdir}/bin ]; then
  59. rm ${srcdir}/bin/*;
  60. fi;
  61.  
  62. echo "Building deps ..."
  63. cd ${gitsrc}
  64. pwd
  65. go get ./...
  66. go build ./...
  67. }
  68.  
  69. package()
  70. {
  71. gitsrc=${srcdir}/src/github.com/influxdb
  72.  
  73. export GOPATH=${srcdir}
  74.  
  75. echo "Building influxdb ${pkgver} (commit ${commit}) ..."
  76. cd ${gitsrc}
  77. go install -a -pkgdir="${pkgdir}/usr/lib/go/src/" -ldflags="-X main.version=${pkgver}" ./...
  78.  
  79. # systemctl service file
  80. cd ${srcdir}
  81. install -D -m644 'influxdb.service' "$pkgdir/usr/lib/systemd/system/influxdb.service"
  82.  
  83. # binaries
  84. cd ${srcdir}/bin
  85. install -D -m755 influxd "$pkgdir/usr/bin/influxd"
  86. install -D -m755 influx "$pkgdir/usr/bin/influx"
  87.  
  88. # configuration file
  89. cd ${gitsrc}/influxdb
  90. install -D -m644 etc/config.sample.toml "${pkgdir}/etc/influxdb.conf"
  91. sed -i 's;/var/opt/;/var/lib/;g' ${pkgdir}/etc/influxdb.conf
  92.  
  93. # license
  94. cd ${gitsrc}/influxdb
  95. install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/influxdb/LICENSE"
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement