summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 59bfefd479fc06c2d7c3e3f5c99eac7a9ecff259 (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
# Maintainer: Sam Whited <sam@samwhited.com>
# Note that this package is in no way officially supported by Atlassian.

pkgname=atlassian-stash
pkgver=4.3.2
pkgrel=2
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="$pkgname.install"
source=("https://downloads.atlassian.com/software/stash/downloads/atlassian-bitbucket-$pkgver.tar.gz"
        'stash.service'
        'stash.tmpfiles'
        'stash.sysusers'
        'local.conf')
sha256sums=('7d29f1dc5960547528856d54a2d498be5e3220d741a8500e6160f08bc4dec2b3'
            '6c937a9fdb747e04585405244b24fdd49a4e087a76a1b1792107f20c28fa3950'
            'f314c949fd86741ae830d8e97243874a9bf70622ad7c33af2369cc5eb4c17bd9'
            'b8b44f798e8611bfc0e05c07e117c3a4b43cc09a4d53cd401c35d766e2e3f283'
            '6f780ea42987c196e95c5c2f7a0b022b292f16b77f7d7ee10846e8c4bc6da2fa')

package() {
  install -dm750 "$pkgdir/var/lib/stash"
  install -dm755 "$pkgdir/opt/$pkgname"
	install -dm755 "$pkgdir/usr/share/licenses/$pkgname"
	cp -r "$srcdir/atlassian-bitbucket-$pkgver/licenses/"* "$pkgdir/usr/share/licenses/$pkgname"
  cp -r "$srcdir/atlassian-bitbucket-$pkgver/"* "$pkgdir/opt/$pkgname"
  install -Dm755 "$pkgdir/opt/$pkgname/conf/server.xml" "$pkgdir/etc/stash/server.xml"
  rm "$pkgdir/opt/$pkgname/conf/server.xml"
  ln -s "/etc/stash/server.xml" "$pkgdir/var/lib/stash/server.xml"
  # remove unneeded Windows files
  find "$pkgdir/opt/$pkgname/bin" -name '*.bat' -type f -exec rm "{}" \;
  find "$pkgdir/opt/$pkgname/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"
}