]>
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 | |
ea035f2c | 31 | Summary: Development libraries for %{name} |
ada0366c | 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 | 39 | |
ea035f2c BZ |
40 | %package pam |
41 | Summary: PAM module for %{name} | |
42 | Group: Libraries | |
43 | Requires: %{name} = %{version}-%{release} | |
44 | ||
45 | %description pam | |
46 | PAM module for %{name}. | |
47 | ||
23fdf35f PG |
48 | %prep |
49 | %setup -q | |
50 | ||
51 | %build | |
080074c8 | 52 | %configure |
ada0366c | 53 | %{__make} |
23fdf35f PG |
54 | |
55 | %install | |
56 | rm -rf $RPM_BUILD_ROOT | |
ada0366c PG |
57 | %{__make} install \ |
58 | DESTDIR=$RPM_BUILD_ROOT | |
23fdf35f PG |
59 | |
60 | # install init scripts | |
b9cd8aa6 ER |
61 | install -d $RPM_BUILD_ROOT/etc/rc.d/init.d |
62 | cp scripts/init.d/cgconfig $RPM_BUILD_ROOT/etc/rc.d/init.d/cgconfig | |
63 | cp scripts/init.d/cgred $RPM_BUILD_ROOT/etc/rc.d/init.d/cgred | |
23fdf35f PG |
64 | |
65 | # install config files | |
b9cd8aa6 ER |
66 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig |
67 | cp samples/cgred.conf $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/cgred.conf | |
68 | cp samples/cgconfig.conf $RPM_BUILD_ROOT%{_sysconfdir}/cgconfig.conf | |
69 | cp samples/cgrules.conf $RPM_BUILD_ROOT%{_sysconfdir}/cgrules.conf | |
23fdf35f PG |
70 | |
71 | # sanitize pam module, we need only pam_cgroup.so in the right directory | |
ada0366c | 72 | install -d $RPM_BUILD_ROOT/%{_lib}/security |
080074c8 ER |
73 | mv -f $RPM_BUILD_ROOT%{_libdir}/pam_cgroup.so.*.*.* $RPM_BUILD_ROOT/%{_lib}/security/pam_cgroup.so |
74 | rm -f $RPM_BUILD_ROOT%{_libdir}/pam_cgroup* | |
23fdf35f | 75 | |
080074c8 ER |
76 | # move library to /%{_lib} |
77 | install -d $RPM_BUILD_ROOT/%{_lib} | |
78 | mv $RPM_BUILD_ROOT%{_libdir}/libcgroup.so.* $RPM_BUILD_ROOT/%{_lib} | |
b9cd8aa6 | 79 | ln -snf ../../%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libcgroup.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libcgroup.so |
23fdf35f PG |
80 | |
81 | %clean | |
82 | rm -rf $RPM_BUILD_ROOT | |
83 | ||
ada0366c | 84 | %post |
23fdf35f PG |
85 | /sbin/ldconfig |
86 | /sbin/chkconfig --add cgred | |
87 | /sbin/chkconfig --add cgconfig | |
88 | ||
89 | %preun | |
90 | if [ $1 = 0 ]; then | |
b9cd8aa6 ER |
91 | %service cgred stop |
92 | %service cgconfig stop | |
93 | /sbin/chkconfig --del cgconfig | |
94 | /sbin/chkconfig --del cgred | |
23fdf35f PG |
95 | fi |
96 | ||
97 | %postun -p /sbin/ldconfig | |
98 | ||
ada0366c PG |
99 | %files |
100 | %defattr(644,root,root,755) | |
101 | %doc INSTALL README_daemon | |
23fdf35f PG |
102 | %config(noreplace) %{_sysconfdir}/cgconfig.conf |
103 | %config(noreplace) %{_sysconfdir}/cgrules.conf | |
b9cd8aa6 | 104 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cgred.conf |
a89c8411 BZ |
105 | |
106 | %attr(755,root,root) /bin/cgclassify | |
107 | %attr(755,root,root) /bin/cgcreate | |
108 | %attr(755,root,root) /bin/cgdelete | |
109 | %attr(755,root,root) /bin/cgexec | |
110 | %attr(755,root,root) /bin/cgget | |
111 | %attr(755,root,root) /bin/cgset | |
112 | %attr(755,root,root) /bin/lscgroup | |
113 | %attr(755,root,root) /bin/lssubsys | |
114 | %attr(755,root,root) /sbin/cgclear | |
115 | %attr(755,root,root) /sbin/cgconfigparser | |
116 | %attr(755,root,root) /sbin/cgrulesengd | |
117 | ||
b9cd8aa6 ER |
118 | %attr(754,root,root) /etc/rc.d/init.d/cgconfig |
119 | %attr(754,root,root) /etc/rc.d/init.d/cgred | |
120 | %attr(755,root,root) /%{_lib}/libcgroup.so.*.*.* | |
a89c8411 | 121 | %attr(755,root,root) %ghost /%{_lib}/libcgroup.so.? |
a89c8411 | 122 | |
b9cd8aa6 | 123 | %{_mandir}/man1/cgclassify.1* |
a89c8411 BZ |
124 | %{_mandir}/man1/cgclear.1* |
125 | %{_mandir}/man1/cgcreate.1* | |
126 | %{_mandir}/man1/cgget.1* | |
127 | %{_mandir}/man1/cgset.1* | |
b9cd8aa6 ER |
128 | %{_mandir}/man1/cgexec.1* |
129 | %{_mandir}/man5/cgconfig.conf.5* | |
130 | %{_mandir}/man5/cgred.conf.5* | |
131 | %{_mandir}/man5/cgrules.conf.5* | |
132 | %{_mandir}/man8/cgconfigparser.8* | |
133 | %{_mandir}/man8/cgrulesengd.8* | |
23fdf35f | 134 | |
ea035f2c BZ |
135 | %files pam |
136 | %defattr(644,root,root,755) | |
137 | %attr(755,root,root) /%{_lib}/security/pam_cgroup.so | |
138 | ||
23fdf35f | 139 | %files devel |
ada0366c | 140 | %defattr(644,root,root,755) |
ada0366c | 141 | %doc INSTALL |
a89c8411 | 142 | %attr(755,root,root) %{_libdir}/libcgroup.so |
b9cd8aa6 | 143 | %{_libdir}/libcgroup.la |
a89c8411 BZ |
144 | %{_includedir}/libcgroup.h |
145 | %{_includedir}/libcgroup | |
146 | %{_pkgconfigdir}/libcgroup.pc |