]>
Commit | Line | Data |
---|---|---|
1 | %bcond_without python # python bindings | |
2 | ||
3 | Summary: Tools and library to control and monitor control groups | |
4 | Summary(pl.UTF-8): Narzędzia i biblioteka do kontrolowania i monitorowania grup kontroli | |
5 | Name: libcgroup | |
6 | Version: 0.42.2 | |
7 | Release: 2 | |
8 | License: LGPL v2+ | |
9 | Group: Applications/System | |
10 | #Source0Download: https://github.com/libcgroup/libcgroup/releases | |
11 | Source0: https://github.com/libcgroup/libcgroup/releases/download/v%{version}/%{name}-%{version}.tar.bz2 | |
12 | # Source0-md5: 8311f5ea60c99756533fea40ee2e8a85 | |
13 | Source1: cgconfig.init | |
14 | Source2: cgred.init | |
15 | Source3: cgconfig.service | |
16 | Source4: cgred.service | |
17 | Source5: cgred.sysconfig | |
18 | Patch0: %{name}-pam.patch | |
19 | Patch1: %{name}-conf.patch | |
20 | Patch2: %{name}-missing.patch | |
21 | Patch3: %{name}-0.37-chmod.patch | |
22 | Patch4: %{name}-0.40.rc1-coverity.patch | |
23 | Patch5: %{name}-0.40.rc1-fread.patch | |
24 | Patch6: %{name}-0.40.rc1-templates-fix.patch | |
25 | Patch7: %{name}-0.41-change-cgroup-of-threads.patch | |
26 | URL: http://libcg.sourceforge.net/ | |
27 | BuildRequires: autoconf >= 2.69 | |
28 | BuildRequires: automake | |
29 | BuildRequires: bison | |
30 | BuildRequires: flex | |
31 | BuildRequires: libstdc++-devel | |
32 | BuildRequires: libtool >= 2:2 | |
33 | BuildRequires: pam-devel | |
34 | %{?with_python:BuildRequires: python-devel >= 2} | |
35 | BuildRequires: rpmbuild(macros) >= 1.626 | |
36 | BuildRequires: swig-python | |
37 | Requires(post,preun): /sbin/chkconfig | |
38 | Requires(postun): /usr/sbin/groupdel | |
39 | Requires(pre): /usr/bin/getgid | |
40 | Requires(pre): /usr/sbin/groupadd | |
41 | Requires(post,preun,postun): systemd-units >= 38 | |
42 | Requires: %{name}-libs = %{version}-%{release} | |
43 | Requires: procps | |
44 | Requires: rc-scripts | |
45 | Requires: systemd-units >= 38 | |
46 | Provides: group(cgred) | |
47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
48 | ||
49 | %define _exec_prefix %{nil} | |
50 | %define _libdir %{_prefix}/%{_lib} | |
51 | ||
52 | %description | |
53 | Control groups infrastructure. The tools and library help manipulate, | |
54 | control, administrate and monitor control groups and the associated | |
55 | controllers. | |
56 | ||
57 | %description -l pl.UTF-8 | |
58 | Ten pakiet stanowi infrastrukturę grup kontroli (cgroups). Narzędzia i | |
59 | biblioteka pomagają modyfikować, sterować, administrować i modyfikować | |
60 | grupy kontroli i powiązane z nimi kontrolery. | |
61 | ||
62 | %package -n pam-pam_cgroup | |
63 | Summary: PAM module for libcgroup | |
64 | Summary(pl.UTF-8): Moduł PAM dla libcgroup | |
65 | Group: Libraries | |
66 | Requires: %{name} = %{version}-%{release} | |
67 | Obsoletes: libcgroup-pam | |
68 | ||
69 | %description -n pam-pam_cgroup | |
70 | PAM module for libcgroup. | |
71 | ||
72 | %description -n pam-pam_cgroup -l pl.UTF-8 | |
73 | Moduł PAM dla libcgroup. | |
74 | ||
75 | %package libs | |
76 | Summary: Shared cgroup library | |
77 | Summary(pl.UTF-8): Biblioteka współdzielona cgroup | |
78 | Group: Libraries | |
79 | Conflicts: libcgroup < 0.41 | |
80 | ||
81 | %description libs | |
82 | Shared cgroup library. | |
83 | ||
84 | %description libs -l pl.UTF-8 | |
85 | Biblioteka współdzielona cgroup. | |
86 | ||
87 | %package devel | |
88 | Summary: Header files for cgroup library | |
89 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki cgroup | |
90 | Group: Development/Libraries | |
91 | Requires: %{name}-libs = %{version}-%{release} | |
92 | ||
93 | %description devel | |
94 | It provides API to create/delete and modify cgroup nodes. It will also | |
95 | in the future allow creation of persistent configuration for control | |
96 | groups and provide scripts to manage that configuration. | |
97 | ||
98 | %description devel -l pl.UTF-8 | |
99 | Ten pakiet udostępnia API do tworzenia, usuwania i modyfikowania | |
100 | węzłów cgroup. W przyszłości pozwoli także na tworzenie trwałej | |
101 | konfiguracji grup kontroli i udostępni skrypty do zarządzania taką | |
102 | konfiguracją. | |
103 | ||
104 | %package -n python-libcgroup | |
105 | Summary: Python binding for libcgroup | |
106 | Summary(pl.UTF-8): Wiązania Pythona do biblioteki libcgroup | |
107 | Group: Libraries/Python | |
108 | Requires: %{name}-libs = %{version}-%{release} | |
109 | ||
110 | %description -n python-libcgroup | |
111 | Python binding for libcgroup. | |
112 | ||
113 | %description -n python-libcgroup -l pl.UTF-8 | |
114 | Wiązania Pythona do biblioteki libcgroup. | |
115 | ||
116 | %prep | |
117 | %setup -q | |
118 | %patch0 -p1 | |
119 | %patch1 -p1 | |
120 | %patch2 -p1 | |
121 | %patch3 -p1 | |
122 | %patch4 -p1 | |
123 | %patch5 -p1 | |
124 | %patch6 -p1 | |
125 | %patch7 -p1 | |
126 | ||
127 | %build | |
128 | %{__libtoolize} | |
129 | %{__aclocal} | |
130 | %{__autoconf} | |
131 | %{__autoheader} | |
132 | %{__automake} | |
133 | %configure \ | |
134 | --bindir=/bin \ | |
135 | --sbindir=/sbin \ | |
136 | --disable-silent-rules \ | |
137 | --disable-static \ | |
138 | %{?with_python:--enable-bindings} \ | |
139 | --enable-initscript-install \ | |
140 | --enable-opaque-hierarchy="name=systemd" \ | |
141 | --enable-pam-module-dir=/%{_lib}/security | |
142 | ||
143 | %{__make} | |
144 | ||
145 | %install | |
146 | rm -rf $RPM_BUILD_ROOT | |
147 | install -d $RPM_BUILD_ROOT{/etc/{cgconfig.d,sysconfig},%{systemdunitdir}} | |
148 | ||
149 | %{__make} install \ | |
150 | DESTDIR=$RPM_BUILD_ROOT | |
151 | ||
152 | cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/cgconfig | |
153 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/cgred | |
154 | ||
155 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/cgconfig.service | |
156 | cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/cgred.service | |
157 | ||
158 | cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/cgred | |
159 | cp -a samples/cg{config,rules,snapshot_blacklist}.conf $RPM_BUILD_ROOT%{_sysconfdir} | |
160 | ||
161 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/libcgroup.so.* $RPM_BUILD_ROOT/%{_lib} | |
162 | ln -snf ../../%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libcgroup.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libcgroup.so | |
163 | ||
164 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libcgroupfortesting.* | |
165 | ||
166 | %if %{with python} | |
167 | install -d $RPM_BUILD_ROOT%{py_sitedir} | |
168 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/_libcgroup.so $RPM_BUILD_ROOT%{py_sitedir} | |
169 | %endif | |
170 | %{__rm} $RPM_BUILD_ROOT/%{_lib}/security/pam_cgroup.la | |
171 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la | |
172 | ||
173 | %clean | |
174 | rm -rf $RPM_BUILD_ROOT | |
175 | ||
176 | %pre | |
177 | %groupadd -g 261 -r -f cgred | |
178 | ||
179 | %post | |
180 | /sbin/chkconfig --add cgred | |
181 | /sbin/chkconfig --add cgconfig | |
182 | if [ ! -f /var/lock/subsys/cgconfig ]; then | |
183 | echo 'Run "/sbin/service cgconfig start" to setup cgroup rules.' | |
184 | fi | |
185 | if [ ! -f /var/lock/subsys/cgred ]; then | |
186 | echo 'Run "/sbin/service cgred start" to start control group rules daemon.' | |
187 | fi | |
188 | NORESTART=1 | |
189 | %systemd_post cgconfig.service | |
190 | %systemd_post cgred.service | |
191 | ||
192 | %preun | |
193 | if [ $1 = 0 ]; then | |
194 | %service cgred stop | |
195 | %service cgconfig stop | |
196 | /sbin/chkconfig --del cgconfig | |
197 | /sbin/chkconfig --del cgred | |
198 | fi | |
199 | %systemd_preun cgconfig.service | |
200 | %systemd_preun cgred.service | |
201 | ||
202 | %postun | |
203 | if [ "$1" = "0" ]; then | |
204 | %groupremove cgred | |
205 | fi | |
206 | %systemd_reload | |
207 | ||
208 | %triggerpostun -- %{name} < 0.38-0.rc1.1 | |
209 | if [ -f /etc/sysconfig/cgred.conf.rpmsave ]; then | |
210 | . /etc/sysconfig/cgred.conf.rpmsave | |
211 | OPTIONS= | |
212 | [ -n "$NODAEMON" ] && OPTIONS="$OPTIONS $NODAEMON" | |
213 | [ -n "$LOG" ] && OPTIONS="$OPTIONS $LOG" | |
214 | if [ -n "$LOG_FILE" ]; then | |
215 | OPTIONS="$OPTIONS -f $LOG_FILE" | |
216 | else | |
217 | OPTIONS="$OPTIONS -s" | |
218 | fi | |
219 | [ -n "$SOCKET_USER" ] && OPTIONS="$OPTIONS -u $SOCKET_USER" | |
220 | if [ -n "$SOCKET_GROUP" ]; then | |
221 | OPTIONS="$OPTIONS -g $SOCKET_GROUP" | |
222 | else | |
223 | OPTIONS="$OPTIONS -g cgred" | |
224 | fi | |
225 | echo >>/etc/sysconfig/cgred | |
226 | echo "# Added by rpm trigger" >>/etc/sysconfig/cgred | |
227 | echo "OPTIONS=\"$OPTIONS\"" >>/etc/sysconfig/cgred | |
228 | fi | |
229 | %systemd_trigger cgconfig.service | |
230 | %systemd_trigger cgred.service | |
231 | ||
232 | %post libs -p /sbin/ldconfig | |
233 | %postun libs -p /sbin/ldconfig | |
234 | ||
235 | %files | |
236 | %defattr(644,root,root,755) | |
237 | %doc README README_daemon | |
238 | %attr(754,root,root) /etc/rc.d/init.d/cgconfig | |
239 | %attr(754,root,root) /etc/rc.d/init.d/cgred | |
240 | %dir /etc/cgconfig.d | |
241 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cgred | |
242 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/cg*.conf | |
243 | %{systemdunitdir}/cgconfig.service | |
244 | %{systemdunitdir}/cgred.service | |
245 | %attr(755,root,root) /bin/cgclassify | |
246 | %attr(755,root,root) /bin/cgcreate | |
247 | %attr(755,root,root) /bin/cgdelete | |
248 | %attr(755,root,root) /bin/cgexec | |
249 | %attr(755,root,root) /bin/cgget | |
250 | %attr(755,root,root) /bin/cgset | |
251 | %attr(755,root,root) /bin/cgsnapshot | |
252 | %attr(755,root,root) /bin/lscgroup | |
253 | %attr(755,root,root) /bin/lssubsys | |
254 | %attr(755,root,root) /sbin/cgclear | |
255 | %attr(755,root,root) /sbin/cgconfigparser | |
256 | %attr(755,root,root) /sbin/cgrulesengd | |
257 | %{_mandir}/man1/ls*.1* | |
258 | %{_mandir}/man1/cg*.1* | |
259 | %{_mandir}/man5/cg*.5* | |
260 | %{_mandir}/man8/cg*.8* | |
261 | ||
262 | %files -n pam-pam_cgroup | |
263 | %defattr(644,root,root,755) | |
264 | %attr(755,root,root) /%{_lib}/security/pam_cgroup.so | |
265 | ||
266 | %files libs | |
267 | %defattr(644,root,root,755) | |
268 | %attr(755,root,root) /%{_lib}/libcgroup.so.*.*.* | |
269 | %attr(755,root,root) %ghost /%{_lib}/libcgroup.so.1 | |
270 | ||
271 | %files devel | |
272 | %defattr(644,root,root,755) | |
273 | %attr(755,root,root) %{_libdir}/libcgroup.so | |
274 | %{_includedir}/libcgroup | |
275 | %{_includedir}/libcgroup.h | |
276 | %{_pkgconfigdir}/libcgroup.pc | |
277 | ||
278 | %if %{with python} | |
279 | %files -n python-libcgroup | |
280 | %defattr(644,root,root,755) | |
281 | %attr(755,root,root) %{py_sitedir}/_libcgroup.so | |
282 | %endif |