forked from skyrings/skyring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathskyring.spec
105 lines (88 loc) · 3.24 KB
/
skyring.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
# Determine if systemd will be used
%if ( 0%{?fedora} && 0%{?fedora} > 16 ) || ( 0%{?rhel} && 0%{?rhel} > 6 )
%global with_systemd 1
%endif
%define pkg_name skyring
%define pkg_version 0.0.1
%define pkg_release 1
Name: %{pkg_name}
Version: %{pkg_version}
Release: %{pkg_release}%{?dist}
Summary: Modern extensible web-based storage management platform
Source0: %{pkg_name}-%{pkg_version}.tar.gz
License: Apache-2.0
Group: Applications/Storage
BuildRoot: %{_tmppath}/%{pkg_name}-%{pkg_version}-%{pkg_release}-buildroot
Url: github.com/skyrings/skyring
%if 0%{?with_systemd}
BuildRequires: systemd
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%else
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/service
Requires(preun): /sbin/chkconfig
Requires(postun): /sbin/service
%endif
BuildRequires: golang
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: openldap-devel
Requires: salt-master >= 2015.5.5
Requires: pytz
Requires: python-cpopen
Requires: python-netaddr
Requires: mongodb
Requires: mongodb-server
%description
SkyRing is a modern, extensible web-based storage management platform
which represents the future of storage management. SkyRing deploys,
manages and monitors various storage technologies and provides
a pluggable framework for tomorrow’s SDS technologies.
SkyRing integrates best-of-breed open source components at its core,
and integrates with the broader management stack.
%prep
%setup -n %{pkg_name}-%{pkg_version}
%build
make build-special
make pybuild
%install
rm -rf $RPM_BUILD_ROOT
install -D skyring $RPM_BUILD_ROOT/usr/bin/skyring
install -D skyring-setup.sh $RPM_BUILD_ROOT/usr/bin/skyring-setup.sh
install -D conf/sample/skyring.conf.sample $RPM_BUILD_ROOT/etc/skyring/skyring.conf
install -D conf/sample/authentication.conf.sample $RPM_BUILD_ROOT/etc/skyring/authentication.conf
install -D conf/skyring_salt_master.conf $RPM_BUILD_ROOT/etc/salt/master.d/skyring.conf
install -m 755 -d $RPM_BUILD_ROOT/srv/salt
install -m 755 -d $RPM_BUILD_ROOT/srv/salt/collectd
install -m 755 -d $RPM_BUILD_ROOT/srv/salt/template
install -m 755 -d $RPM_BUILD_ROOT/srv/salt/collectd/files
install -m 755 -d $RPM_BUILD_ROOT/var/log/skyring
install -D backend/salt/sls/*.* $RPM_BUILD_ROOT/srv/salt/
install -D backend/salt/sls/collectd/*.* $RPM_BUILD_ROOT/srv/salt/collectd
install -D backend/salt/conf/collectd/* $RPM_BUILD_ROOT/srv/salt/collectd/files
install -D backend/salt/template/* $RPM_BUILD_ROOT/srv/salt/template
install -d $RPM_BUILD_ROOT/%{python2_sitelib}/skyring
install -D backend/salt/python/skyring/* $RPM_BUILD_ROOT/%{python2_sitelib}/skyring/
install -D -p -m 0644 misc/systemd/%{name}d.service %{buildroot}%{_unitdir}/%{name}d.service
install -D -p -m 0755 misc/etc.init/%{name}.initd %{buildroot}%{_sysconfdir}/init.d/%{name}d
%post
%preun
%clean
rm -rf "$RPM_BUILD_ROOT"
%files
%attr(0755, root, root) /usr/bin/skyring
%attr(0755, root, root) /usr/bin/skyring-setup.sh
%{_sysconfdir}/skyring/*
%{_sysconfdir}/salt/master.d/skyring.conf
%{python2_sitelib}/skyring/*
%{_var}/log/skyring
/srv/salt/*
%{_unitdir}/%{name}d.service
%{_sysconfdir}/init.d/%{name}d
%changelog
* Tue Dec 29 2015 <[email protected]>
- Added daemonizing mechanism
* Thu Dec 03 2015 <[email protected]>
- Initial build.