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