summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: acb5e024ab20892e4d39688d1392a1900013cc55 (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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
pkgname=cms-germany-git
pkgver=r5032.b78d8a4e
pkgrel=1
pkgdesc="CMS, or Contest Management System, is a distributed system for running and (to some extent) organizing a programming contest. This is a fork used for the German IOI team selection process."
arch=('i686' 'x86_64')
url="https://github.com/ioi-germany/cms"
license=('AGPL3')
depends=(
    'isolate'
    'python'
    'python-tornado'
    'python-psycopg2'
    'python-sqlalchemy1.3'
    'python-netifaces'
    'python-pycryptodomex'
    'python-pytz'
    'python-psutil'
    'python-six'
    'python-requests'
    'python-gevent'
    'python-werkzeug'
    'python-bcrypt'
    'python-chardet'
    'python-yaml'
    'python-future'
    'python-jinja'
    'python-markupsafe'
    'python-pyxdg'
    'postgresql'
    'postgresql-client'
    'iso-codes'
    'shared-mime-info'
    'asymptote'
    'texlive-core'
    'texlive-fontsextra'
    'texlive-latexextra'
    'texlive-pstricks'
    'libcap'
    'python-babel'
)
optdepends=(
    'python-pycups: printing support'
    'python-pypdf: printing support'
    'a2ps: printing support'
    'fpc: support for Pascal submissions'
    'jdk8-openjdk: support for Java submissions'
)
makedepends=(
    'git'
    'asciidoc'
    'python-setuptools'
)
backup=(
    'etc/cms.conf'
    'etc/cms.ranking.conf'
)

provides=('cms-germany')
conflicts=('cms')
install=$pkgname.install

source=(
    'git+https://github.com/ioi-germany/cms.git#branch=main'
    'dont_install_isolate.patch'
    'new_jinja2_1.patch'
    'new_jinja2_2.patch'
)
sha256sums=(
    'SKIP'
    'SKIP'
    'SKIP'
    'SKIP'
)

pkgver() {
    cd cms
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
    true
}

package() {
    cd cms

    patch prerequisites.py ../dont_install_isolate.patch
    patch cms/grading/ParameterTypes.py ../new_jinja2_1.patch
    patch cms/server/jinja2_toolbox.py ../new_jinja2_2.patch

    # Logs and cache directories
    install -d -m770 $pkgdir/var/log/cms
    install -d -m770 $pkgdir/var/cache/cms

    # Configuration files
    install -D -m660 config/cms.conf.sample $pkgdir/etc/cms.conf
    install -D -m660 config/cms.ranking.conf.sample $pkgdir/etc/cms.ranking.conf

    # I'm not even sure if this is needed at all
    install -d -m770 $pkgdir/var/lib/cms

    python3 prerequisites.py --as-root build
    python3 setup.py install --root="$pkgdir" --optimize=1

    install -d $pkgdir/var/local/log
    install -d $pkgdir/var/local/cache
    install -d $pkgdir/var/local/lib
    install -d $pkgdir/var/local/run
    ln -s /var/log/cms $pkgdir/var/local/log/cms
    ln -s /var/cache/cms $pkgdir/var/local/cache/cms
    ln -s /var/lib/cms $pkgdir/var/local/lib/cms
}