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