-
Notifications
You must be signed in to change notification settings - Fork 1
/
openstack-tuskar.spec
202 lines (162 loc) · 6.72 KB
/
openstack-tuskar.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
%global homedir %{_datadir}/tuskar
Name: openstack-tuskar
Version: XXX
Release: XXX{?dist}
Summary: A service for managing OpenStack deployments
Group: Applications/System
License: ASL 2.0
URL: https://github.com/openstack/tuskar
Source0: https://pypi.python.org/packages/source/t/tuskar/tuskar-%{version}.tar.gz
Source1: openstack-tuskar-api.service
BuildArch: noarch
BuildRequires: systemd-devel
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-lockfile
BuildRequires: python-pbr
BuildRequires: python-sphinx >= 1.1.3
Requires: python-sqlalchemy
Requires: python-migrate
Requires: python-anyjson
Requires: python-argparse
Requires: python-eventlet
Requires: python-kombu
Requires: python-lxml
Requires: python-webob
Requires: python-greenlet
Requires: python-iso8601
Requires: python-flask
Requires: python-flask-babel
Requires: python-pecan
Requires: python-wsme
Requires: python-six >= 1.5.2
Requires: python-posix_ipc
Requires: PyYAML
Requires: python-oslo-config
Requires: python-novaclient
Requires: python-keystoneclient
Requires: python-heatclient
Requires: openstack-tripleo-heat-templates
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
%description
Tuskar gives administrators the ability to control how and where OpenStack
services are deployed across the data-center. Using Tuskar, administrators
divide hardware into "resource classes" that allow predictable elastic scaling
as cloud demands grow. This resource orchestration allows Tuskar users to
ensure SLAs, improve performance, and maximize utilization across the
data-center.
%prep
%setup -q -n tuskar-%{upstream_version}
rm requirements.txt
%build
export OSLO_PACKAGE_VERSION=%{version}
%{__python2} setup.py build
%install
export OSLO_PACKAGE_VERSION=%{version}
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
install -d -m 755 %{buildroot}%{_sharedstatedir}/tuskar
install -d -m 755 %{buildroot}%{_sysconfdir}/tuskar
# Move config to /etc
mv etc/tuskar/tuskar.conf.sample %{buildroot}%{_sysconfdir}/tuskar/tuskar.conf
# Move the migrate.cfg file into the built python directory
mv tuskar/db/sqlalchemy/migrate_repo/migrate.cfg %{buildroot}%{python2_sitelib}/tuskar/db/sqlalchemy/migrate_repo/migrate.cfg
# install systemd scripts
install -d -m 755 %{buildroot}%{_unitdir}
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}
# set scripts to be executable
chmod +x %{buildroot}%{python2_sitelib}/tuskar/common/service.py
chmod +x %{buildroot}%{python2_sitelib}/tuskar/cmd/api.py
chmod +x %{buildroot}%{python2_sitelib}/tuskar/cmd/dbsync.py
chmod +x %{buildroot}%{python2_sitelib}/tuskar/cmd/load_roles.py
%files
%doc LICENSE README.rst
%{python2_sitelib}/tuskar
%{python2_sitelib}/*.egg-info
%{_unitdir}/openstack-tuskar-api.service
# binaries for tuskar
%attr(0755, root, root) %{_bindir}/tuskar-api
%attr(0755, root, root) %{_bindir}/tuskar-dbsync
%attr(0755, root, root) %{_bindir}/tuskar-load-roles
%attr(0755, root, root) %{_bindir}/tuskar-load-role
%attr(0755, root, root) %{_bindir}/tuskar-delete-roles
%attr(0755, root, root) %{_bindir}/tuskar-load-seed
%attr(0755, tuskar, tuskar) %{_sharedstatedir}/tuskar
%dir %attr(0755, root, tuskar) %{_sysconfdir}/tuskar
%config(noreplace) %attr(0644, root, root) %{_sysconfdir}/tuskar/tuskar.conf
# database
%ghost %attr(0755, root, root) %{python2_sitelib}/tuskar/openstack/common/db/tuskar.sqlite
%pre
# Add the "tuskar" user and group
getent group tuskar >/dev/null || groupadd -r tuskar
getent passwd tuskar >/dev/null || \
useradd -r -g tuskar -d %{_sharedstatedir}/tuskar -s /sbin/nologin \
-c "OpenStack Tuskar Daemons" tuskar
exit 0
%post
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%preun
if [ $1 -eq 0 ] ; then
/bin/systemctl --no-reload disable %{name}-api.service > /dev/null 2>&1 || :
/bin/systemctl stop %{name}-api.service > /dev/null 2>&1 || :
fi
%postun
if [ $1 -ge 1 ] ; then
/bin/systemctl try-restart %{name}-api.service >/dev/null 2>&1 || :
fi
%changelog
* Mon Oct 20 2014 Jordan OMara <[email protected]> 0.4.15-2
- tuskar user ([email protected])
* Thu Oct 16 2014 Jordan OMara <[email protected]> 0.4.15-1
- new source 0.4.15 ([email protected])
* Sat Jun 07 2014 Fedora Release Engineering <[email protected]> - 0.3.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Tue Apr 29 2014 Jordan OMara <[email protected]> 0.3.1-2
- incorrect previous patch, switched out ([email protected])
* Tue Apr 16 2014 Jordan OMara <[email protected]> 0.3.1-1
- new source 0.3.1 ([email protected])
- added jsonutils patch from oslo-incubator ([email protected])
* Wed Apr 16 2014 Jordan OMara <[email protected]> 0.3.0-1
- new source 0.3.0 ([email protected])
* Mon Apr 07 2014 Jordan OMara <[email protected]> 0.2.3-2
- adding python-six & python-posix_ipc dep ([email protected])
* Fri Apr 04 2014 Jordan OMara <[email protected]> 0.2.3-1
- new source 0.2.3 ([email protected])
* Thu Apr 03 2014 Jordan OMara <[email protected]> 0.2.2-3
- remove wsgi, add post/preun/postun runs for systemctl
- misc cleanup from additional reviews ([email protected])
* Tue Apr 01 2014 Jordan OMara <[email protected]> 0.2.2-2
- __python --> __python2 ([email protected])
* Wed Mar 26 2014 Jordan OMara <[email protected]> 0.2.2-1
- Fixing more rpmlint issues ([email protected])
* Fri Mar 14 2014 Jordan OMara <[email protected]> 0.1.0-3
- Fixing various rpm issues ([email protected])
* Wed Feb 26 2014 Jordan OMara <[email protected]> 0.7-2
- Adding PBR to buildrequires ([email protected])
* Wed Feb 19 2014 Jordan OMara <[email protected]> 0.7-1
- Adding PBR to buildrequires ([email protected])
* Wed Feb 19 2014 Jordan OMara <[email protected]> 0.6-1
- Removing %%configure block ([email protected])
* Wed Feb 19 2014 Jordan OMara <[email protected]> 0.5-1
- Fixing tuskar prep location ([email protected])
* Wed Feb 19 2014 Jordan OMara <[email protected]> 0.4-1
- Minor fixes for httpd.conf location ([email protected])
* Wed Feb 19 2014 Jordan OMara <[email protected]> 0.3-1
- Automatic commit of package [openstack-tuskar] release [0.2-1].
- Initialized to use tito. ([email protected])
- Initial commit of spec file, wsgi file and apache module for wsgi
- Merge "Getting correct count and attributes from database"
- Merge "Fix tuskar docs building" ([email protected])
- Fix tuskar docs building ([email protected])
- Getting correct count and attributes from database ([email protected])
* Wed Feb 19 2014 Jordan OMara <[email protected]> 0.2-1
- new package built with tito
* Wed Feb 19 2014 Jordan OMara <[email protected]> - 0.0.1-1
- initial package