/
trialinfo.spec
65 lines (54 loc) · 1.83 KB
/
trialinfo.spec
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
%undefine __brp_ldconfig
%undefine __brp_mangle_shebangs
%undefine __brp_strip_static_archive
Summary: Web application for managing observed trials competitions
Name: trialinfo
Version: %{VERSION}
Release: 0%{?dist}
BuildArch: noarch
Requires: nodejs mariadb-server python3-poppler-qt5 poppler-utils
Source0: %{name}-%{version}.tar.gz
Source1: snapshot.tar.gz
License: AGPLv3+
URL: https://github.com/trialinfo/trialinfo
%description
A web application for managing observed trials motorbike and bicycle
competitions. The code is mainly in English; the documentation and user
interface are in German.
%prep
%autosetup -p1
tar -xzf "%{SOURCE1}"
%build
ls
make build
rm -fv backend/views/*.marko backend/emails/*.marko
( cd backend/dist
find . -type f -print0 \
| xargs -0 -i'{}' cp -v --parents '{}' .. )
rm -rf backend/dist
%check
%install
find -depth \( -name debian -o -name Makefile -o -name create-db.sql \) -prune -o -print \
| cpio -pd %{buildroot}/var/lib/%{name}
install -d %{buildroot}/var/lib/${package}/pdf
# install -D create-db.sql %{buildroot}/usr/share/doc/${package}/create-db.sql
install -d %{buildroot}/etc/systemd/system
install -m 644 systemd/%{name}.service systemd/%{name}.socket \
%{buildroot}/etc/systemd/system/
install -m 644 systemd/%{name}.service systemd/%{name}-secure.socket \
%{buildroot}/etc/systemd/system/
echo %{VERSION} > %{buildroot}/var/lib/%{name}/backend/version.txt
%post
useradd --system trialinfo || [ $? -eq 9 ]
systemctl stop trialinfo.service 2> /dev/null || :
systemctl daemon-reload
systemctl restart trialinfo.socket 2> /dev/null || :
%files
/etc/systemd/system/%{name}.service
/etc/systemd/system/%{name}.socket
/etc/systemd/system/%{name}-secure.socket
%doc create-db.sql
/var/lib/%{name}/
%changelog
* Sat Jan 5 2019 Andreas Gruenbacher <andreas.gruenbacher@gmail.com> - %{version}-%{release}
- Initial package.