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