-
Notifications
You must be signed in to change notification settings - Fork 1
/
ssvp.spec.fmt
52 lines (43 loc) · 1.98 KB
/
ssvp.spec.fmt
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
Name: ssvp
Version: <VERSION>
Release: 1%{?dist}
Summary: server statistics viewer project
License: AGPL-3.0-or-later
URL: https://github.com/amyipdev/ssvp
Source0: %{name}-%{version}.tar.gz
BuildRequires: nodejs nodejs-npm make
Requires: bash python3 python3-gunicorn mysql-connector-python3 python3-psycopg2 python3-pyOpenSSL python3-requests python3-flask jq
BuildArch: noarch
%description
SSVP - the Server Statistics Viewer Project
%prep
%setup -n ssvp
%build
npm i
%make_build
%install
mkdir -p -m0755 %{buildroot}/opt/ssvp
mkdir -p %{buildroot}/usr/lib/systemd/system
# TODO: just copy necessary folders
cp -a %{_builddir}/ssvp/installer %{_builddir}/ssvp/assets %{_builddir}/ssvp/srv %{_builddir}/ssvp/web %{buildroot}/opt/ssvp
cp %{_builddir}/ssvp/LICENSE %{_builddir}/ssvp/README.md %{_builddir}/ssvp/venv-wrapper.sh %{_builddir}/ssvp/release-info.json %{buildroot}/opt/ssvp
sed -e "s.<INSTALLDIR>./opt/ssvp.g" %{buildroot}/opt/ssvp/srv/systemd/ssvp-gunicorn.service > %{buildroot}/usr/lib/systemd/system/ssvp-gunicorn.service
sed -e "s.<INSTALLDIR>./opt/ssvp.g" %{buildroot}/opt/ssvp/srv/systemd/ssvp-werkzeug.service > %{buildroot}/usr/lib/systemd/system/ssvp-werkzeug.service
sed -e "s.<INSTALLDIR>./opt/ssvp.g" %{buildroot}/opt/ssvp/srv/systemd/ssvp-interval.timer > %{buildroot}/usr/lib/systemd/system/ssvp-interval.timer
sed -e "s.<INSTALLDIR>./opt/ssvp.g" %{buildroot}/opt/ssvp/srv/systemd/ssvp-interval.service > %{buildroot}/usr/lib/systemd/system/ssvp-interval.service
rm -rf %{buildroot}/srv/__pycache__ %{buildroot}/ssvplwc %{buildroot}/systemd
rm -f %{buildroot}/opt/ssvp/srv/ssvp-config.json
%preun
systemctl disable --now ssvp-gunicorn
systemctl disable --now ssvp-werkzeug
systemctl disable --now ssvp-interval.timer
%files
%license LICENSE
%doc README.md
%defattr(-,root,root)
/opt/ssvp/
%attr(755,root,root) /opt/ssvp/srv/gunicorn.sh
/usr/lib/systemd/system/*
%changelog
* Sat Aug 12 2023 Amy Parker <[email protected]>
-