summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Whited2015-12-24 20:11:46 -0600
committerSam Whited2015-12-24 21:11:07 -0600
commit843599519ea3c1f565136ae086d380dead97a04a (patch)
tree5ec76de05cb3a960ae785cf8624ded5e649d869d
downloadaur-843599519ea3c1f565136ae086d380dead97a04a.tar.gz
Initial atlassian-stash package
-rw-r--r--.SRCINFO29
-rw-r--r--.gitignore9
-rw-r--r--PKGBUILD46
-rw-r--r--atlassian-stash.install21
-rw-r--r--local.conf2
-rw-r--r--stash.service15
-rw-r--r--stash.sysusers1
-rw-r--r--stash.tmpfiles4
8 files changed, 127 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..dd4f8d73c014
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,29 @@
+# Generated by mksrcinfo v8
+# Fri Dec 25 03:10:59 UTC 2015
+pkgbase = atlassian-stash
+ pkgdesc = Bitbucket Server (Stash)
+ pkgver = 4.2.0
+ pkgrel = 1
+ url = https://www.atlassian.com/software/bitbucket/server
+ install = atlassian-stash.install
+ arch = i686
+ arch = x86_64
+ license = custom
+ depends = java-runtime=8
+ depends = git>=1.8.0
+ depends = perl>=5.8.8
+ backup = etc/systemd/system/stash.service.d/local.conf
+ backup = etc/stash/server.xml
+ source = https://downloads.atlassian.com/software/stash/downloads/atlassian-bitbucket-4.2.0.tar.gz
+ source = stash.service
+ source = stash.tmpfiles
+ source = stash.sysusers
+ source = local.conf
+ sha256sums = 0632382b092105bbc99e580ef1a92e076eed94ac277ad4804e474bf70fa6722c
+ sha256sums = 6c937a9fdb747e04585405244b24fdd49a4e087a76a1b1792107f20c28fa3950
+ sha256sums = f314c949fd86741ae830d8e97243874a9bf70622ad7c33af2369cc5eb4c17bd9
+ sha256sums = b8b44f798e8611bfc0e05c07e117c3a4b43cc09a4d53cd401c35d766e2e3f283
+ sha256sums = 6f780ea42987c196e95c5c2f7a0b022b292f16b77f7d7ee10846e8c4bc6da2fa
+
+pkgname = atlassian-stash
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..4ad4e9154c29
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+*.pkg.tar
+*.src.tar.gz
+pkg/
+src/
+*.sw[op]
+*.pkg.tar.xz
+atlassian-bitbucket*.tar.gz
+atlassian-bitbucket-*/
+*.part
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..23c372428596
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,46 @@
+# Maintainer: Sam Whited <sam@samwhited.com>
+# Note that this package is in no way officially supported by Atlassian.
+
+pkgname=atlassian-stash
+pkgver=4.2.0
+pkgrel=1
+pkgdesc="Bitbucket Server (Stash)"
+url="https://www.atlassian.com/software/bitbucket/server"
+license=('custom')
+arch=('i686' 'x86_64')
+depends=('java-runtime=8'
+ 'git>=1.8.0'
+ 'perl>=5.8.8')
+backup=('etc/systemd/system/stash.service.d/local.conf'
+ 'etc/stash/server.xml')
+install='atlassian-stash.install'
+source=("https://downloads.atlassian.com/software/stash/downloads/atlassian-bitbucket-$pkgver.tar.gz"
+ 'stash.service'
+ 'stash.tmpfiles'
+ 'stash.sysusers'
+ 'local.conf')
+sha256sums=('0632382b092105bbc99e580ef1a92e076eed94ac277ad4804e474bf70fa6722c'
+ '6c937a9fdb747e04585405244b24fdd49a4e087a76a1b1792107f20c28fa3950'
+ 'f314c949fd86741ae830d8e97243874a9bf70622ad7c33af2369cc5eb4c17bd9'
+ 'b8b44f798e8611bfc0e05c07e117c3a4b43cc09a4d53cd401c35d766e2e3f283'
+ '6f780ea42987c196e95c5c2f7a0b022b292f16b77f7d7ee10846e8c4bc6da2fa')
+
+package() {
+ install -dm750 "$pkgdir/var/lib/stash"
+ install -dm755 "$pkgdir/opt/atlassian-stash"
+ cp -r "$srcdir/atlassian-bitbucket-$pkgver/"* "$pkgdir/opt/atlassian-stash"
+ install -Dm755 "$pkgdir/opt/atlassian-stash/conf/server.xml" "$pkgdir/etc/stash/server.xml"
+ rm "$pkgdir/opt/atlassian-stash/conf/server.xml"
+ ln -s "/etc/stash/server.xml" "$pkgdir/var/lib/stash/server.xml"
+ # remove unneeded Windows files
+ find "$pkgdir/opt/atlassian-stash/bin" -name '*.bat' -type f -exec rm "{}" \;
+ find "$pkgdir/opt/atlassian-stash/bin" -name '*.exe' -type f -exec rm "{}" \;
+
+
+ # setup systemd service
+ install -Dm644 "$srcdir/stash.service" "$pkgdir/usr/lib/systemd/system/stash.service"
+ install -Dm644 "$srcdir/local.conf" "$pkgdir/etc/systemd/system/stash.service.d/local.conf"
+ install -Dm644 "$srcdir/stash.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/stash.conf"
+ install -Dm644 "$srcdir/stash.sysusers" "$pkgdir/usr/lib/sysusers.d/stash.conf"
+}
+
diff --git a/atlassian-stash.install b/atlassian-stash.install
new file mode 100644
index 000000000000..46cbc0e64144
--- /dev/null
+++ b/atlassian-stash.install
@@ -0,0 +1,21 @@
+post_install() {
+ systemd-sysusers stash.conf
+ systemd-tmpfiles --create stash.conf
+ chown -R stash:stash /opt/atlassian-stash
+ chown -R stash:stash /etc/stash
+ chmod -R 750 /etc/stash
+ echo "==> "
+ echo "==> Bitbucket has finished installing."
+ echo "==> Visit https://confluence.atlassian.com/display/BitbucketServer/Install+Bitbucket+Server+from+an+archive+file for configuration instructions."
+ echo "==> "
+}
+
+post_upgrade() {
+ post_install
+ echo "Restart Bitbucket to complete upgrade."
+}
+
+pre_remove() {
+ getent passwd stash &>/dev/null && userdel stash &> /dev/null
+ getent group stash &>/dev/null && groupdel stash &> /dev/null
+}
diff --git a/local.conf b/local.conf
new file mode 100644
index 000000000000..13c4062db22f
--- /dev/null
+++ b/local.conf
@@ -0,0 +1,2 @@
+[Service]
+Environment="BITBUCKET_HOME=/var/lib/stash"
diff --git a/stash.service b/stash.service
new file mode 100644
index 000000000000..adcf84e408b3
--- /dev/null
+++ b/stash.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Bitbucket Server (Stash) by Atlassian
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/opt/atlassian-stash/bin/start-bitbucket.sh
+ExecStop=/opt/atlassian-stash/bin/stop-bitbucket.sh
+PIDFile=/opt/atlassian-stash/work/catalina.pid
+KillSignal=SIGINT
+LimitNOFILE=8196
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/stash.sysusers b/stash.sysusers
new file mode 100644
index 000000000000..ed645d0bd9d4
--- /dev/null
+++ b/stash.sysusers
@@ -0,0 +1 @@
+u stash - "Atlassian Bitbucket Server (Stash)" /var/lib/stash
diff --git a/stash.tmpfiles b/stash.tmpfiles
new file mode 100644
index 000000000000..1ce77eeb997d
--- /dev/null
+++ b/stash.tmpfiles
@@ -0,0 +1,4 @@
+# systemd tmpfile settings for minidlna
+# See tmpfiles.d(5) for details
+
+d /var/lib/crucible 0700 stash stash -