-
Notifications
You must be signed in to change notification settings - Fork 12
/
avocado-server.spec
92 lines (76 loc) · 2.89 KB
/
avocado-server.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
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
%global modulename avocadoserver
%if ! 0%{?commit:1}
%define commit 2b69175c21f6e77068eb53c7d78c20a149fd0c97
%endif
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%define avocado_database_dir %{_sharedstatedir}/%{name}/database
%define avocado_dashboard_dir %{_datadir}/%{name}/dashboard
Summary: REST based interface for applications to communicate with the avocado test server
Name: avocado-server
Version: 0.26.0
Release: 1%{?dist}
License: GPLv2
Group: Development/Tools
URL: http://avocado-framework.readthedocs.org/
BuildArch: noarch
Source0: https://github.com/avocado-framework/%{name}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
BuildRequires: python2-devel
BuildRequires: systemd
Requires: python
Requires: python-django-rest-framework
Requires: python-django-rest-framework-nestedrouters
Requires: python-dj-static
Requires: python-gunicorn
Requires: systemd
Requires(pre): shadow-utils
%description
avocado-server provides a REST based interface for applications to communicate
with the avocado test server. It receives test activity updates by test jobs
running on other machines, consolidates various job and test results, etc.
%prep
%setup -q -n %{name}-%{commit}
mv dashboard/README.rst README-dashboard.rst
mv dashboard/LICENSE LICENSE-dashboard
%build
%{__python2} setup.py build
%install
%{__python2} setup.py install --root %{buildroot} --skip-build
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
mkdir -p $RPM_BUILD_ROOT%{avocado_database_dir}
mkdir -p $RPM_BUILD_ROOT%{avocado_dashboard_dir}
cp -r dashboard/static/* $RPM_BUILD_ROOT%{avocado_dashboard_dir}
install -p -m 644 data/systemd/%{modulename}.service $RPM_BUILD_ROOT%{_unitdir}/%{modulename}.service
%pre
getent group avocadoserver >/dev/null || groupadd -r avocadoserver
getent passwd avocadoserver >/dev/null || \
useradd -r -g avocadoserver -d /dev/null -s /sbin/nologin \
-c "Avocado Test Result Server" avocadoserver
exit 0
%post
%systemd_post %{modulename}.service
%preun
%systemd_preun %{modulename}.service
%postun
%systemd_postun
%files
%doc README.rst LICENSE README-dashboard.rst LICENSE-dashboard
%{python_sitelib}/%{modulename}
%{python_sitelib}/%{modulename}-*.egg-info
%{_bindir}/avocado-server-manage
%{_unitdir}/%{modulename}.service
%attr(770, avocadoserver, avocadoserver) %dir %{avocado_database_dir}
%{avocado_dashboard_dir}
%changelog
* Mon Jul 6 2015 Cleber Rosa <[email protected]> - 0.26.0-1
- Update to upstream version 0.26.0
* Mon Jul 6 2015 Cleber Rosa <[email protected]> - 0.25.0-3
- Add python-dj-static requirement
- Add dashboard static files
* Mon Jun 29 2015 Cleber Rosa <[email protected]> - 0.25.0-2
- Update python-django-rest-framework package names
* Tue Jun 16 2015 Lucas Meneghel Rodrigues <[email protected]> - 0.25.0-1
- Update to upstream version 0.25.0
* Thu May 29 2014 Cleber Rosa <[email protected]> - 0.2.0-1
- Release 0.2.0
* Mon May 12 2014 Cleber Rosa <[email protected]> - 0.1-1
- Initial build