forked from Juniper/contrail-fabric-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fabric-utils.spec
72 lines (54 loc) · 1.72 KB
/
fabric-utils.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
# view contents of rpm file: rpm -qlp <filename>.rpm
%define _contrailopt /opt/contrail
%if 0%{?_buildTag:1}
%define _relstr %{_buildTag}
%else
%define _relstr %(date -u +%y%m%d%H%M)
%endif
%{echo: "Building release %{_relstr}\n"}
%if 0%{?_srcVer:1}
%define _verstr %{_srcVer}
%else
%define _verstr 1
%endif
Name: contrail-fabric-utils
Version: %{_verstr}
Release: %{_relstr}
Summary: Contrail Fabric Utilities%{?_gitVer}
BuildArch: noarch
Group: Applications/System
License: Commercial
Source0: git_root
%description
Contrail Fabric Utilities for cluster management
BuildRequires: systemd-units
%prep
if [ ! -d contrail-fabric-utils]; then
git clone ssh://git@bitbucket.org/contrail_admin/fabric-utils.git contrail-fabric-utils
else
(cd contrail-fabric-utils; git pull)
fi
%build
rm -rf contrail-fabric-utils/contrail_fabric_utils-0.1dev
rm -rf contrail-fabric-utils/contrail_fabric_utils.egg-info
(cd contrail-fabric-utils; %{__python} setup.py sdist)
%clean
%install
rm -rf %{buildroot}
install -d -m 755 %{buildroot}%{python_sitelib}
install -d -m 755 %{buildroot}%{_contrailopt}/utils
pushd contrail-fabric-utils
tar zxf dist/contrail_fabric_utils-0.1dev.tar.gz
cd contrail_fabric_utils-0.1dev
%{__python} setup.py install --root=%{buildroot}
cp README %{buildroot}%{_contrailopt}/utils/README.fabric
cp -R %{buildroot}%{python_sitelib}/contrail_fabric_utils/fabfile %{buildroot}%{_contrailopt}/utils/fabfile
popd
%post
%files
%defattr(-, root, root)
%{python_sitelib}/contrail_fabric_utils
%{python_sitelib}/contrail_fabric_utils-*.egg-info
%{_contrailopt}/utils/README.fabric
%{_contrailopt}/utils/fabfile
%changelog