2019-12-25 17:13:03 +08:00
|
|
|
%global soversion_major 1
|
|
|
|
|
%global soversion 1.0.41
|
|
|
|
|
%global _hardened_build 1
|
|
|
|
|
|
|
|
|
|
Summary: Libcgroup is a library that abstracts the control group file system in Linux
|
|
|
|
|
Name: libcgroup
|
2020-11-04 10:58:25 +08:00
|
|
|
Version: 0.42.2
|
2022-11-03 19:29:49 +08:00
|
|
|
Release: 3
|
2019-12-25 17:13:03 +08:00
|
|
|
License: LGPLv2+
|
|
|
|
|
URL: http://libcg.sourceforge.net/
|
2020-11-04 10:58:25 +08:00
|
|
|
Source0: https://github.com/%{name}/%{name}/archive/v%{version}/%{name}-v%{version}.tar.gz
|
2019-12-25 17:13:03 +08:00
|
|
|
Source1: cgconfig.service
|
|
|
|
|
Provides: libcgroup-pam libcgroup-tools
|
|
|
|
|
Obsoletes: libcgroup-pam libcgroup-tools
|
|
|
|
|
|
|
|
|
|
Patch0: config.patch
|
|
|
|
|
Patch1: libcgroup-0.37-chmod.patch
|
|
|
|
|
Patch2: libcgroup-0.40.rc1-coverity.patch
|
|
|
|
|
Patch3: libcgroup-0.40.rc1-fread.patch
|
|
|
|
|
Patch4: libcgroup-0.40.rc1-templates-fix.patch
|
|
|
|
|
|
2020-11-04 10:58:25 +08:00
|
|
|
BuildRequires: autoconf, automake, libtool
|
2019-12-25 17:13:03 +08:00
|
|
|
BuildRequires: gcc,gcc-c++,byacc
|
|
|
|
|
BuildRequires: systemd-units,pam-devel,flex,coreutils
|
|
|
|
|
|
|
|
|
|
Requires: systemd >= 217-0.2
|
|
|
|
|
Requires(pre): shadow-utils
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
Cgroups is a Linux kernel feature that limits, accounts for, and isolates
|
|
|
|
|
the resource usage (CPU, memory, disk I/O, network, etc.) of a collection of processes.
|
|
|
|
|
The library helps manipulte and administrate control groups.
|
|
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
|
Summary: Devel helps applications to use cgroups
|
|
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
|
|
|
%description devel
|
|
|
|
|
Devel provides API for creating,deleting and modifying cgroup nodes.It allows
|
|
|
|
|
the creation of cgroups' configuration and provides scripts for managing it.
|
|
|
|
|
|
|
|
|
|
%package help
|
|
|
|
|
Summary: It provides helpful information for libcgroup
|
|
|
|
|
%description help
|
|
|
|
|
It provides helpful information for libcgroup-pam,libcgroup-devel,libcgroup-tools and libcgroup.
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n %{name}-%{version}
|
|
|
|
|
%patch0 -p1
|
|
|
|
|
%patch1 -p1
|
|
|
|
|
%patch2 -p1
|
|
|
|
|
%patch3 -p1
|
|
|
|
|
%patch4 -p1
|
|
|
|
|
|
|
|
|
|
%build
|
2020-11-04 10:58:25 +08:00
|
|
|
autoreconf -vif
|
2019-12-25 17:13:03 +08:00
|
|
|
%configure --enable-pam-module-dir=%{_libdir}/security --enable-opaque-hierarchy="name=systemd" --disable-daemon
|
2022-11-03 19:29:49 +08:00
|
|
|
%ifarch sw_64
|
|
|
|
|
make
|
|
|
|
|
%else
|
2019-12-25 17:13:03 +08:00
|
|
|
make %{?_smp_mflags}
|
2022-11-03 19:29:49 +08:00
|
|
|
%endif
|
2019-12-25 17:13:03 +08:00
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
make DESTDIR=$RPM_BUILD_ROOT install
|
|
|
|
|
|
|
|
|
|
# config
|
|
|
|
|
install -d ${RPM_BUILD_ROOT}%{_sysconfdir}
|
|
|
|
|
install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
|
|
|
|
|
install -m 644 samples/cgconfig.conf $RPM_BUILD_ROOT%{_sysconfdir}/cgconfig.conf
|
|
|
|
|
install -m 644 samples/cgsnapshot_blacklist.conf $RPM_BUILD_ROOT%{_sysconfdir}/cgsnapshot_blacklist.conf
|
|
|
|
|
|
|
|
|
|
# Only one pam_cgroup.so is needed
|
|
|
|
|
mv -f $RPM_BUILD_ROOT%{_libdir}/security/pam_cgroup.so.*.*.* $RPM_BUILD_ROOT%{_libdir}/security/pam_cgroup.so
|
2020-11-04 10:58:25 +08:00
|
|
|
rm -f $RPM_BUILD_ROOT%{_libdir}/security/pam_cgroup.{,l}a $RPM_BUILD_ROOT%{_libdir}/security/pam_cgroup.so.*
|
|
|
|
|
|
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_libdir}/*.{,l}a
|
|
|
|
|
|
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_libdir}/libcgroupfortesting.*
|
2019-12-25 17:13:03 +08:00
|
|
|
|
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_mandir}/man5/cgred.conf.5*
|
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_mandir}/man5/cgrules.conf.5*
|
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_mandir}/man8/cgrulesengd.8*
|
|
|
|
|
|
|
|
|
|
# unit and sysconfig
|
|
|
|
|
install -d ${RPM_BUILD_ROOT}%{_unitdir}
|
|
|
|
|
install -m 644 %SOURCE1 ${RPM_BUILD_ROOT}%{_unitdir}/
|
|
|
|
|
|
|
|
|
|
%pre
|
|
|
|
|
getent group cgred >/dev/null || groupadd -r cgred
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
%systemd_post cgconfig.service
|
|
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
%systemd_preun cgconfig.service
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
%systemd_postun_with_restart cgconfig.service
|
|
|
|
|
|
|
|
|
|
%triggerun -- libcgroup < 0.38
|
|
|
|
|
/usr/bin/systemd-sysv-convert --save cgconfig >/dev/null 2>&1 ||:
|
|
|
|
|
/sbin/chkconfig --del cgconfig >/dev/null 2>&1 || :
|
|
|
|
|
/bin/systemctl try-restart cgconfig.service >/dev/null 2>&1 || :
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%{!?_licensedir:%global license %%doc}
|
|
|
|
|
%license COPYING
|
|
|
|
|
%{_libdir}/libcgroup.so.*
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/cgsnapshot_blacklist.conf
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/cgconfig.conf
|
|
|
|
|
/usr/bin/cgget
|
|
|
|
|
/usr/bin/cgset
|
|
|
|
|
/usr/bin/cgcreate
|
|
|
|
|
/usr/bin/cgdelete
|
|
|
|
|
/usr/bin/cgsnapshot
|
|
|
|
|
/usr/bin/lscgroup
|
|
|
|
|
/usr/bin/lssubsys
|
|
|
|
|
/usr/sbin/cgclear
|
|
|
|
|
/usr/sbin/cgconfigparser
|
|
|
|
|
%attr(2755, root, cgred) /usr/bin/cgexec
|
|
|
|
|
%attr(2755, root, cgred) /usr/bin/cgclassify
|
|
|
|
|
%attr(0755,root,root) %{_libdir}/security/pam_cgroup.so
|
|
|
|
|
%{_unitdir}/cgconfig.service
|
|
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
|
%{!?_licensedir:%global license %%doc}
|
|
|
|
|
%license COPYING
|
|
|
|
|
%{_libdir}/libcgroup.so
|
|
|
|
|
%{_libdir}/pkgconfig/libcgroup.pc
|
|
|
|
|
%{_includedir}/libcgroup.h
|
|
|
|
|
%{_includedir}/libcgroup/*.h
|
|
|
|
|
|
|
|
|
|
%files help
|
|
|
|
|
%license COPYING
|
|
|
|
|
%doc README README_systemd
|
|
|
|
|
%attr(0644, root, root) %{_mandir}/man1/*
|
|
|
|
|
%attr(0644, root, root) %{_mandir}/man5/*
|
|
|
|
|
%attr(0644, root, root) %{_mandir}/man8/*
|
|
|
|
|
|
|
|
|
|
%changelog
|
2022-11-03 19:29:49 +08:00
|
|
|
* Thu Nov 3 wuzx<wuzx1226@qq.com> - 0.42.2-3
|
|
|
|
|
- Type:feature
|
|
|
|
|
- CVE:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:Add sw64 architecture
|
|
|
|
|
|
2022-05-05 16:18:31 +08:00
|
|
|
* Thu May 5 2022 wangfengtu<wangfengtu@huawei.com> - 0.42.2-2
|
|
|
|
|
- Type: upgrade
|
|
|
|
|
- Id:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:update release version
|
|
|
|
|
|
2020-11-04 10:58:25 +08:00
|
|
|
* Wed Nov 4 2020 leizhongkai<leizhongkai@huawei.com> - 0.42.2-1
|
|
|
|
|
- Type: upgrade
|
|
|
|
|
- Id:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:new upstream release 0.42.2
|
|
|
|
|
|
2020-01-07 19:23:21 +08:00
|
|
|
* Tue Jan 7 2020 openEuler Buildteam <buildteam@openeuler.org> - 0.41-23
|
|
|
|
|
- Type:enhancement
|
|
|
|
|
- Id:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:modify spec patch
|
|
|
|
|
|
2019-12-25 17:13:03 +08:00
|
|
|
* Thu Dec 19 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.41-22
|
|
|
|
|
- Type:enhancement
|
|
|
|
|
- Id:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:modify the config patch
|
|
|
|
|
|
|
|
|
|
* Thu Nov 7 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.41-21
|
|
|
|
|
- Type:enhancement
|
|
|
|
|
- Id:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:modify the release
|
|
|
|
|
|
|
|
|
|
* Tue Jan 22 2019 lunankun<lunankun@huawei.com> - 0.41-20.h1
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:restart
|
|
|
|
|
- DESC:change parser match order fix cgconfig error.
|
|
|
|
|
|