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