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