Blame SPECS/libcgroup.spec

2ae3c9
%global soversion_major 1
2ae3c9
%global soversion 1.0.41
2ae3c9
%global _hardened_build 1
2ae3c9
2ae3c9
Summary: Library to control and monitor control groups
2ae3c9
Name: libcgroup
2ae3c9
Version: 0.41
2ae3c9
Release: 19%{?dist}
2ae3c9
License: LGPLv2+
2ae3c9
Group: Development/Libraries
2ae3c9
URL: http://libcg.sourceforge.net/
2ae3c9
Source0: http://downloads.sourceforge.net/libcg/%{name}-%{version}.tar.bz2
2ae3c9
Source1: cgconfig.service
2ae3c9
2ae3c9
Patch0: fedora-config.patch
2ae3c9
Patch1: libcgroup-0.37-chmod.patch
2ae3c9
Patch2: libcgroup-0.40.rc1-coverity.patch
2ae3c9
Patch3: libcgroup-0.40.rc1-fread.patch
2ae3c9
Patch4: libcgroup-0.40.rc1-templates-fix.patch
2ae3c9
Patch5: libcgroup-0.41-lex.patch
2ae3c9
Patch6: libcgroup-0.41-api.c-support-for-setting-multiline-values-in-contro.patch
2ae3c9
# resolves #1348874
2ae3c9
Patch7: libcgroup-0.41-api.c-fix-order-of-memory-subsystem-parameters.patch
2ae3c9
# resolves #1384504
2ae3c9
Patch8: libcgroup-0.41-api.c-preserve-dirty-flag.patch
2ae3c9
Patch9: libcgroup-0.41-change-cgroup-of-threads.patch
2ae3c9
Patch10: libcgroup-0.41-fix-infinite-loop.patch
2ae3c9
Patch11: libcgroup-0.41-prevent-buffer-overflow.patch
2ae3c9
Patch12: libcgroup-0.41-tasks-file-warning.patch
2ae3c9
Patch13: libcgroup-0.41-fix-log-level.patch
2ae3c9
Patch14: libcgroup-0.41-size-of-controller-values.patch
2ae3c9
Patch15: libcgroup-0.41-CVE-2018-14348.patch
2ae3c9
Patch16: libcgroup-0.41-coverity.patch
2ae3c9
2ae3c9
BuildRequires: gcc, gcc-c++
2ae3c9
BuildRequires: byacc, coreutils, flex, pam-devel, systemd-units
2ae3c9
Requires(pre): shadow-utils
2ae3c9
Requires(post): systemd
2ae3c9
Requires(preun): systemd
2ae3c9
Requires(postun): systemd
2ae3c9
2ae3c9
%description
2ae3c9
Control groups infrastructure. The library helps manipulate, control,
2ae3c9
administrate and monitor control groups and the associated controllers.
2ae3c9
2ae3c9
%package tools
2ae3c9
Summary: Command-line utility programs, services and daemons for libcgroup
2ae3c9
Group: System Environment/Base
2ae3c9
Requires: %{name}%{?_isa} = %{version}-%{release}
2ae3c9
# needed for Delegate property in cgconfig.service
2ae3c9
Requires: systemd >= 217-0.2
2ae3c9
2ae3c9
%description tools
2ae3c9
This package contains command-line programs, services and a daemon for
2ae3c9
manipulating control groups using the libcgroup library.
2ae3c9
2ae3c9
%package pam
2ae3c9
Summary: A Pluggable Authentication Module for libcgroup
2ae3c9
Group: System Environment/Base
2ae3c9
Requires: %{name}%{?_isa} = %{version}-%{release}
2ae3c9
2ae3c9
%description pam
2ae3c9
Linux-PAM module, which allows administrators to classify the user's login
2ae3c9
processes to pre-configured control group.
2ae3c9
2ae3c9
%package devel
2ae3c9
Summary: Development libraries to develop applications that utilize control groups
2ae3c9
Group: Development/Libraries
2ae3c9
Requires: %{name}%{?_isa} = %{version}-%{release}
2ae3c9
2ae3c9
%description devel
2ae3c9
It provides API to create/delete and modify cgroup nodes. It will also in the
2ae3c9
future allow creation of persistent configuration for control groups and
2ae3c9
provide scripts to manage that configuration.
2ae3c9
2ae3c9
%prep
2ae3c9
%setup  -q  -n %{name}-%{version}
2ae3c9
%patch0 -p1 -b .config-patch
2ae3c9
%patch1 -p1 -b .chmod
2ae3c9
%patch2 -p1 -b .coverity
2ae3c9
%patch3 -p1 -b .fread
2ae3c9
%patch4 -p1 -b .templates-fix
2ae3c9
%patch5 -p2 -b .lex
2ae3c9
%patch6 -p1
2ae3c9
%patch7 -p1
2ae3c9
%patch8 -p1
2ae3c9
%patch9 -p1
2ae3c9
%patch10 -p1
2ae3c9
%patch11 -p1
2ae3c9
%patch12 -p1
2ae3c9
%patch13 -p1
2ae3c9
%patch14 -p1
2ae3c9
%patch15 -p1
2ae3c9
%patch16 -p1
2ae3c9
2ae3c9
%build
2ae3c9
%configure --enable-pam-module-dir=%{_libdir}/security \
2ae3c9
           --enable-opaque-hierarchy="name=systemd" \
2ae3c9
           --disable-daemon
2ae3c9
make %{?_smp_mflags}
2ae3c9
2ae3c9
%install
2ae3c9
make DESTDIR=$RPM_BUILD_ROOT install
2ae3c9
2ae3c9
# install config files
2ae3c9
install -d ${RPM_BUILD_ROOT}%{_sysconfdir}
2ae3c9
install -m 644 samples/cgconfig.conf $RPM_BUILD_ROOT/%{_sysconfdir}/cgconfig.conf
2ae3c9
install -m 644 samples/cgsnapshot_blacklist.conf $RPM_BUILD_ROOT/%{_sysconfdir}/cgsnapshot_blacklist.conf
2ae3c9
2ae3c9
# sanitize pam module, we need only pam_cgroup.so
2ae3c9
mv -f $RPM_BUILD_ROOT%{_libdir}/security/pam_cgroup.so.*.*.* $RPM_BUILD_ROOT%{_libdir}/security/pam_cgroup.so
2ae3c9
rm -f $RPM_BUILD_ROOT%{_libdir}/security/pam_cgroup.la $RPM_BUILD_ROOT/%{_libdir}/security/pam_cgroup.so.*
2ae3c9
2ae3c9
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
2ae3c9
2ae3c9
rm -f $RPM_BUILD_ROOT/%{_mandir}/man5/cgred.conf.5*
2ae3c9
rm -f $RPM_BUILD_ROOT/%{_mandir}/man5/cgrules.conf.5*
2ae3c9
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/cgrulesengd.8*
2ae3c9
2ae3c9
# install unit and sysconfig files
2ae3c9
install -d ${RPM_BUILD_ROOT}%{_unitdir}
2ae3c9
install -m 644 %SOURCE1 ${RPM_BUILD_ROOT}%{_unitdir}/
2ae3c9
install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
2ae3c9
2ae3c9
%pre
2ae3c9
getent group cgred >/dev/null || groupadd -r cgred
2ae3c9
2ae3c9
%post -p /sbin/ldconfig
2ae3c9
2ae3c9
%postun -p /sbin/ldconfig
2ae3c9
2ae3c9
%post tools
2ae3c9
%systemd_post cgconfig.service
2ae3c9
2ae3c9
%preun tools
2ae3c9
%systemd_preun cgconfig.service
2ae3c9
2ae3c9
%postun tools
2ae3c9
%systemd_postun_with_restart cgconfig.service
2ae3c9
2ae3c9
%triggerun -- libcgroup < 0.38
2ae3c9
# Save the current service runlevel info
2ae3c9
# User must manually run systemd-sysv-convert --apply cgconfig
2ae3c9
# to migrate them to systemd targets
2ae3c9
/usr/bin/systemd-sysv-convert --save cgconfig >/dev/null 2>&1 ||:
2ae3c9
2ae3c9
# Run these because the SysV package being removed won't do them
2ae3c9
/sbin/chkconfig --del cgconfig >/dev/null 2>&1 || :
2ae3c9
/bin/systemctl try-restart cgconfig.service >/dev/null 2>&1 || :
2ae3c9
2ae3c9
%files
2ae3c9
%{!?_licensedir:%global license %%doc}
2ae3c9
%license COPYING
2ae3c9
%doc README
2ae3c9
%{_libdir}/libcgroup.so.*
2ae3c9
2ae3c9
%files tools
2ae3c9
%{!?_licensedir:%global license %%doc}
2ae3c9
%license COPYING
2ae3c9
%doc README README_systemd
2ae3c9
%config(noreplace) %{_sysconfdir}/cgconfig.conf
2ae3c9
%config(noreplace) %{_sysconfdir}/cgsnapshot_blacklist.conf
2ae3c9
/usr/bin/cgcreate
2ae3c9
/usr/bin/cgget
2ae3c9
/usr/bin/cgset
2ae3c9
/usr/bin/cgdelete
2ae3c9
/usr/bin/lscgroup
2ae3c9
/usr/bin/lssubsys
2ae3c9
/usr/sbin/cgconfigparser
2ae3c9
/usr/sbin/cgclear
2ae3c9
/usr/bin/cgsnapshot
2ae3c9
%attr(2755, root, cgred) /usr/bin/cgexec
2ae3c9
%attr(2755, root, cgred) /usr/bin/cgclassify
2ae3c9
%attr(0644, root, root) %{_mandir}/man1/*
2ae3c9
%attr(0644, root, root) %{_mandir}/man5/*
2ae3c9
%attr(0644, root, root) %{_mandir}/man8/*
2ae3c9
%{_unitdir}/cgconfig.service
2ae3c9
2ae3c9
%files pam
2ae3c9
%{!?_licensedir:%global license %%doc}
2ae3c9
%license COPYING
2ae3c9
%doc README
2ae3c9
%attr(0755,root,root) %{_libdir}/security/pam_cgroup.so
2ae3c9
2ae3c9
%files devel
2ae3c9
%{!?_licensedir:%global license %%doc}
2ae3c9
%license COPYING
2ae3c9
%doc README
2ae3c9
%{_includedir}/libcgroup.h
2ae3c9
%{_includedir}/libcgroup/*.h
2ae3c9
%{_libdir}/libcgroup.so
2ae3c9
%{_libdir}/pkgconfig/libcgroup.pc
2ae3c9
2ae3c9
%changelog
2ae3c9
* Mon Oct 15 2018 Nikola Forró <nforro@redhat.com> - 0.41-19
2ae3c9
- resolves: #1606973
2ae3c9
  fix important Covscan defects
2ae3c9
2ae3c9
* Thu Aug 02 2018 Nikola Forró <nforro@redhat.com> - 0.41-18
2ae3c9
- resolves: #1611122
2ae3c9
  fix CVE-2018-14348
2ae3c9
2ae3c9
* Tue Apr 17 2018 Nikola Forró <nforro@redhat.com> - 0.41-17
2ae3c9
- backport several upstream fixes
2ae3c9
- set Delegate property for cgconfig service to make sure complete
2ae3c9
  cgroup hierarchy is always created by systemd
2ae3c9
2ae3c9
* Tue Feb 20 2018 Nikola Forró <nforro@redhat.com> - 0.41-16
2ae3c9
- add missing gcc-c++ build dependency
2ae3c9
2ae3c9
* Tue Feb 20 2018 Nikola Forró <nforro@redhat.com> - 0.41-15
2ae3c9
- add missing gcc build dependency
2ae3c9
2ae3c9
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.41-14
2ae3c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
2ae3c9
2ae3c9
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.41-13
2ae3c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
2ae3c9
2ae3c9
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.41-12
2ae3c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
2ae3c9
2ae3c9
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.41-11
2ae3c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
2ae3c9
2ae3c9
* Thu Oct 13 2016 Nikola Forró <nforro@redhat.com> - 0.41-10
2ae3c9
- resolves: #1384504
2ae3c9
  api.c: preserve dirty flag when copying controller values
2ae3c9
2ae3c9
* Fri Jul 01 2016 Nikola Forró <nforro@redhat.com> - 0.41-9
2ae3c9
- resolves: #1348874
2ae3c9
  api.c: fix order of memory subsystem parameters generated by cgsnapshot
2ae3c9
2ae3c9
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.41-8
2ae3c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
2ae3c9
2ae3c9
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.41-7
2ae3c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
2ae3c9
2ae3c9
* Tue Sep 23 2014 jchaloup <jchaloup@redhat.com> - 0.41-6
2ae3c9
- resolves: #647107
2ae3c9
  api.c: support for setting multiline values in control files
2ae3c9
2ae3c9
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.41-5
2ae3c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
2ae3c9
2ae3c9
* Thu Jul 17 2014 Tom Callaway <spot@fedoraproject.org> - 0.41-4
2ae3c9
- fix license handling
2ae3c9
2ae3c9
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.41-3
2ae3c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
2ae3c9
2ae3c9
* Mon Mar 03 2014 jchaloup <jchaloup@redhat.com> - 0.41-2
2ae3c9
- lex.l update: add \ character into regexp for ID token
2ae3c9
2ae3c9
* Tue Jan 14 2014 Peter Schiffer <pschiffe@redhat.com> 0.41-1
2ae3c9
- resolves: #966008
2ae3c9
  updated to 0.41
2ae3c9
- removed deprecated cgred service
2ae3c9
  please use Control Group Interface in Systemd instead
2ae3c9
2ae3c9
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.38-7
2ae3c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
2ae3c9
2ae3c9
* Thu Jul 18 2013 Karsten Hopp <karsten@redhat.com> 0.38-6
2ae3c9
- add BR: systemd-units
2ae3c9
2ae3c9
* Tue Jul 09 2013 Karsten Hopp <karsten@redhat.com> 0.38-5
2ae3c9
- bump release and rebuild to fix some dependencies on PPC
2ae3c9
2ae3c9
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.38-4
2ae3c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
2ae3c9
2ae3c9
* Fri Nov 23 2012 Peter Schiffer <pschiffe@redhat.com> - 0.38-3
2ae3c9
- resolves: #850183
2ae3c9
  scriptlets replaced with new systemd macros (thanks to vpavlin)
2ae3c9
- cleaned .spec file
2ae3c9
2ae3c9
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.38-2
2ae3c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
2ae3c9
2ae3c9
* Mon Feb 20 2012 Jan Safranek <jsafrane@redhat.com> 0.38-1
2ae3c9
- updated to 0.38
2ae3c9
2ae3c9
* Fri Feb  3 2012 Jan Safranek <jsafrane@redhat.com> 0.38-0.rc1
2ae3c9
- updated to 0.38.rc1
2ae3c9
2ae3c9
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.37.1-5
2ae3c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
2ae3c9
2ae3c9
* Mon May 30 2011 Jan Safranek <jsafrane@redhat.com> 0.37.1-4
2ae3c9
- fixed cgconfig service not to unmount stuff it did not mount
2ae3c9
- added better sample cgconfig.conf file to reflect systemd
2ae3c9
  mounting all controllers during boot (#702111)
2ae3c9
2ae3c9
* Wed May 25 2011 Ivana Hutarova Varekova <varekova@redhat.com> 0.37.1-3
2ae3c9
- split tools part from libcgroup package
2ae3c9
2ae3c9
* Fri Apr  8 2011 Jan Safranek <jsafrane@redhat.com> 0.37.1-2
2ae3c9
- Remove /cgroup directory, groups are created in /sys/fs/cgroup
2ae3c9
  (#694687)
2ae3c9
2ae3c9
* Thu Mar  3 2011 Jan Safranek <jsafrane@redhat.com> 0.37.1-1
2ae3c9
- Update to 0.37.1
2ae3c9
2ae3c9
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.37-3
2ae3c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
2ae3c9
2ae3c9
* Mon Jan 17 2011 Jan Safranek <jsafrane@redhat.com> 0.37-2
2ae3c9
- Create the 'cgred' group as system group, not as user
2ae3c9
- Fix cgclassify exit code
2ae3c9
2ae3c9
* Mon Dec 13 2010 Jan Safranek <jsafrane@redhat.com> 0.37-1
2ae3c9
- Update to 0.37
2ae3c9
- use /sys/fs/cgroup as default directory to mount control groups (and rely on
2ae3c9
  systemd mounting tmpfs there)
2ae3c9
2ae3c9
* Fri Nov 12 2010 Jan Safranek <jsafrane@redhat.com> 0.36.2-3
2ae3c9
- Ignore systemd hierarchy - it's now invisible to libcgroup (#627378)
2ae3c9
2ae3c9
* Mon Aug  2 2010 Jan Safranek <jsafrane@redhat.com> 0.36.2-2
2ae3c9
- Fix initscripts to report stopped cgconfig service as not running
2ae3c9
  (#619091)
2ae3c9
2ae3c9
* Tue Jun 22 2010 Jan Safranek <jsafrane@redhat.com> 0.36.2-1
2ae3c9
- Update to 0.36.2, fixing packaging the libraries (#605434)
2ae3c9
- Remove the dependency on redhat-lsb (#603578)
2ae3c9
2ae3c9
* Fri May 21 2010 Jan Safranek <jsafrane@redhat.com> 0.36-1
2ae3c9
- Update to 0.36.1
2ae3c9
2ae3c9
* Tue Mar  9 2010 Jan Safranek <jsafrane@redhat.com> 0.35-1
2ae3c9
- Update to 0.35.1
2ae3c9
- Separate pam module to its own subpackage
2ae3c9
2ae3c9
* Mon Jan 18 2010 Jan Safranek <jsafrane@redhat.com> 0.34-4
2ae3c9
- Added README.Fedora to describe initscript integration
2ae3c9
2ae3c9
* Mon Oct 19 2009 Jan Safranek <jsafrane@redhat.com> 0.34-3
2ae3c9
- Change the default configuration to mount everything to /cgroup
2ae3c9
2ae3c9
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.34-2
2ae3c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
2ae3c9
2ae3c9
* Tue Jul  7 2009 Jan Safranek <jsafrane@redhat.com> 0.34-1
2ae3c9
- Update to 0.34
2ae3c9
* Mon Mar 09 2009 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.33-3
2ae3c9
- Add a workaround for rt cgroup controller.
2ae3c9
* Mon Mar 09 2009 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.33-2
2ae3c9
- Change the cgconfig script to start earlier
2ae3c9
- Move the binaries to /bin and /sbin
2ae3c9
* Mon Mar 02 2009 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.33-1
2ae3c9
- Update to latest upstream
2ae3c9
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> 0.32.2-4
2ae3c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
2ae3c9
2ae3c9
* Mon Jan 05 2009 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.32.2-3
2ae3c9
- Fix redhat-lsb dependency
2ae3c9
* Mon Dec 29 2008 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.32.2-2
2ae3c9
- Fix build dependencies
2ae3c9
* Mon Dec 29 2008 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.32.2-1
2ae3c9
- Update to latest upstream
2ae3c9
* Thu Oct 23 2008 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.32.1-1
2ae3c9
* Tue Feb 24 2009 Balbir Singh <balbir@linux.vnet.ibm.com> 0.33-1
2ae3c9
- Update to 0.33, spec file changes to add Makefiles and pam_cgroup module
2ae3c9
* Fri Oct 10 2008 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.32-1
2ae3c9
- Update to latest upstream
2ae3c9
* Thu Sep 11 2008 Dhaval Giani <dhaval@linux-vnet.ibm.com> 0.31-1
2ae3c9
- Update to latest upstream
2ae3c9
* Sat Aug 2 2008 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.1c-3
2ae3c9
- Change release to fix broken upgrade path
2ae3c9
* Wed Jun 11 2008 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.1c-1
2ae3c9
- Update to latest upstream version
2ae3c9
* Tue Jun 3 2008 Balbir Singh <balbir@linux.vnet.ibm.com> 0.1b-3
2ae3c9
- Add post and postun. Also fix Requires for devel to depend on base n-v-r
2ae3c9
* Sat May 31 2008 Balbir Singh <balbir@linux.vnet.ibm.com> 0.1b-2
2ae3c9
- Fix makeinstall, Source0 and URL (review comments from Tom)
2ae3c9
* Mon May 26 2008 Balbir Singh <balbir@linux.vnet.ibm.com> 0.1b-1
2ae3c9
- Add a generatable spec file
2ae3c9
* Tue May 20 2008 Balbir Singh <balbir@linux.vnet.ibm.com> 0.1-1
2ae3c9
- Get the spec file to work
2ae3c9
* Tue May 20 2008 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.01-1
2ae3c9
- The first version of libcg