summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: acd41fded7d480cb35582a367f9b1f8741b92a47 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Maintainer: Ashley Bone <ashley DOT bone AT pm DOT me>

pkgname=healthchecks
_pkgver=3.0.1
pkgver=3.0.1
pkgrel=1
pkgdesc="A cron monitoring service with a web-based dashboard, API, and notification integrations."
arch=('any')
url="https://github.com/healthchecks/healthchecks"
license=('BSD')
depends=('python-aiosmtpd' 'python-cron-descriptor' 'python-cronsim' 'python-django'
	 'python-django-compressor' 'python-django-stubs-ext' 'python-fido2' 'python-pyotp'
	 'python-pytz' 'python-pycurl' 'python-pydantic' 'python-segno' 'python-statsd' 'python-whitenoise'
	 'uwsgi' 'uwsgi-plugin-python')
optdepends=('python-psycopg2: Add support for postgreSQL.'
	    'python-apprise: Add support for the Apprise integration.')
backup=("var/lib/$pkgname/local_settings.py" "etc/uwsgi/$pkgname.ini")
install="$pkgname.install"
source=("$url/archive/refs/tags/v$_pkgver.tar.gz"
	"hc-clean-db"
	"hc-manage"
	"$pkgname-clean-db.service"
	"$pkgname-clean-db.timer"
	"$pkgname.ini"
	"$pkgname-nginx.conf"
	"$pkgname.service"
	"$pkgname.sysusers"
        "$pkgname.tmpfiles"
	"local_settings.py"
        "settings.patch")
sha256sums=('b6a567e59d6a3e1916882fa39794c9cfceb3c1ee6135464f604adc35d64d4b82'
	    'a7b75bdd35c6952e06e1cd3824450f7c613aff5e3fb1d9f4f57f517b57cefbde'
	    '355ac237284642e24a3cbe7ddb285bf7dbb802e72ea7fe7c68f0476178ab94fc'
	    '9d32c4d1404079cac9b7a4ccbc97e01d867735c2536f915220d2ac5dffc333e7'
	    '39d54c71890449a8f114c756cb96c87bf40538f7dbb056eb5c19882cc40e59da'
	    'd6eba99257afc8f75092af7d018d56618d0930ad2258fa6963d86089b7b3c35a'
	    '55af4162848e448233fea8eefa42f4bc8c09f99be9d9fb0c8841a9dd38e95dd5'
	    'efa32e5bb8ef6dae017e2e196e8a37e42e73c2aade36743905f544c0c8b936b8'
	    '2407d81ae0224d5c394b35e20a3b29d138fbde3fdde951de9dfea44d97e73eca'
	    'c04de046d176958b3705d751ac09cf018d395b6c37f38977ec4048a561d5041f'
	    '4cb8857de8ef834e0e41eddc56a3e7bbab63adb210196642ca2544b48220f31d'
	    '86dbe0d8ac731908833848fdae056722f10a10647c5256eab4413e80663f23ca')

prepare () {
    cd "$pkgname-$_pkgver/hc"
    echo $(pwd)
    patch -p0 -i '../../settings.patch'
}
    
build() {
    cd "$pkgname-$_pkgver"
    
    # create the python compiled files, static-collected files and an initial database
    python -m compileall .
    ./manage.py compress --force
    ./manage.py collectstatic --no-input
}

check() {
    cd "$pkgname-$_pkgver"
    ./manage.py test
}

package() {
    cd "$pkgname-$_pkgver"
    
    # create directories
    install -dm755 "$pkgdir/etc/uwsgi"
    install -dm755 "$pkgdir/usr/bin"
    install -dm755 "$pkgdir/usr/lib/systemd/system"
    install -dm755 "$pkgdir/usr/lib/"{healthchecks,sysusers.d,tmpfiles.d}
    install -dm755 "$pkgdir/usr/share/"{doc,licenses,webapps}/"$pkgname"
    install -dm755 "$pkgdir/var/lib/$pkgname"

    # install healthchecks
    cp -r {hc,__pycache__,static,static-collected,stuff,templates} "$pkgdir/usr/share/webapps/$pkgname/"
    install -Dm755 manage.py "$pkgdir/usr/share/webapps/$pkgname/"
    install -Dm644 CHANGELOG.md "$pkgdir/usr/share/webapps/$pkgname/"
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/"
    install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/"

    # install our package files - config, scripts, uwsgi and nginx config, service files, sysusers/tmpfiles
    cd "$srcdir"
    install -Dm644 "$pkgname.ini" "$pkgdir/etc/uwsgi/"
    install -Dm644 "$pkgname-nginx.conf" "$pkgdir/usr/share/doc/$pkgname/"
    install -Dm600 "local_settings.py" "$pkgdir/var/lib/$pkgname/"
    ln -s "/var/lib/$pkgname/local_settings.py" "$pkgdir/usr/share/webapps/$pkgname/hc/local_settings.py"

    install -Dm755 hc-manage "$pkgdir/usr/bin"
    install -Dm755 hc-clean-db "$pkgdir/usr/lib/$pkgname"

    install -Dm644 "$pkgname-clean-db.service" "$pkgdir/usr/lib/systemd/system/"
    install -Dm644 "$pkgname-clean-db.timer" "$pkgdir/usr/lib/systemd/system/"
    install -Dm644 "$pkgname.service" "$pkgdir/usr/lib/systemd/system/"

    install -Dm644 "$pkgname.sysusers" "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
    install -Dm644 "$pkgname.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
}