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