2 Summary: Tools and library to control and monitor control groups
3 Summary(pl.UTF-8): Narzędzia i biblioteka do kontrolowania i monitorowania grup kontroli
9 Source0: http://downloads.sourceforge.net/libcg/%{name}-%{version}.%{_rc}.tar.bz2
10 # Source0-md5: 6c2100af9840f54f8bf97836887a4517
11 Source1: cgconfig.init
13 Source3: cgconfig.service
14 Source4: cgred.service
15 Source5: cgred.sysconfig
16 Patch0: %{name}-pam.patch
17 Patch1: %{name}-conf.patch
18 URL: http://libcg.sourceforge.net/
19 BuildRequires: autoconf
20 BuildRequires: automake
23 BuildRequires: libstdc++-devel
24 BuildRequires: libtool
25 BuildRequires: pam-devel
26 BuildRequires: rpmbuild(macros) >= 1.626
27 Requires(post): /sbin/ldconfig
28 Requires(post,preun): /sbin/chkconfig
29 Requires(postun): /usr/sbin/groupdel
30 Requires(pre): /usr/bin/getgid
31 Requires(pre): /usr/sbin/groupadd
34 Requires: systemd-units >= 37-0.10
35 Provides: group(cgred)
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 %define _exec_prefix %{nil}
39 %define _libdir %{_prefix}/%{_lib}
42 Control groups infrastructure. The tools and library help manipulate,
43 control, administrate and monitor control groups and the associated
46 %description -l pl.UTF-8
47 Ten pakiet stanowi infrastrukturę grup kontroli (cgroups). Narzędzia i
48 biblioteka pomagają modyfikować, sterować, administrować i modyfikować
49 grupy kontroli i powiązane z nimi kontrolery.
52 Summary: Header files for cgroup library
53 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki cgroup
54 Group: Development/Libraries
55 Requires: %{name} = %{version}-%{release}
58 It provides API to create/delete and modify cgroup nodes. It will also
59 in the future allow creation of persistent configuration for control
60 groups and provide scripts to manage that configuration.
62 %description devel -l pl.UTF-8
63 Ten pakiet udostępnia API do tworzenia, usuwania i modyfikowania
64 węzłów cgroup. W przyszłości pozwoli także na tworzenie trwałej
65 konfiguracji grup kontroli i udostępni skrypty do zarządzania taką
68 %package -n pam-pam_cgroup
69 Summary: PAM module for libcgroup
70 Summary(pl.UTF-8): Moduł PAM dla libcgroup
72 Requires: %{name} = %{version}-%{release}
73 Obsoletes: libcgroup-pam
75 %description -n pam-pam_cgroup
76 PAM module for libcgroup.
78 %description -n pam-pam_cgroup -l pl.UTF-8
79 Moduł PAM dla libcgroup.
82 %setup -q -n %{name}-%{version}.%{_rc}
92 --disable-silent-rules \
93 --enable-initscript-install \
94 --enable-pam-module-dir=/%{_lib}/security \
95 --enable-opaque-hierarchy="name=systemd"
100 rm -rf $RPM_BUILD_ROOT
101 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
104 DESTDIR=$RPM_BUILD_ROOT
106 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/cgconfig
107 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/cgred
109 install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/cgconfig.service
110 install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/cgred.service
112 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/cgred
113 cp -a samples/cg{config,rules,snapshot_blacklist}.conf $RPM_BUILD_ROOT%{_sysconfdir}
115 mv $RPM_BUILD_ROOT%{_libdir}/libcgroup.so.* $RPM_BUILD_ROOT/%{_lib}
116 ln -snf ../../%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libcgroup.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libcgroup.so
118 %{__rm} $RPM_BUILD_ROOT/%{_lib}/security/pam_cgroup.la
119 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
122 rm -rf $RPM_BUILD_ROOT
125 %groupadd -g 261 -r -f cgred
129 /sbin/chkconfig --add cgred
130 /sbin/chkconfig --add cgconfig
131 if [ ! -f /var/lock/subsys/cgconfig ]; then
132 echo 'Run "/sbin/service cgconfig start" to setup cgroup rules.'
134 if [ ! -f /var/lock/subsys/cgred ]; then
135 echo 'Run "/sbin/service cgred start" to start control group rules daemon.'
138 %systemd_post cgconfig.service
139 %systemd_post cgred.service
144 %service cgconfig stop
145 /sbin/chkconfig --del cgconfig
146 /sbin/chkconfig --del cgred
148 %systemd_preun cgconfig.service
149 %systemd_preun cgred.service
153 if [ "$1" = "0" ]; then
158 %triggerpostun -- %{name} < 0.38-0.rc1.1
159 if [ -f /etc/sysconfig/cgred.conf.rpmsave ]; then
160 . /etc/sysconfig/cgred.conf.rpmsave
162 [ -n "$NODAEMON" ] && OPTIONS="$OPTIONS $NODAEMON"
163 [ -n "$LOG" ] && OPTIONS="$OPTIONS $LOG"
164 if [ -n "$LOG_FILE" ]; then
165 OPTIONS="$OPTIONS -f $LOG_FILE"
167 OPTIONS="$OPTIONS -s"
169 [ -n "$SOCKET_USER" ] && OPTIONS="$OPTIONS -u $SOCKET_USER"
170 if [ -n "$SOCKET_GROUP" ]; then
171 OPTIONS="$OPTIONS -g $SOCKET_GROUP"
173 OPTIONS="$OPTIONS -g cgred"
175 echo >>/etc/sysconfig/cgred
176 echo "# Added by rpm trigger" >>/etc/sysconfig/cgred
177 echo "OPTIONS=\"$OPTIONS\"" >>/etc/sysconfig/cgred
179 %systemd_trigger cgconfig.service
180 %systemd_trigger cgred.service
183 %defattr(644,root,root,755)
184 %doc README README_daemon
185 %attr(754,root,root) /etc/rc.d/init.d/cgconfig
186 %attr(754,root,root) /etc/rc.d/init.d/cgred
187 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cgred
188 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/cg*.conf
189 %{systemdunitdir}/cgconfig.service
190 %{systemdunitdir}/cgred.service
191 %attr(755,root,root) /%{_lib}/libcgroup.so.*.*.*
192 %attr(755,root,root) %ghost /%{_lib}/libcgroup.so.1
193 %attr(755,root,root) /bin/cgclassify
194 %attr(755,root,root) /bin/cgcreate
195 %attr(755,root,root) /bin/cgdelete
196 %attr(755,root,root) /bin/cgexec
197 %attr(755,root,root) /bin/cgget
198 %attr(755,root,root) /bin/cgset
199 %attr(755,root,root) /bin/cgsnapshot
200 %attr(755,root,root) /bin/lscgroup
201 %attr(755,root,root) /bin/lssubsys
202 %attr(755,root,root) /sbin/cgclear
203 %attr(755,root,root) /sbin/cgconfigparser
204 %attr(755,root,root) /sbin/cgrulesengd
205 %{_mandir}/man1/ls*.1*
206 %{_mandir}/man1/cg*.1*
207 %{_mandir}/man5/cg*.5*
208 %{_mandir}/man8/cg*.8*
210 %files -n pam-pam_cgroup
211 %defattr(644,root,root,755)
212 %attr(755,root,root) /%{_lib}/security/pam_cgroup.so
215 %defattr(644,root,root,755)
216 %attr(755,root,root) %{_libdir}/libcgroup.so
217 %{_includedir}/libcgroup
218 %{_includedir}/libcgroup.h
219 %{_pkgconfigdir}/libcgroup.pc