-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstats-rrdb.spec.in
106 lines (76 loc) · 2.51 KB
/
stats-rrdb.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
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
%define username @STATS_RRDB_USER@
%define groupname @STATS_RRDB_GROUP@
Name: @PACKAGE_NAME@
Version: @PACKAGE_VERSION@
Release: 1%{?dist}
Summary: High Performance Round Robin DB Server for stats collection
Group: System Environment/Daemons
License: MIT
URL: https://github.com/lsh123/stats-rrdb
Source0: %{name}-%{version}.tar.gz
Requires: boost153 logrotate
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig, /sbin/service
Requires(postun): /sbin/service
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: boost153-devel
%description
stats-rrdb is a high-performance RRDB (Round Robin DB) server for storing,
aggregating and querying of various statistical data
%prep
%setup -q
%build
%configure
make %{?_smp_mflags}
%check
echo "Run checks another day"
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} INSTALL="%{__install} -p"
# Init script
install -Dp -m0755 deploy/init.d/%{name} %{buildroot}%{_initrddir}/%{name}
# pid directory
mkdir -p %{buildroot}/%{_localstatedir}/run/%{name}
# log directory
mkdir -p %{buildroot}/%{_localstatedir}/log/%{name}
# data directory
mkdir -p %{buildroot}/%{_localstatedir}/%{name}
%clean
rm -rf %{buildroot}
%pre
getent group %{groupname} >/dev/null || groupadd -r %{groupname}
getent passwd %{username} >/dev/null || \
useradd -r -g %{groupname} -d %{_localstatedir}/run/%{name} \
-s /sbin/nologin -c "StatsRRDB" %{username}
exit 0
%post
/sbin/chkconfig --add %{name}
%preun
if [ "$1" = 0 ] ; then
/sbin/service %{name} stop > /dev/null 2>&1
/sbin/chkconfig --del %{name}
fi
exit 0
%postun
if [ "$1" -ge 1 ]; then
/sbin/service %{name} condrestart > /dev/null 2>&1
fi
exit 0
%files
%defattr(-,root,root,-)
%exclude %{_bindir}/%{name}-tests
%exclude %{_libdir}/lib%{name}.*
%{_bindir}/%{name}
%{_initrddir}/%{name}
# %{_libdir}/lib%{name}.a
# %{_libdir}/lib%{name}.so
# %{_libdir}/lib%{name}.so.*
%doc AUTHORS ChangeLog COPYING NEWS README.md LANGUAGE.md examples/
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%dir %attr(755,%{username},%{groupname}) %{_localstatedir}/run/%{name}
%dir %attr(755,%{username},%{groupname}) %{_localstatedir}/log/%{name}
%dir %attr(750,%{username},%{groupname}) %{_localstatedir}/%{name}
%changelog
* Fri Jun 14 2013 Aleksey Sanin <[email protected]>
- Initial spec file created via rpmdev-newspec, added conf file, init.d, logrotate.d and various dirs