-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecodex-monitor.spec
More file actions
88 lines (69 loc) · 2.83 KB
/
recodex-monitor.spec
File metadata and controls
88 lines (69 loc) · 2.83 KB
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
%define name recodex-monitor
%define short_name monitor
%define version 1.3.0
%define unmangled_version 3225ceb1c076c7a35d83abb28195bcac0c999f51
%define release 1
Summary: Publish ZeroMQ messages through WebSockets
Name: %{name}
Version: %{version}
Release: %{release}
License: MIT
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
BuildArch: noarch
Vendor: Petr Stefan <UNKNOWN>
Url: https://github.com/ReCodEx/monitor
BuildRequires: systemd
%{?fedora:BuildRequires: python3 python3-devel python3-setuptools python3-pip python3-wheel}
%{?rhel:BuildRequires: python3 python3-devel python3-setuptools python3-pip python3-wheel}
BuildRequires: python3dist(build)
BuildRequires: python3dist(setuptools) >= 61.0
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Requires: python3-PyYAML python3-websockets >= 14.2 python3-pyzmq
Source0: https://github.com/ReCodEx/%{short_name}/archive/%{unmangled_version}.tar.gz#/%{short_name}-%{unmangled_version}.tar.gz
%description
Monitor is a proxying component that channels zeromq messages into websocket. It is a part of ReCodEx code examiner, an educational application for evaluating programming assignments.
%prep
%setup -n %{short_name}-%{unmangled_version}
%build
# Build using modern Python build system with pyproject.toml
# This replaces the legacy setup.py build process
%{python3} -m build --wheel --no-isolation
%install
# Install the wheel using pip (modern approach)
%{python3} -m pip install --no-deps --no-index --find-links dist/ --root=%{buildroot} recodex-monitor
# Create log directory
mkdir -p %{buildroot}/var/log/recodex
# Install system files manually (these files are no longer installed automatically with pyproject.toml)
mkdir -p %{buildroot}/lib/systemd/system
mkdir -p %{buildroot}%{_sysconfdir}/recodex/monitor
install -m 644 monitor/install/recodex-monitor.service %{buildroot}/lib/systemd/system/
install -m 644 monitor/install/config.yml %{buildroot}%{_sysconfdir}/recodex/monitor/
%clean
rm -rf $RPM_BUILD_ROOT
%pre
getent group recodex >/dev/null || groupadd -r recodex
getent passwd recodex >/dev/null || useradd -r -g recodex -d %{_sysconfdir}/recodex -s /sbin/nologin -c "ReCodEx Code Examiner" recodex
exit 0
%post
#%if 0%{?rhel}
# pip3 install websockets zmq
#%endif
%systemd_post 'recodex-monitor.service'
%preun
%systemd_preun 'recodex-monitor.service'
%postun
%systemd_postun_with_restart 'recodex-monitor.service'
%files
%defattr(-,root,root)
%dir %attr(-,recodex,recodex) %{_sysconfdir}/recodex/monitor
%dir %attr(-,recodex,recodex) /var/log/recodex
%{python3_sitelib}/monitor/
%{python3_sitelib}/recodex_monitor-%{version}.dist-info/
%{_bindir}/recodex-monitor
%config(noreplace) %attr(0600,recodex,recodex) %{_sysconfdir}/recodex/monitor/config.yml
/lib/systemd/system/recodex-monitor.service
%changelog