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