]>
Commit | Line | Data |
---|---|---|
9166bcc3 | 1 | %define _rc rc1 |
3d200c45 JB |
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 | |
ada0366c | 4 | Name: libcgroup |
9166bcc3 | 5 | Version: 0.38 |
dbac3405 | 6 | Release: 0.%{_rc}.2 |
b9cd8aa6 | 7 | License: LGPL v2+ |
f6ad0e0b | 8 | Group: Libraries |
9166bcc3 JR |
9 | Source0: http://downloads.sourceforge.net/libcg/%{name}-%{version}.%{_rc}.tar.bz2 |
10 | # Source0-md5: 6c2100af9840f54f8bf97836887a4517 | |
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 |
ada0366c | 18 | URL: http://libcg.sourceforge.net/ |
e8db3431 | 19 | BuildRequires: autoconf |
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 |
9166bcc3 | 26 | BuildRequires: rpmbuild(macros) >= 1.626 |
b9cd8aa6 | 27 | Requires(post): /sbin/ldconfig |
7e9e387f | 28 | Requires(post,preun): /sbin/chkconfig |
077903da JR |
29 | Requires(postun): /usr/sbin/groupdel |
30 | Requires(pre): /usr/bin/getgid | |
31 | Requires(pre): /usr/sbin/groupadd | |
7e9e387f | 32 | Requires: procps |
b9cd8aa6 | 33 | Requires: rc-scripts |
9166bcc3 | 34 | Requires: systemd-units >= 37-0.10 |
077903da | 35 | Provides: group(cgred) |
ada0366c | 36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
23fdf35f | 37 | |
f6ad0e0b | 38 | %define _exec_prefix %{nil} |
0779ceb5 | 39 | %define _libdir %{_prefix}/%{_lib} |
080074c8 | 40 | |
23fdf35f | 41 | %description |
ada0366c PG |
42 | Control groups infrastructure. The tools and library help manipulate, |
43 | control, administrate and monitor control groups and the associated | |
44 | controllers. | |
23fdf35f | 45 | |
3d200c45 JB |
46 | %description -l pl.UTF-8 |
47 | Ten pakiet stanowi infrastrukturę grup kontroli (cgroups). Narzędzia i | |
e8db3431 | 48 | biblioteka pomagają modyfikować, sterować, administrować i modyfikować |
49 | grupy kontroli i powiązane z nimi kontrolery. | |
3d200c45 | 50 | |
23fdf35f | 51 | %package devel |
3d200c45 JB |
52 | Summary: Header files for cgroup library |
53 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki cgroup | |
ada0366c | 54 | Group: Development/Libraries |
b9cd8aa6 | 55 | Requires: %{name} = %{version}-%{release} |
23fdf35f PG |
56 | |
57 | %description devel | |
ada0366c PG |
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. | |
23fdf35f | 61 | |
3d200c45 JB |
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ą | |
66 | konfiguracją. | |
67 | ||
c2b28c24 ER |
68 | %package -n pam-pam_cgroup |
69 | Summary: PAM module for libcgroup | |
3d200c45 | 70 | Summary(pl.UTF-8): Moduł PAM dla libcgroup |
ea035f2c BZ |
71 | Group: Libraries |
72 | Requires: %{name} = %{version}-%{release} | |
c2b28c24 | 73 | Obsoletes: libcgroup-pam |
ea035f2c | 74 | |
c2b28c24 ER |
75 | %description -n pam-pam_cgroup |
76 | PAM module for libcgroup. | |
ea035f2c | 77 | |
3d200c45 JB |
78 | %description -n pam-pam_cgroup -l pl.UTF-8 |
79 | Moduł PAM dla libcgroup. | |
80 | ||
23fdf35f | 81 | %prep |
9166bcc3 | 82 | %setup -q -n %{name}-%{version}.%{_rc} |
a2a104fd | 83 | %patch0 -p1 |
643b509a | 84 | %patch1 -p1 |
23fdf35f PG |
85 | |
86 | %build | |
e8db3431 | 87 | %{__libtoolize} |
88 | %{__aclocal} | |
89 | %{__autoconf} | |
90 | %{__automake} | |
0779ceb5 | 91 | %configure \ |
f6ad0e0b | 92 | --disable-silent-rules \ |
0779ceb5 | 93 | --enable-initscript-install \ |
9166bcc3 JR |
94 | --enable-pam-module-dir=/%{_lib}/security \ |
95 | --enable-opaque-hierarchy="name=systemd" | |
0779ceb5 | 96 | |
ada0366c | 97 | %{__make} |
23fdf35f PG |
98 | |
99 | %install | |
100 | rm -rf $RPM_BUILD_ROOT | |
9166bcc3 | 101 | install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}} |
0779ceb5 | 102 | |
ada0366c PG |
103 | %{__make} install \ |
104 | DESTDIR=$RPM_BUILD_ROOT | |
23fdf35f | 105 | |
49919ec9 JR |
106 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/cgconfig |
107 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/cgred | |
108 | ||
9166bcc3 JR |
109 | install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/cgconfig.service |
110 | install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/cgred.service | |
111 | ||
112 | install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/cgred | |
0779ceb5 | 113 | cp -a samples/cg{config,rules,snapshot_blacklist}.conf $RPM_BUILD_ROOT%{_sysconfdir} |
23fdf35f | 114 | |
080074c8 | 115 | mv $RPM_BUILD_ROOT%{_libdir}/libcgroup.so.* $RPM_BUILD_ROOT/%{_lib} |
b9cd8aa6 | 116 | ln -snf ../../%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libcgroup.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libcgroup.so |
23fdf35f | 117 | |
a2a104fd JB |
118 | %{__rm} $RPM_BUILD_ROOT/%{_lib}/security/pam_cgroup.la |
119 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la | |
0779ceb5 | 120 | |
23fdf35f PG |
121 | %clean |
122 | rm -rf $RPM_BUILD_ROOT | |
123 | ||
077903da JR |
124 | %pre |
125 | %groupadd -g 261 -r -f cgred | |
0779ceb5 | 126 | |
ada0366c | 127 | %post |
23fdf35f PG |
128 | /sbin/ldconfig |
129 | /sbin/chkconfig --add cgred | |
130 | /sbin/chkconfig --add cgconfig | |
4592fecd JR |
131 | if [ ! -f /var/lock/subsys/cgconfig ]; then |
132 | echo 'Run "/sbin/service cgconfig start" to setup cgroup rules.' | |
133 | fi | |
134 | if [ ! -f /var/lock/subsys/cgred ]; then | |
135 | echo 'Run "/sbin/service cgred start" to start control group rules daemon.' | |
136 | fi | |
9166bcc3 JR |
137 | NORESTART=1 |
138 | %systemd_post cgconfig.service | |
139 | %systemd_post cgred.service | |
23fdf35f PG |
140 | |
141 | %preun | |
142 | if [ $1 = 0 ]; then | |
b9cd8aa6 ER |
143 | %service cgred stop |
144 | %service cgconfig stop | |
145 | /sbin/chkconfig --del cgconfig | |
146 | /sbin/chkconfig --del cgred | |
23fdf35f | 147 | fi |
9166bcc3 JR |
148 | %systemd_preun cgconfig.service |
149 | %systemd_preun cgred.service | |
23fdf35f | 150 | |
077903da JR |
151 | %postun |
152 | /sbin/ldconfig | |
153 | if [ "$1" = "0" ]; then | |
154 | %groupremove cgred | |
155 | fi | |
9166bcc3 JR |
156 | %systemd_reload |
157 | ||
158 | %triggerpostun -- %{name} < 0.38-0.rc1.1 | |
159 | if [ -f /etc/sysconfig/cgred.conf.rpmsave ]; then | |
160 | . /etc/sysconfig/cgred.conf.rpmsave | |
161 | OPTIONS= | |
162 | [ -n "$NODAEMON" ] && OPTIONS="$OPTIONS $NODAEMON" | |
163 | [ -n "$LOG" ] && OPTIONS="$OPTIONS $LOG" | |
164 | if [ -n "$LOG_FILE" ]; then | |
165 | OPTIONS="$OPTIONS -f $LOG_FILE" | |
166 | else | |
167 | OPTIONS="$OPTIONS -s" | |
168 | fi | |
169 | [ -n "$SOCKET_USER" ] && OPTIONS="$OPTIONS -u $SOCKET_USER" | |
170 | if [ -n "$SOCKET_GROUP" ]; then | |
171 | OPTIONS="$OPTIONS -g $SOCKET_GROUP" | |
172 | else | |
173 | OPTIONS="$OPTIONS -g cgred" | |
174 | fi | |
175 | echo >>/etc/sysconfig/cgred | |
176 | echo "# Added by rpm trigger" >>/etc/sysconfig/cgred | |
177 | echo "OPTIONS=\"$OPTIONS\"" >>/etc/sysconfig/cgred | |
178 | fi | |
179 | %systemd_trigger cgconfig.service | |
180 | %systemd_trigger cgred.service | |
23fdf35f | 181 | |
ada0366c PG |
182 | %files |
183 | %defattr(644,root,root,755) | |
0779ceb5 | 184 | %doc README README_daemon |
077903da JR |
185 | %attr(754,root,root) /etc/rc.d/init.d/cgconfig |
186 | %attr(754,root,root) /etc/rc.d/init.d/cgred | |
9166bcc3 | 187 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cgred |
0779ceb5 | 188 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/cg*.conf |
9166bcc3 JR |
189 | %{systemdunitdir}/cgconfig.service |
190 | %{systemdunitdir}/cgred.service | |
b9cd8aa6 | 191 | %attr(755,root,root) /%{_lib}/libcgroup.so.*.*.* |
eabb9c00 | 192 | %attr(755,root,root) %ghost /%{_lib}/libcgroup.so.1 |
077903da JR |
193 | %attr(755,root,root) /bin/cgclassify |
194 | %attr(755,root,root) /bin/cgcreate | |
195 | %attr(755,root,root) /bin/cgdelete | |
731bb598 | 196 | %attr(755,root,root) /bin/cgexec |
077903da JR |
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 | |
0779ceb5 TP |
205 | %{_mandir}/man1/ls*.1* |
206 | %{_mandir}/man1/cg*.1* | |
207 | %{_mandir}/man5/cg*.5* | |
208 | %{_mandir}/man8/cg*.8* | |
23fdf35f | 209 | |
c2b28c24 | 210 | %files -n pam-pam_cgroup |
ea035f2c BZ |
211 | %defattr(644,root,root,755) |
212 | %attr(755,root,root) /%{_lib}/security/pam_cgroup.so | |
213 | ||
23fdf35f | 214 | %files devel |
ada0366c | 215 | %defattr(644,root,root,755) |
a89c8411 | 216 | %attr(755,root,root) %{_libdir}/libcgroup.so |
a89c8411 | 217 | %{_includedir}/libcgroup |
0779ceb5 | 218 | %{_includedir}/libcgroup.h |
a89c8411 | 219 | %{_pkgconfigdir}/libcgroup.pc |