]>
Commit | Line | Data |
---|---|---|
e2916cc6 MK |
1 | %bcond_without python # python bindings |
2 | ||
3d200c45 JB |
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 | |
ada0366c | 5 | Name: libcgroup |
51630b4e | 6 | Version: 0.42.2 |
3be873a1 | 7 | Release: 2 |
b9cd8aa6 | 8 | License: LGPL v2+ |
38cd4e1d | 9 | Group: Applications/System |
51630b4e JB |
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 | |
49919ec9 JR |
13 | Source1: cgconfig.init |
14 | Source2: cgred.init | |
9166bcc3 JR |
15 | Source3: cgconfig.service |
16 | Source4: cgred.service | |
17 | Source5: cgred.sysconfig | |
a2a104fd | 18 | Patch0: %{name}-pam.patch |
9166bcc3 | 19 | Patch1: %{name}-conf.patch |
38cd4e1d | 20 | Patch2: %{name}-missing.patch |
9665627f AM |
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 | |
51630b4e | 25 | Patch7: %{name}-0.41-change-cgroup-of-threads.patch |
ada0366c | 26 | URL: http://libcg.sourceforge.net/ |
51630b4e | 27 | BuildRequires: autoconf >= 2.69 |
e8db3431 | 28 | BuildRequires: automake |
afdac001 | 29 | BuildRequires: bison |
ada0366c | 30 | BuildRequires: flex |
afdac001 | 31 | BuildRequires: libstdc++-devel |
51630b4e | 32 | BuildRequires: libtool >= 2:2 |
ada0366c | 33 | BuildRequires: pam-devel |
e2916cc6 | 34 | %{?with_python:BuildRequires: python-devel >= 2} |
9166bcc3 | 35 | BuildRequires: rpmbuild(macros) >= 1.626 |
38cd4e1d | 36 | BuildRequires: swig-python |
7e9e387f | 37 | Requires(post,preun): /sbin/chkconfig |
077903da JR |
38 | Requires(postun): /usr/sbin/groupdel |
39 | Requires(pre): /usr/bin/getgid | |
40 | Requires(pre): /usr/sbin/groupadd | |
6e86c65f | 41 | Requires(post,preun,postun): systemd-units >= 38 |
38cd4e1d | 42 | Requires: %{name}-libs = %{version}-%{release} |
7e9e387f | 43 | Requires: procps |
b9cd8aa6 | 44 | Requires: rc-scripts |
6e86c65f | 45 | Requires: systemd-units >= 38 |
077903da | 46 | Provides: group(cgred) |
ada0366c | 47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
23fdf35f | 48 | |
f6ad0e0b | 49 | %define _exec_prefix %{nil} |
0779ceb5 | 50 | %define _libdir %{_prefix}/%{_lib} |
080074c8 | 51 | |
23fdf35f | 52 | %description |
ada0366c PG |
53 | Control groups infrastructure. The tools and library help manipulate, |
54 | control, administrate and monitor control groups and the associated | |
55 | controllers. | |
23fdf35f | 56 | |
3d200c45 JB |
57 | %description -l pl.UTF-8 |
58 | Ten pakiet stanowi infrastrukturę grup kontroli (cgroups). Narzędzia i | |
e8db3431 | 59 | biblioteka pomagają modyfikować, sterować, administrować i modyfikować |
60 | grupy kontroli i powiązane z nimi kontrolery. | |
3d200c45 | 61 | |
38cd4e1d JB |
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 | ||
23fdf35f | 87 | %package devel |
3d200c45 JB |
88 | Summary: Header files for cgroup library |
89 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki cgroup | |
ada0366c | 90 | Group: Development/Libraries |
38cd4e1d | 91 | Requires: %{name}-libs = %{version}-%{release} |
23fdf35f PG |
92 | |
93 | %description devel | |
ada0366c PG |
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. | |
23fdf35f | 97 | |
3d200c45 JB |
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 | ||
38cd4e1d JB |
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} | |
ea035f2c | 109 | |
38cd4e1d JB |
110 | %description -n python-libcgroup |
111 | Python binding for libcgroup. | |
ea035f2c | 112 | |
38cd4e1d JB |
113 | %description -n python-libcgroup -l pl.UTF-8 |
114 | Wiązania Pythona do biblioteki libcgroup. | |
3d200c45 | 115 | |
23fdf35f | 116 | %prep |
38cd4e1d | 117 | %setup -q |
a2a104fd | 118 | %patch0 -p1 |
643b509a | 119 | %patch1 -p1 |
38cd4e1d | 120 | %patch2 -p1 |
9665627f AM |
121 | %patch3 -p1 |
122 | %patch4 -p1 | |
123 | %patch5 -p1 | |
124 | %patch6 -p1 | |
125 | %patch7 -p1 | |
23fdf35f PG |
126 | |
127 | %build | |
e8db3431 | 128 | %{__libtoolize} |
129 | %{__aclocal} | |
130 | %{__autoconf} | |
38cd4e1d | 131 | %{__autoheader} |
e8db3431 | 132 | %{__automake} |
0779ceb5 | 133 | %configure \ |
160fce69 JR |
134 | --bindir=/bin \ |
135 | --sbindir=/sbin \ | |
f6ad0e0b | 136 | --disable-silent-rules \ |
51630b4e | 137 | --disable-static \ |
e2916cc6 | 138 | %{?with_python:--enable-bindings} \ |
0779ceb5 | 139 | --enable-initscript-install \ |
38cd4e1d JB |
140 | --enable-opaque-hierarchy="name=systemd" \ |
141 | --enable-pam-module-dir=/%{_lib}/security | |
0779ceb5 | 142 | |
ada0366c | 143 | %{__make} |
23fdf35f PG |
144 | |
145 | %install | |
146 | rm -rf $RPM_BUILD_ROOT | |
3be873a1 | 147 | install -d $RPM_BUILD_ROOT{/etc/{cgconfig.d,sysconfig},%{systemdunitdir}} |
0779ceb5 | 148 | |
ada0366c PG |
149 | %{__make} install \ |
150 | DESTDIR=$RPM_BUILD_ROOT | |
23fdf35f | 151 | |
9665627f AM |
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 | |
49919ec9 | 154 | |
9665627f AM |
155 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/cgconfig.service |
156 | cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/cgred.service | |
9166bcc3 | 157 | |
9665627f | 158 | cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/cgred |
0779ceb5 | 159 | cp -a samples/cg{config,rules,snapshot_blacklist}.conf $RPM_BUILD_ROOT%{_sysconfdir} |
23fdf35f | 160 | |
51630b4e | 161 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/libcgroup.so.* $RPM_BUILD_ROOT/%{_lib} |
b9cd8aa6 | 162 | ln -snf ../../%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libcgroup.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libcgroup.so |
23fdf35f | 163 | |
51630b4e JB |
164 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libcgroupfortesting.* |
165 | ||
e2916cc6 | 166 | %if %{with python} |
38cd4e1d JB |
167 | install -d $RPM_BUILD_ROOT%{py_sitedir} |
168 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/_libcgroup.so $RPM_BUILD_ROOT%{py_sitedir} | |
e2916cc6 | 169 | %endif |
a2a104fd JB |
170 | %{__rm} $RPM_BUILD_ROOT/%{_lib}/security/pam_cgroup.la |
171 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la | |
0779ceb5 | 172 | |
23fdf35f PG |
173 | %clean |
174 | rm -rf $RPM_BUILD_ROOT | |
175 | ||
077903da JR |
176 | %pre |
177 | %groupadd -g 261 -r -f cgred | |
0779ceb5 | 178 | |
ada0366c | 179 | %post |
23fdf35f PG |
180 | /sbin/chkconfig --add cgred |
181 | /sbin/chkconfig --add cgconfig | |
4592fecd JR |
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 | |
9166bcc3 JR |
188 | NORESTART=1 |
189 | %systemd_post cgconfig.service | |
190 | %systemd_post cgred.service | |
23fdf35f PG |
191 | |
192 | %preun | |
193 | if [ $1 = 0 ]; then | |
b9cd8aa6 ER |
194 | %service cgred stop |
195 | %service cgconfig stop | |
196 | /sbin/chkconfig --del cgconfig | |
197 | /sbin/chkconfig --del cgred | |
23fdf35f | 198 | fi |
9166bcc3 JR |
199 | %systemd_preun cgconfig.service |
200 | %systemd_preun cgred.service | |
23fdf35f | 201 | |
077903da | 202 | %postun |
077903da JR |
203 | if [ "$1" = "0" ]; then |
204 | %groupremove cgred | |
205 | fi | |
9166bcc3 JR |
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 | |
23fdf35f | 231 | |
38cd4e1d JB |
232 | %post libs -p /sbin/ldconfig |
233 | %postun libs -p /sbin/ldconfig | |
234 | ||
ada0366c PG |
235 | %files |
236 | %defattr(644,root,root,755) | |
0779ceb5 | 237 | %doc README README_daemon |
077903da JR |
238 | %attr(754,root,root) /etc/rc.d/init.d/cgconfig |
239 | %attr(754,root,root) /etc/rc.d/init.d/cgred | |
3be873a1 | 240 | %dir /etc/cgconfig.d |
9166bcc3 | 241 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cgred |
0779ceb5 | 242 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/cg*.conf |
9166bcc3 JR |
243 | %{systemdunitdir}/cgconfig.service |
244 | %{systemdunitdir}/cgred.service | |
077903da JR |
245 | %attr(755,root,root) /bin/cgclassify |
246 | %attr(755,root,root) /bin/cgcreate | |
247 | %attr(755,root,root) /bin/cgdelete | |
731bb598 | 248 | %attr(755,root,root) /bin/cgexec |
077903da JR |
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 | |
0779ceb5 TP |
257 | %{_mandir}/man1/ls*.1* |
258 | %{_mandir}/man1/cg*.1* | |
259 | %{_mandir}/man5/cg*.5* | |
260 | %{_mandir}/man8/cg*.8* | |
23fdf35f | 261 | |
c2b28c24 | 262 | %files -n pam-pam_cgroup |
ea035f2c BZ |
263 | %defattr(644,root,root,755) |
264 | %attr(755,root,root) /%{_lib}/security/pam_cgroup.so | |
265 | ||
38cd4e1d JB |
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 | ||
23fdf35f | 271 | %files devel |
ada0366c | 272 | %defattr(644,root,root,755) |
a89c8411 | 273 | %attr(755,root,root) %{_libdir}/libcgroup.so |
a89c8411 | 274 | %{_includedir}/libcgroup |
0779ceb5 | 275 | %{_includedir}/libcgroup.h |
a89c8411 | 276 | %{_pkgconfigdir}/libcgroup.pc |
38cd4e1d | 277 | |
e2916cc6 | 278 | %if %{with python} |
38cd4e1d JB |
279 | %files -n python-libcgroup |
280 | %defattr(644,root,root,755) | |
281 | %attr(755,root,root) %{py_sitedir}/_libcgroup.so | |
e2916cc6 | 282 | %endif |