forked from io-sea/GRH
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrh.spec.in
76 lines (63 loc) · 2.17 KB
/
grh.spec.in
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
Name: @PACKAGE@
Version: @VERSION@
Release: 0%{?dist}
Summary: Ganesha Request Handler Library to handle requests for a backend
License: LGPLv3
Group: Development/Libraries
Source0: @PACKAGE@-@VERSION@.tar.gz
%description
Handler for requests generated by the NFS-Ganesha tool
%package handler
Summary: Rest server and celery workers to defer requests
Requires: redis
BuildRequires: systemd
%{?systemd_requires}
BuildArch: noarch
%if 0%{?rhel} >= 8
Requires: python3
Requires: python3-flask
Requires: python3-celery
Requires: python3-redis
%else
Requires: python36
%endif
%global debug_package %{nil}
%prep
%setup -q
%description handler
REST server (python script and unit file), celery workers (python code and
unit file) to defer requests.
%build
%configure
make %{?_smp_mflags}
cd handler
%{__python3} setup.py build --verbose
%install
%make_install
# handler's stuff
cd %{_builddir}/%{name}-%{version}/handler
# python modules
%{__python3} setup.py install --single-version-externally-managed -O1 --root=%{buildroot} --install-scripts %{_sbindir} --record=HANDLER_INSTALLED_FILES
# services unitfiles
install -Dm644 systemd/grh_handler.service %{buildroot}%{_unitdir}/grh_handler.service
install -Dm644 systemd/grh_celery.service %{buildroot}%{_unitdir}/grh_celery.service
# services configuration
install -Dm644 systemd/grh_handler.conf %{buildroot}%{_sysconfdir}/sysconfig/grh_handler
install -Dm644 systemd/grh_celery.conf %{buildroot}%{_sysconfdir}/sysconfig/grh_celery
# grh_celery log dir
mkdir -m 0755 -p %{buildroot}%{_localstatedir}/log/grh_celery
%files handler -f %{_builddir}/%{name}-%{version}/handler/HANDLER_INSTALLED_FILES
%{_unitdir}/grh_celery.service
%{_unitdir}/grh_handler.service
%config(noreplace) %{_sysconfdir}/sysconfig/grh_handler
%config(noreplace) %{_sysconfdir}/sysconfig/grh_celery
%dir %{_localstatedir}/log/grh_celery
%post handler
%systemd_post grh_handler.service grh_celery.service
%preun handler
%systemd_preun grh_handler.service grh_celery.service
%postun handler
%systemd_postun_with_restart grh_handler.service grh_celery.service
%changelog
* Mon Dec 13 2021 Yoann VALERI <yoann.valeri@cea.fr> 0.1.0
- Add initial files for the Ganesha Request Handler Daemon