summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO16
-rw-r--r--.gitignore3
-rw-r--r--PKGBUILD50
3 files changed, 69 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..4011f309670
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+# Generated by mksrcinfo v8
+# Thu May 26 14:04:11 UTC 2016
+pkgbase = bitbucket-cli
+ pkgdesc = Bitbucket Server Command Line Tools
+ pkgver = autogenerated
+ pkgrel = 1
+ url = https://bitbucket.org/atlassian/bitbucket-server-cli/overview
+ arch = i686
+ arch = x86_64
+ license = MIT
+ depends = ruby
+ depends = ruby-bundler
+ options = !emptydirs
+
+pkgname = bitbucket-cli
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..5e4e09b1fe3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+/*.xz
+/pkg
+/src
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..746d69853af
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,50 @@
+# Maintainer: Egor Kovetskiy <e.kovetskiy@gmail.com>
+
+pkgname=bitbucket-cli
+pkgver=${PKGVER:-autogenerated}
+pkgrel=${PKGREL:-1}
+pkgdesc='Bitbucket Server Command Line Tools'
+arch=(i686 x86_64)
+url='https://bitbucket.org/atlassian/bitbucket-server-cli/overview'
+license=(MIT)
+depends=(ruby ruby-bundler)
+options=(!emptydirs)
+source=()
+sha1sums=()
+
+prepare() {
+ #makepkg can't fetch git with https:// proto
+ git clone \
+ https://bitbucket.org/kovetskiy/stash-command-line-tools.git \
+ $srcdir/$pkgname
+}
+
+pkgver() {
+ cd "$srcdir/$pkgname"
+ local date=$(git log -1 --format="%cd" --date=short | sed s/-//g)
+ local count=$(git rev-list --count HEAD)
+ local commit=$(git rev-parse --short HEAD)
+ pkgver=${PKGVER:-autogenerated}
+ echo "$pkgver"
+}
+
+package() {
+ local _gemdir="$(ruby -e'puts Gem.default_dir')"
+
+ bundle install \
+ --path="$pkgdir/$_gemdir" \
+ --standalone \
+ --gemfile "$srcdir/$pkgname/Gemfile" \
+ --no-prune \
+ --without test
+
+ install -d "$pkgdir/$_gemdir/gems/"
+ mv "$srcdir/$pkgname" "$pkgdir/$_gemdir/gems/$pkgname-$pkgver"
+
+ install -d "$pkgdir/usr/bin"
+ cat > "$pkgdir/usr/bin/bitbucket" <<EOF
+#!/bin/sh
+exec $_gemdir/gems/$pkgname-$pkgver/bin/stash \$@
+EOF
+ chmod a+x "$pkgdir/usr/bin/bitbucket"
+}