summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2d83fefd7cff8f0a561408ddbe602fc31b8b9252 (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
# Maintainer: Dennis S. <dennis@stengele.me>
# Contributor: Sebastien Bariteau <numkem@gmail.com>
# Contributor: Vlad M. <vlad@archlinux.net>

pkgname=atlassian-confluence-lts
pkgver=6.13.8
pkgrel=1
pkgdesc="Enterprise wiki (Enterprise Release)"
url="https://www.atlassian.com/software/confluence"
license=('custom')
arch=('any')
conflicts=('atlassian-confluence')
depends=('java-environment=8')
optdepends=('mysql-connector-java: connect to MySQL')
backup=('etc/conf.d/confluence'
        'etc/webapps/atlassian-confluence/server.xml')
install='confluence.install'
source=("http://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-$pkgver.tar.gz"
        'confluence.conf.d'
        'confluence.service')
sha256sums=('85cf86e77124ea2ae9261534f88d540b06ff2989d1b44f3355f881a90dc39a07'
            'a6304ba13a8ab1e27761bd3be71d05d2c2e3d61ea308316f4a04723ea4b30fc1'
            'd51ad7cb3eb8a4d5553a26fd5567867345bb4ae9a10876fc2bee7b6ab8800824')

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

    # Copy License
    mkdir -p "${pkgdir}/usr/share/licenses/atlassian-confluence"
    cp "${pkgdir}/opt/atlassian-confluence/LICENSE" "${pkgdir}/usr/share/licenses/atlassian-confluence/LICENSE"

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

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

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

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

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