%define major 1%define mname cgroup%define name lib%{mname}%define version 0.36.2%define release %mkrel 1%define libname %mklibname %{mname} %{major}%define devname %mklibname %{mname} -dName: %{name}Summary: Tools and libraries to control and monitor control groupsGroup: System/BaseVersion: %{version}Release: %{release}License: LGPLv2URL: http://libcg.sourceforge.net/Source0: http://downloads.sourceforge.net/libcg/%{name}/v%{version}/%{name}-%{version}.tar.bz2Source1: libcgroup-README.MandrivaPatch0: libcgroup-fedora-config.patchBuildRoot: %{_tmppath}/%{name}-%{version}BuildRequires: pam-develBuildRequires: byaccBuildRequires: flexBuildRequires: coreutils%descriptionControl groups infrastructure. The tools and library to manipulate, control,administrate and monitor control groups and the associated controllers.%package -n %{mname}Summary: Tools to control and monitor control groups Group: System/BaseProvides: %{name} = %{version}-%{release}Requires(post): rpm-helperRequires(preun): rpm-helper%description -n cgroupControl groups infrastructure. The tools to manipulate, control, administrateand monitor control groups and the associated controllers.%package pamSummary: A Pluggable Authentication Module for libcgroupGroup: System/LibrariesRequires: %{libname} = %{version}-%{release}%description pamLinux-PAM module, which allows administrators to classify the user's loginprocesses to pre-configured control group.%package -n %{libname}Summary: Libraries to control and monitor control groupsGroup: System/Libraries# binaries are statically linked, so while they don't require the library,# anything linked against the library will require the config files etc.# rovided by the main packageRequires: %{mname} = %{version}-%{release}%description -n %{libname}Control groups infrastructure. The library to manipulate, control, administrateand monitor control groups and the associated controllers.%package -n %{devname}Summary: Development libraries to develop applications that utilize control groupsGroup: Development/CRequires: %{libname} = %{version}-%{release}Provides: %{name}-devel = %{version}-%{release}%description -n %{devname}It provides API to create/delete and modify cgroup nodes. It will also in thefuture allow creation of persistent configuration for control groups andprovide scripts to manage that configuration.%prep%setup -q%patch0 -p1 -b .configcp %{SOURCE1} README.Mandriva%build%configure2_5x --bindir=/bin \ --sbindir=/sbin \ --libdir=/%{_lib} \ --enable-initscript-install%make%installrm -rf %{buildroot}%makeinstall_std# install config filesinstall -m644 samples/cgred.conf -D %{buildroot}%{_sysconfdir}/sysconfig/cgred.confinstall -m644 samples/cgconfig.conf -D %{buildroot}%{_sysconfdir}/cgconfig.confinstall -m644 samples/cgrules.conf -D %{buildroot}%{_sysconfdir}/cgrules.conf# sanitize pam module, we need only pam_cgroup.so in the right directoryrm -f %{buildroot}/%{_lib}/security/pam_cgroup.somv -f %{buildroot}/%{_lib}/security/pam_cgroup.so.*.*.* %{buildroot}/%{_lib}/security/pam_cgroup.sorm -f %{buildroot}/%{_lib}/security/pam_cgroup.so.*rm -f %{buildroot}/%{_lib}/security/pam_cgroup.la# move the devel stuff to /usrmkdir -p %{buildroot}%{_libdir}mv -f %{buildroot}/%{_lib}/lib%{mname}.la %{buildroot}%{_libdir}rm -f %{buildroot}/%{_lib}/lib%{mname}.soln -sf ../../%{_lib}/lib%{mname}.so.%{major} %{buildroot}%{_libdir}/lib%{mname}.so# pkgconfig file as wellmkdir -p %{buildroot}%{_libdir}/pkgconfigmv -f %{buildroot}/%{_lib}/pkgconfig/%{name}.pc %{buildroot}%{_libdir}/pkgconfig# pre-create /cgroup directorymkdir -p %{buildroot}/cgroup%cleanrm -rf %{buildroot}%post -n %{mname}%_post_service cgred%_post_service cgconfig%preun -n %{mname}%_preun_service cgconfig%_preun_service cgred%files -n %{mname}%defattr(-,root,root)%doc README_daemon README.Mandriva%dir /cgroup%config(noreplace) %{_sysconfdir}/sysconfig/cgred.conf%config(noreplace) %{_sysconfdir}/cgconfig.conf%config(noreplace) %{_sysconfdir}/cgrules.conf%{_mandir}/man[158]/*.[158]*%attr(755,root,root) %{_initrddir}/cgconfig%attr(755,root,root) %{_initrddir}/cgred/bin/cgclassify/bin/cgcreate/bin/cgdelete/bin/cgexec/bin/cgget/bin/cgset/bin/lscgroup/bin/lssubsys/sbin/cgclear/sbin/cgconfigparser/sbin/cgrulesengd%files pam%defattr(-,root,root)/%{_lib}/security/pam_cgroup.so%files -n %{libname}%defattr(-,root,root)/%{_lib}/lib%{mname}.so.%{major}/%{_lib}/lib%{mname}.so.%{major}.*%files -n %{devname}%defattr(-,root,root)%{_includedir}/libcgroup.h%{_includedir}/libcgroup%{_libdir}/pkgconfig/%{name}.pc%{_libdir}/lib%{mname}.so%{_libdir}/lib%{mname}.la