]>
Commit | Line | Data |
---|---|---|
ada0366c PG |
1 | Summary: Tools and libraries to control and monitor control groups |
2 | Name: libcgroup | |
3 | Version: 0.34 | |
4 | Release: 1 | |
b9cd8aa6 | 5 | License: LGPL v2+ |
ada0366c PG |
6 | Group: Development/Libraries |
7 | Source0: http://dl.sourceforge.net/libcg/%{name}-%{version}.tar.bz2 | |
8 | # Source0-md5: 681c751d1a1ea78615094007d39db6cb | |
9 | URL: http://libcg.sourceforge.net/ | |
10 | BuildRequires: flex | |
11 | BuildRequires: pam-devel | |
b9cd8aa6 ER |
12 | Requires(post): /sbin/chkconfig |
13 | Requires(post): /sbin/ldconfig | |
ada0366c | 14 | Requires(preun): /sbin/chkconfig |
b9cd8aa6 | 15 | Requires: rc-scripts |
ada0366c | 16 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
23fdf35f PG |
17 | |
18 | %description | |
ada0366c PG |
19 | Control groups infrastructure. The tools and library help manipulate, |
20 | control, administrate and monitor control groups and the associated | |
21 | controllers. | |
23fdf35f PG |
22 | |
23 | %package devel | |
ada0366c PG |
24 | Summary: Development libraries to develop applications that utilize control groups |
25 | Group: Development/Libraries | |
b9cd8aa6 | 26 | Requires: %{name} = %{version}-%{release} |
23fdf35f PG |
27 | |
28 | %description devel | |
ada0366c PG |
29 | It provides API to create/delete and modify cgroup nodes. It will also |
30 | in the future allow creation of persistent configuration for control | |
31 | groups and provide scripts to manage that configuration. | |
23fdf35f PG |
32 | |
33 | %prep | |
34 | %setup -q | |
35 | ||
36 | %build | |
ada0366c PG |
37 | %configure \ |
38 | --bindir=/bin \ | |
39 | --sbindir=/sbin \ | |
40 | --libdir=/%{_lib} \ | |
23fdf35f | 41 | |
ada0366c | 42 | %{__make} |
23fdf35f PG |
43 | |
44 | %install | |
45 | rm -rf $RPM_BUILD_ROOT | |
ada0366c PG |
46 | %{__make} install \ |
47 | DESTDIR=$RPM_BUILD_ROOT | |
23fdf35f PG |
48 | |
49 | # install init scripts | |
b9cd8aa6 ER |
50 | install -d $RPM_BUILD_ROOT/etc/rc.d/init.d |
51 | cp scripts/init.d/cgconfig $RPM_BUILD_ROOT/etc/rc.d/init.d/cgconfig | |
52 | cp scripts/init.d/cgred $RPM_BUILD_ROOT/etc/rc.d/init.d/cgred | |
23fdf35f PG |
53 | |
54 | # install config files | |
b9cd8aa6 ER |
55 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig |
56 | cp samples/cgred.conf $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/cgred.conf | |
57 | cp samples/cgconfig.conf $RPM_BUILD_ROOT%{_sysconfdir}/cgconfig.conf | |
58 | cp samples/cgrules.conf $RPM_BUILD_ROOT%{_sysconfdir}/cgrules.conf | |
23fdf35f PG |
59 | |
60 | # sanitize pam module, we need only pam_cgroup.so in the right directory | |
ada0366c | 61 | install -d $RPM_BUILD_ROOT/%{_lib}/security |
23fdf35f PG |
62 | mv -f $RPM_BUILD_ROOT/%{_lib}/pam_cgroup.so.*.*.* $RPM_BUILD_ROOT/%{_lib}/security/pam_cgroup.so |
63 | rm -f $RPM_BUILD_ROOT/%{_lib}/pam_cgroup* | |
64 | ||
ada0366c | 65 | # move the devel stuff to %{_prefix} |
b9cd8aa6 ER |
66 | install -d $RPM_BUILD_ROOT%{_libdir} |
67 | mv -f $RPM_BUILD_ROOT/%{_lib}/libcgroup.la $RPM_BUILD_ROOT%{_libdir} | |
23fdf35f | 68 | rm -f $RPM_BUILD_ROOT/%{_lib}/libcgroup.so |
b9cd8aa6 | 69 | ln -snf ../../%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libcgroup.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libcgroup.so |
23fdf35f PG |
70 | |
71 | %clean | |
72 | rm -rf $RPM_BUILD_ROOT | |
73 | ||
ada0366c | 74 | %post |
23fdf35f PG |
75 | /sbin/ldconfig |
76 | /sbin/chkconfig --add cgred | |
77 | /sbin/chkconfig --add cgconfig | |
78 | ||
79 | %preun | |
80 | if [ $1 = 0 ]; then | |
b9cd8aa6 ER |
81 | %service cgred stop |
82 | %service cgconfig stop | |
83 | /sbin/chkconfig --del cgconfig | |
84 | /sbin/chkconfig --del cgred | |
23fdf35f PG |
85 | fi |
86 | ||
87 | %postun -p /sbin/ldconfig | |
88 | ||
ada0366c PG |
89 | %files |
90 | %defattr(644,root,root,755) | |
91 | %doc INSTALL README_daemon | |
23fdf35f PG |
92 | %config(noreplace) %{_sysconfdir}/cgconfig.conf |
93 | %config(noreplace) %{_sysconfdir}/cgrules.conf | |
b9cd8aa6 ER |
94 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cgred.conf |
95 | %attr(754,root,root) /etc/rc.d/init.d/cgconfig | |
96 | %attr(754,root,root) /etc/rc.d/init.d/cgred | |
97 | %attr(755,root,root) /%{_lib}/libcgroup.so.*.*.* | |
98 | %attr(755,root,root) %ghost /%{_lib}/libcgroup.so.1 | |
ada0366c | 99 | %attr(755,root,root) /%{_lib}/security/pam_cgroup.so |
b9cd8aa6 ER |
100 | %attr(755,root,root) /bin/cgexec |
101 | %attr(755,root,root) /bin/cgclassify | |
102 | %attr(755,root,root) /sbin/cgconfigparser | |
103 | %attr(755,root,root) /sbin/cgrulesengd | |
104 | %{_mandir}/man1/cgclassify.1* | |
105 | %{_mandir}/man1/cgexec.1* | |
106 | %{_mandir}/man5/cgconfig.conf.5* | |
107 | %{_mandir}/man5/cgred.conf.5* | |
108 | %{_mandir}/man5/cgrules.conf.5* | |
109 | %{_mandir}/man8/cgconfigparser.8* | |
110 | %{_mandir}/man8/cgrulesengd.8* | |
23fdf35f PG |
111 | |
112 | %files devel | |
ada0366c | 113 | %defattr(644,root,root,755) |
ada0366c | 114 | %doc INSTALL |
b9cd8aa6 ER |
115 | %{_includedir}/libcgroup.h |
116 | %{_libdir}/libcgroup.la | |
117 | %{_libdir}/libcgroup.so |