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