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}.%{rcver}.tar.bz2
10 # Source0-md5: 979624adc559f534b34099f4dba7576d
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 >= 2.61
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
32 Requires(post,preun,postun): systemd-units >= 38
35 Requires: systemd-units >= 38
36 Provides: group(cgred)
37 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 %define _exec_prefix %{nil}
40 %define _libdir %{_prefix}/%{_lib}
43 Control groups infrastructure. The tools and library help manipulate,
44 control, administrate and monitor control groups and the associated
47 %description -l pl.UTF-8
48 Ten pakiet stanowi infrastrukturę grup kontroli (cgroups). Narzędzia i
49 biblioteka pomagają modyfikować, sterować, administrować i modyfikować
50 grupy kontroli i powiązane z nimi kontrolery.
53 Summary: Header files for cgroup library
54 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki cgroup
55 Group: Development/Libraries
56 Requires: %{name} = %{version}-%{release}
59 It provides API to create/delete and modify cgroup nodes. It will also
60 in the future allow creation of persistent configuration for control
61 groups and provide scripts to manage that configuration.
63 %description devel -l pl.UTF-8
64 Ten pakiet udostępnia API do tworzenia, usuwania i modyfikowania
65 węzłów cgroup. W przyszłości pozwoli także na tworzenie trwałej
66 konfiguracji grup kontroli i udostępni skrypty do zarządzania taką
69 %package -n pam-pam_cgroup
70 Summary: PAM module for libcgroup
71 Summary(pl.UTF-8): Moduł PAM dla libcgroup
73 Requires: %{name} = %{version}-%{release}
74 Obsoletes: libcgroup-pam
76 %description -n pam-pam_cgroup
77 PAM module for libcgroup.
79 %description -n pam-pam_cgroup -l pl.UTF-8
80 Moduł PAM dla libcgroup.
83 %setup -q -n %{name}-%{version}.%{rcver}
93 --disable-silent-rules \
94 --enable-initscript-install \
95 --enable-pam-module-dir=/%{_lib}/security \
96 --enable-opaque-hierarchy="name=systemd"
101 rm -rf $RPM_BUILD_ROOT
102 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
105 DESTDIR=$RPM_BUILD_ROOT
107 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/cgconfig
108 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/cgred
110 install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/cgconfig.service
111 install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/cgred.service
113 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/cgred
114 cp -a samples/cg{config,rules,snapshot_blacklist}.conf $RPM_BUILD_ROOT%{_sysconfdir}
116 mv $RPM_BUILD_ROOT%{_libdir}/libcgroup.so.* $RPM_BUILD_ROOT/%{_lib}
117 ln -snf ../../%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libcgroup.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libcgroup.so
119 %{__rm} $RPM_BUILD_ROOT/%{_lib}/security/pam_cgroup.la
120 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
123 rm -rf $RPM_BUILD_ROOT
126 %groupadd -g 261 -r -f cgred
130 /sbin/chkconfig --add cgred
131 /sbin/chkconfig --add cgconfig
132 if [ ! -f /var/lock/subsys/cgconfig ]; then
133 echo 'Run "/sbin/service cgconfig start" to setup cgroup rules.'
135 if [ ! -f /var/lock/subsys/cgred ]; then
136 echo 'Run "/sbin/service cgred start" to start control group rules daemon.'
139 %systemd_post cgconfig.service
140 %systemd_post cgred.service
145 %service cgconfig stop
146 /sbin/chkconfig --del cgconfig
147 /sbin/chkconfig --del cgred
149 %systemd_preun cgconfig.service
150 %systemd_preun cgred.service
154 if [ "$1" = "0" ]; then
159 %triggerpostun -- %{name} < 0.38-0.rc1.1
160 if [ -f /etc/sysconfig/cgred.conf.rpmsave ]; then
161 . /etc/sysconfig/cgred.conf.rpmsave
163 [ -n "$NODAEMON" ] && OPTIONS="$OPTIONS $NODAEMON"
164 [ -n "$LOG" ] && OPTIONS="$OPTIONS $LOG"
165 if [ -n "$LOG_FILE" ]; then
166 OPTIONS="$OPTIONS -f $LOG_FILE"
168 OPTIONS="$OPTIONS -s"
170 [ -n "$SOCKET_USER" ] && OPTIONS="$OPTIONS -u $SOCKET_USER"
171 if [ -n "$SOCKET_GROUP" ]; then
172 OPTIONS="$OPTIONS -g $SOCKET_GROUP"
174 OPTIONS="$OPTIONS -g cgred"
176 echo >>/etc/sysconfig/cgred
177 echo "# Added by rpm trigger" >>/etc/sysconfig/cgred
178 echo "OPTIONS=\"$OPTIONS\"" >>/etc/sysconfig/cgred
180 %systemd_trigger cgconfig.service
181 %systemd_trigger cgred.service
184 %defattr(644,root,root,755)
185 %doc README README_daemon
186 %attr(754,root,root) /etc/rc.d/init.d/cgconfig
187 %attr(754,root,root) /etc/rc.d/init.d/cgred
188 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cgred
189 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/cg*.conf
190 %{systemdunitdir}/cgconfig.service
191 %{systemdunitdir}/cgred.service
192 %attr(755,root,root) /%{_lib}/libcgroup.so.*.*.*
193 %attr(755,root,root) %ghost /%{_lib}/libcgroup.so.1
194 %attr(755,root,root) /bin/cgclassify
195 %attr(755,root,root) /bin/cgcreate
196 %attr(755,root,root) /bin/cgdelete
197 %attr(755,root,root) /bin/cgexec
198 %attr(755,root,root) /bin/cgget
199 %attr(755,root,root) /bin/cgset
200 %attr(755,root,root) /bin/cgsnapshot
201 %attr(755,root,root) /bin/lscgroup
202 %attr(755,root,root) /bin/lssubsys
203 %attr(755,root,root) /sbin/cgclear
204 %attr(755,root,root) /sbin/cgconfigparser
205 %attr(755,root,root) /sbin/cgrulesengd
206 %{_mandir}/man1/ls*.1*
207 %{_mandir}/man1/cg*.1*
208 %{_mandir}/man5/cg*.5*
209 %{_mandir}/man8/cg*.8*
211 %files -n pam-pam_cgroup
212 %defattr(644,root,root,755)
213 %attr(755,root,root) /%{_lib}/security/pam_cgroup.so
216 %defattr(644,root,root,755)
217 %attr(755,root,root) %{_libdir}/libcgroup.so
218 %{_includedir}/libcgroup
219 %{_includedir}/libcgroup.h
220 %{_pkgconfigdir}/libcgroup.pc