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