-
Notifications
You must be signed in to change notification settings - Fork 17
/
daemontools.spec
131 lines (103 loc) · 3.29 KB
/
daemontools.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
%define _name daemontools
%define _ver 0.76
%define _dist %(sh /usr/lib/rpm/redhat/dist.sh)
%define _rel 1%{?_dist}
%global debug_package %{nil}
Name: %{_name}
Version: %{_ver}
Release: %{_rel}
Summary: Service Monitoring and Logging Utilities
Group: Unspecified
License: Public Domain
URL: http://cr.yp.to/daemontools.html
Source0: http://cr.yp.to/daemontools/%{_name}-%{_ver}.tar.gz
Patch0: daemontools-error.h.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
daemontools is a collection of tools for managing UNIX services.
supervise monitors a service. It starts the service and restarts the service
if it dies. Setting up a new service is easy: all supervise needs is a directory
with a run script that runs the service.
multilog saves error messages to one or more logs. It optionally timestamps each
line and, for each log, includes or excludes lines matching specified patterns.
It automatically rotates logs to limit the amount of disk space used.
If the disk fills up, it pauses and tries again, without losing any data.
%prep
%setup -q -n admin/%{_name}-%{_ver}
%patch0 -p0
%build
./package/compile
%install
rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}/usr/bin
cp -p command/* ${RPM_BUILD_ROOT}/usr/bin
cp -fp ${RPM_SOURCE_DIR}/svscanboot ${RPM_BUILD_ROOT}/usr/bin
%if 0%{?rhel} >= 7 || 0%{?fedora} >= 23
mkdir -p ${RPM_BUILD_ROOT}/usr/lib/systemd/system
cp -p ${RPM_SOURCE_DIR}/daemontools.service ${RPM_BUILD_ROOT}/usr/lib/systemd/system
%endif
%if 0%{?el6}
mkdir -p ${RPM_BUILD_ROOT}/etc/init
cp -p ${RPM_SOURCE_DIR}/daemontools.conf ${RPM_BUILD_ROOT}/etc/init
%endif
%clean
rm -rf ${RPM_BUILD_ROOT}
%post
[ -d /service ] || mkdir /service
%if 0%{?el6}
initctl reload-configuration
%endif
%if 0%{?el5} || 0%{?el4}
echo 'SV:123456:respawn:/usr/bin/svscanboot' >> /etc/inittab
%endif
%preun
%if 0%{?rhel} >= 7 || 0%{?fedora} >= 23
systemctl stop daemontools.service
systemctl disable daemontools.service 2> /dev/null
%endif
%if 0%{?el6}
initctl stop daemontools > /dev/null 2>&1 ||:
%endif
%if 0%{?el5} || 0%{?el4}
pkill svscan ||:
pkill svscanboot ||:
%endif
%postun
%if 0%{?el6}
initctl reload-configuration
%endif
%if 0%{?el5} || 0%{?el4}
sed -i '/svscanboot/d' /etc/inittab
%endif
rmdir /service 2> /dev/null ||:
%files
%attr(0755,root,root) /usr/bin/envdir
%attr(0755,root,root) /usr/bin/envuidgid
%attr(0755,root,root) /usr/bin/fghack
%attr(0755,root,root) /usr/bin/multilog
%attr(0755,root,root) /usr/bin/pgrphack
%attr(0755,root,root) /usr/bin/readproctitle
%attr(0755,root,root) /usr/bin/setlock
%attr(0755,root,root) /usr/bin/setuidgid
%attr(0755,root,root) /usr/bin/softlimit
%attr(0755,root,root) /usr/bin/supervise
%attr(0755,root,root) /usr/bin/svc
%attr(0755,root,root) /usr/bin/svok
%attr(0755,root,root) /usr/bin/svscan
%attr(0555,root,root) /usr/bin/svscanboot
%attr(0755,root,root) /usr/bin/svstat
%attr(0755,root,root) /usr/bin/tai64n
%attr(0755,root,root) /usr/bin/tai64nlocal
%if 0%{?rhel} >= 7 || 0%{?fedora} >= 23
%attr(0644,root,root) /usr/lib/systemd/system/daemontools.service
%endif
%if 0%{?el6}
%attr(0644,root,root) /etc/init/daemontools.conf
%endif
%changelog
* Sun Jul 20 2014 teru <teru@kteru.net>
- Added startup script for el7
* Fri Sep 16 2011 teru <teru@kteru.net>
- Added startup script for el6
* Wed Mar 2 2011 teru <teru@kteru.net>
- Initial version