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