summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4f7e86519de97015f5c5fd820e176cfca2b9a8d7 (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
# Maintainer: Dennis Stengele <dennis@schuppentier.org>
# Contributor: rob2uk <rob22uk at gmail dot com>
# Contributor: Vlad <vlad@archlinux.net>
# Contributor: Sebastien Bariteau <numkem@gmail.com>

pkgname=atlassian-jira
pkgver=9.4.0
pkgrel=1
pkgdesc="Bug tracking, issue tracking and project management software"
url="https://www.atlassian.com/software/jira"
license=('custom')
arch=('any')
conflicts=('atlassian-jira-lts')
depends=('java-environment=8')
optdepends=('mysql-connector-java: connect to MySQL')
backup=('etc/conf.d/jira'
        'etc/webapps/atlassian-jira/server.xml')
install='jira.install'
source=("https://product-downloads.atlassian.com/software/jira/downloads/atlassian-jira-core-${pkgver}.tar.gz"
        'jira.conf.d'
        'jira.service')
sha256sums=('145947894dee7ea6882b615114ba163b5351f6057db8d42d7c88c46f9f2eb8d5'
            '457fd1c5bcedc81e64f71cb890b600944a5be7980716b7f49f9a8c810565dbfb'
            'd61181154183301a551b1ae85a7d42c7d60ae2c36e545d2ab8ef5cc969def717')

package() {
    mkdir -p "$pkgdir/opt/atlassian-jira/"
    cp -r "$srcdir/atlassian-jira-core-$pkgver-standalone/"* "$pkgdir/opt/atlassian-jira/"

    # Copy License
    mkdir -p "${pkgdir}/usr/share/licenses/atlassian-jira"
    cp "${pkgdir}/opt/atlassian-jira/licenses/com.atlassian.ip--atlassian-ip--3.0.txt" "${pkgdir}/usr/share/licenses/atlassian-jira/LICENSE"

    # remove unneeded files
    find "$pkgdir/opt/atlassian-jira/bin" -name '*.bat' -type f -exec rm "{}" \;
    find "$pkgdir/opt/atlassian-jira/bin" -name '*.exe' -type f -exec rm "{}" \;
    find "$pkgdir/opt/atlassian-jira/bin" -name '*.dll' -type f -exec rm "{}" \;
    find "$pkgdir/opt/atlassian-jira/bin" -name '*.x64' -type f -exec rm "{}" \;
    find "$pkgdir/opt/atlassian-jira/bin" -name '*.sh' -type f -exec rm "{}" \;
    find "$pkgdir/opt/atlassian-jira/bin" -name '*.command' -type f -exec rm "{}" \;

    # Set home dir
    echo "jira.home=/var/opt/atlassian-jira" > "$pkgdir/opt/atlassian-jira/atlassian-jira/WEB-INF/classes/jira-application.properties"

    # Move server.xml to /etc and create symlink
    mkdir -p "${pkgdir}/etc/webapps/atlassian-jira"
    mv "${pkgdir}/opt/atlassian-jira/conf/server.xml" "${pkgdir}/etc/webapps/atlassian-jira/server.xml"
    ln -s "/etc/webapps/atlassian-jira/server.xml" "${pkgdir}/opt/atlassian-jira/conf/server.xml"

    # Create home directory
    install -dm755 "$pkgdir/var/opt/atlassian-jira"

    # Install systemd unit
    install -Dm644 "$srcdir/jira.service" "$pkgdir/usr/lib/systemd/system/jira.service"
    install -Dm644 "$srcdir/jira.conf.d" "$pkgdir/etc/conf.d/jira"
}