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