]>
Commit | Line | Data |
---|---|---|
23fdf35f PG |
1 | %define soversion 1.0.34 |
2 | ||
ada0366c PG |
3 | Summary: Tools and libraries to control and monitor control groups |
4 | Name: libcgroup | |
5 | Version: 0.34 | |
6 | Release: 1 | |
7 | License: LGPLv2+ | |
8 | Group: Development/Libraries | |
9 | Source0: http://dl.sourceforge.net/libcg/%{name}-%{version}.tar.bz2 | |
10 | # Source0-md5: 681c751d1a1ea78615094007d39db6cb | |
11 | URL: http://libcg.sourceforge.net/ | |
12 | BuildRequires: flex | |
13 | BuildRequires: pam-devel | |
14 | Requires(post): chkconfig, /sbin/service | |
15 | Requires(preun): /sbin/chkconfig | |
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 | |
26 | Requires: libcgroup = %{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 | |
ada0366c | 50 | install -d $RPM_BUILD_ROOT/%{_initrddir} |
23fdf35f PG |
51 | cp scripts/init.d/cgconfig $RPM_BUILD_ROOT/%{_initrddir}/cgconfig |
52 | cp scripts/init.d/cgred $RPM_BUILD_ROOT/%{_initrddir}/cgred | |
53 | ||
54 | # install config files | |
ada0366c | 55 | install -d $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig |
23fdf35f PG |
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 | |
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 PG |
65 | # move the devel stuff to %{_prefix} |
66 | install -d $RPM_BUILD_ROOT/%{_libdir} | |
23fdf35f PG |
67 | mv -f $RPM_BUILD_ROOT/%{_lib}/libcgroup.la $RPM_BUILD_ROOT/%{_libdir} |
68 | rm -f $RPM_BUILD_ROOT/%{_lib}/libcgroup.so | |
69 | ln -sf ../../%{_lib}/libcgroup.so.%{soversion} $RPM_BUILD_ROOT/%{_libdir}/libcgroup.so | |
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 | |
ada0366c PG |
81 | %service cgred stop > /dev/null 2>&1 || : |
82 | %service cgconfig stop > /dev/null 2>&1 || : | |
23fdf35f PG |
83 | /sbin/chkconfig --del cgconfig |
84 | /sbin/chkconfig --del cgred | |
85 | fi | |
86 | ||
87 | %postun -p /sbin/ldconfig | |
88 | ||
ada0366c PG |
89 | %files |
90 | %defattr(644,root,root,755) | |
91 | %doc INSTALL README_daemon | |
92 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cgred.conf | |
23fdf35f PG |
93 | %config(noreplace) %{_sysconfdir}/cgconfig.conf |
94 | %config(noreplace) %{_sysconfdir}/cgrules.conf | |
ada0366c | 95 | %attr(755,root,root) /%{_lib}/libcgroup.so.* |
23fdf35f PG |
96 | /bin/cgexec |
97 | /bin/cgclassify | |
98 | /sbin/cgconfigparser | |
99 | /sbin/cgrulesengd | |
ada0366c PG |
100 | %attr(644, root, root) %{_mandir}/man1/* |
101 | %attr(644, root, root) %{_mandir}/man5/* | |
102 | %attr(644, root, root) %{_mandir}/man8/* | |
103 | %attr(755,root,root) %{_initrddir}/cgconfig | |
104 | %attr(755,root,root) %{_initrddir}/cgred | |
105 | %attr(755,root,root) /%{_lib}/security/pam_cgroup.so | |
23fdf35f PG |
106 | |
107 | %files devel | |
ada0366c | 108 | %defattr(644,root,root,755) |
23fdf35f PG |
109 | %{_includedir}/libcgroup.h |
110 | %{_libdir}/libcgroup.* | |
ada0366c | 111 | %doc INSTALL |