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