]> git.pld-linux.org Git - packages/libcgroup.git/blob - libcgroup.spec
- adapterized
[packages/libcgroup.git] / libcgroup.spec
1 %define soversion 1.0.34
2
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)
17
18 %description
19 Control groups infrastructure. The tools and library help manipulate,
20 control, administrate and monitor control groups and the associated
21 controllers.
22
23 %package devel
24 Summary:        Development libraries to develop applications that utilize control groups
25 Group:          Development/Libraries
26 Requires:       libcgroup = %{version}-%{release}
27
28 %description devel
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.
32
33 %prep
34 %setup -q
35
36 %build
37 %configure \
38         --bindir=/bin \
39         --sbindir=/sbin \
40         --libdir=/%{_lib} \
41
42 %{__make}
43
44 %install
45 rm -rf $RPM_BUILD_ROOT
46 %{__make} install \
47         DESTDIR=$RPM_BUILD_ROOT
48
49 # install init scripts
50 install -d $RPM_BUILD_ROOT/%{_initrddir}
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
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
59
60 # sanitize pam module, we need only pam_cgroup.so in the right directory
61 install -d $RPM_BUILD_ROOT/%{_lib}/security
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
65 # move the devel stuff to %{_prefix}
66 install -d $RPM_BUILD_ROOT/%{_libdir}
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
74 %post
75 /sbin/ldconfig
76 /sbin/chkconfig --add cgred
77 /sbin/chkconfig --add cgconfig
78
79 %preun
80 if [ $1 = 0 ]; then
81     %service cgred stop > /dev/null 2>&1 || :
82     %service cgconfig stop > /dev/null 2>&1 || :
83     /sbin/chkconfig --del cgconfig
84     /sbin/chkconfig --del cgred
85 fi
86
87 %postun -p /sbin/ldconfig
88
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
93 %config(noreplace) %{_sysconfdir}/cgconfig.conf
94 %config(noreplace) %{_sysconfdir}/cgrules.conf
95 %attr(755,root,root) /%{_lib}/libcgroup.so.*
96 /bin/cgexec
97 /bin/cgclassify
98 /sbin/cgconfigparser
99 /sbin/cgrulesengd
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
106
107 %files devel
108 %defattr(644,root,root,755)
109 %{_includedir}/libcgroup.h
110 %{_libdir}/libcgroup.*
111 %doc INSTALL
This page took 0.065871 seconds and 4 git commands to generate.