libcgroup-vl.spec 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. %bcond_with systemd
  2. %define soversion 1.0.42
  3. %define soversion_major 1
  4. Name: libcgroup
  5. Summary: Tools and libraries to control and monitor control groups
  6. Summary(ja): CGROUPS を管理・監視するためのツールおよびライブラリ
  7. Version: 0.42.2
  8. Release: 2%{?_dist_release}%{?with_systemd:.systemd}
  9. Group: system
  10. Vendor: Project Vine
  11. Distribution: Vine Linux
  12. License: LGPLv2+
  13. URL: http://libcg.sourceforge.net/
  14. Source0: https://github.com/%{name}/%{name}/archive/v%{version}/%{name}-v%{version}.tar.gz
  15. Source1: cgconfig.conf.sysvinit
  16. Source2: cgconfig.sysconfig
  17. Source100: cgconfig.service
  18. Source101: cgconfig.conf.systemd
  19. Patch1: libcgroup-0.37-chmod.patch
  20. Patch2: libcgroup-0.40.rc1-coverity.patch
  21. Patch3: libcgroup-0.40.rc1-fread.patch
  22. Patch4: libcgroup-0.40.rc1-templates-fix.patch
  23. Patch1001: 0002-fix-initscripts.patch
  24. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  25. BuildRequires: pam-devel
  26. BuildRequires: byacc
  27. BuildRequires: flex
  28. BuildRequires: coreutils
  29. Requires(pre): shadow-utils
  30. %if %{with systemd}
  31. %{?systemd_requires}
  32. %else
  33. Requires(post): chkconfig, /sbin/service
  34. Requires(preun): /sbin/chkconfig
  35. %endif
  36. %description
  37. Control groups infrastructure. The tools and library help manipulate, control,
  38. administrate and monitor control groups and the associated controllers.
  39. %package pam
  40. Summary: A Pluggable Authentication Module for libcgroup
  41. Summary(ja): Libcgroup の PAM モジュール
  42. Group: system
  43. Requires: libcgroup = %{version}-%{release}
  44. %description pam
  45. Linux-PAM module, which allows administrators to classify the user's login
  46. processes to pre-configured control group.
  47. %package devel
  48. Summary: Development files for libcgroup
  49. Summary(ja): libcgroup の開発用ファイル
  50. Group: programming
  51. Requires: libcgroup = %{version}-%{release}
  52. %description devel
  53. It provides API to create/delete and modify cgroup nodes. It will also in the
  54. future allow creation of persistent configuration for control groups and
  55. provide scripts to manage that configuration.
  56. %debug_package
  57. %prep
  58. %setup -q -n %{name}-%{version}
  59. %autopatch -p1
  60. autoreconf -vif
  61. %build
  62. %configure \
  63. --bindir=/bin --sbindir=/sbin --libdir=%{_libdir} \
  64. --enable-pam-module-dir=/%{_lib}/security \
  65. %if !%{with systemd}
  66. --enable-initscript-install \
  67. %endif
  68. %{nil}
  69. make %{?_smp_mflags}
  70. %install
  71. make DESTDIR=%{buildroot} install
  72. # install config files
  73. mkdir -p %{buildroot}/%{_sysconfdir}/sysconfig
  74. cp samples/cgred.conf %{buildroot}/%{_sysconfdir}/sysconfig/cgred.conf
  75. cp %{SOURCE2} %{buildroot}/%{_sysconfdir}/sysconfig/cgconfig
  76. cp samples/cgrules.conf %{buildroot}/%{_sysconfdir}/cgrules.conf
  77. cp samples/cgsnapshot_blacklist.conf %{buildroot}/%{_sysconfdir}/cgsnapshot_blacklist.conf
  78. %if %{with systemd}
  79. install -Dpm644 %{SOURCE100} %{buildroot}/%{_unitdir}/cgconfig.service
  80. cp %{SOURCE101} %{buildroot}/%{_sysconfdir}/cgconfig.conf
  81. %else
  82. cp %{SOURCE1} %{buildroot}/%{_sysconfdir}/cgconfig.conf
  83. %endif
  84. # sanitize pam module, we need only pam_cgroup.so
  85. mv -f %{buildroot}/%{_lib}/security/pam_cgroup.so.*.*.* %{buildroot}/%{_lib}/security/pam_cgroup.so
  86. rm -f %{buildroot}/%{_lib}/security/pam_cgroup.la %{buildroot}/%{_lib}/security/pam_cgroup.so.*
  87. # move the libraries to /
  88. mkdir -p %{buildroot}/%{_lib}
  89. mv -f %{buildroot}/%{_libdir}/libcgroup.so.%{soversion} %{buildroot}/%{_lib}
  90. rm -f %{buildroot}/%{_libdir}/libcgroup.so.%{soversion_major}
  91. ln -sf libcgroup.so.%{soversion} %{buildroot}/%{_lib}/libcgroup.so.%{soversion_major}
  92. ln -sf ../../%{_lib}/libcgroup.so.%{soversion} %{buildroot}/%{_libdir}/libcgroup.so
  93. rm -f %{buildroot}/%{_libdir}/*.{a,la}
  94. rm -f %{buildroot}/%{_libdir}/libcgroupfortesting.*
  95. rm -f %{buildroot}/%{_lib}/security/*.a
  96. # pre-create /cgroup directory
  97. mkdir %{buildroot}/cgroup
  98. %pre
  99. getent group cgred >/dev/null || groupadd -r cgred
  100. %post
  101. %if %{with systemd}
  102. %systemd_post cgconfig.service
  103. %else
  104. /sbin/chkconfig --add cgred
  105. /sbin/chkconfig --add cgconfig
  106. %endif
  107. %preun
  108. %if %{with systemd}
  109. %systemd_preun cgconfig.service
  110. %else
  111. if [ $1 = 0 -o -x /bin/systemctl ]; then
  112. /sbin/service cgred stop > /dev/null 2>&1 || :
  113. /sbin/service cgconfig stop > /dev/null 2>&1 || :
  114. /sbin/chkconfig --del cgconfig
  115. /sbin/chkconfig --del cgred
  116. fi
  117. %endif
  118. %if %{with systemd}
  119. %postun
  120. %systemd_postun_with_restart cgconfig.service
  121. %endif
  122. %files
  123. %defattr(-,root,root,-)
  124. %config(noreplace) %{_sysconfdir}/sysconfig/cgred.conf
  125. %config(noreplace) %{_sysconfdir}/sysconfig/cgconfig
  126. %config(noreplace) %{_sysconfdir}/cgconfig.conf
  127. %config(noreplace) %{_sysconfdir}/cgrules.conf
  128. %config(noreplace) %{_sysconfdir}/cgsnapshot_blacklist.conf
  129. /%{_lib}/libcgroup.so.*
  130. %attr(2755, root, cgred) /bin/cgexec
  131. /bin/cgclassify
  132. /bin/cgcreate
  133. /bin/cgget
  134. /bin/cgset
  135. /bin/cgdelete
  136. /bin/lscgroup
  137. /bin/lssubsys
  138. /sbin/cgconfigparser
  139. /sbin/cgrulesengd
  140. /sbin/cgclear
  141. /bin/cgsnapshot
  142. %attr(0644, root, root) %{_mandir}/man1/*
  143. %attr(0644, root, root) %{_mandir}/man5/*
  144. %attr(0644, root, root) %{_mandir}/man8/*
  145. %if %{with systemd}
  146. %{_unitdir}/cgconfig.service
  147. %else
  148. %attr(0755,root,root) %{_initrddir}/cgconfig
  149. %attr(0755,root,root) %{_initrddir}/cgred
  150. %endif
  151. %license COPYING
  152. %doc README_daemon
  153. %files pam
  154. %defattr(-,root,root,-)
  155. %attr(0755,root,root) /%{_lib}/security/pam_cgroup.so
  156. %license COPYING
  157. %files devel
  158. %defattr(-,root,root,-)
  159. %{_includedir}/libcgroup.h
  160. %{_includedir}/libcgroup/*.h
  161. %{_libdir}/libcgroup.*
  162. /%{_libdir}/pkgconfig/libcgroup.pc
  163. %license COPYING
  164. %changelog
  165. * Mon Mar 22 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.42.2-2
  166. - dropped ldconfig scriptlets.
  167. - updated Patch1001: made LSB free.
  168. - added systemd support (disabled as default).
  169. * Thu Mar 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.42.2-1
  170. - new upstream release.
  171. - dropped Patch1-15.
  172. - imported Patch1-4 from rawhide.
  173. - updated Patch1001.
  174. * Thu May 23 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.41-2
  175. - updated Patch1000: add line for systemd-container.
  176. * Sat Jan 12 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.41-1
  177. - updated and renumbered Patch0 to Patch1000.
  178. - updated and renumbered Patch1 to Patch1001.
  179. - imported Patch1-15 from rawhide.
  180. * Sun Oct 12 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 0.37.1-2
  181. - moved libcgroup to System Environment/Libraries
  182. * Wed Mar 23 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.37.1-1
  183. - initial build for Vine Linux
  184. * Thu Mar 3 2011 Jan Safranek <jsafrane@redhat.com> 0.37.1-1
  185. - Update to 0.37.1
  186. * Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.37-3
  187. - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
  188. * Mon Jan 17 2011 Jan Safranek <jsafrane@redhat.com> 0.37-2
  189. - Create the 'cgred' group as system group, not as user
  190. - Fix cgclassify exit code
  191. * Mon Dec 13 2010 Jan Safranek <jsafrane@redhat.com> 0.37-1
  192. - Update to 0.37
  193. - use /sys/fs/cgroup as default directory to mount control groups (and rely on
  194. systemd mounting tmpfs there)
  195. * Fri Nov 12 2010 Jan Safranek <jsafrane@redhat.com> 0.36.2-3
  196. - Ignore systemd hierarchy - it's now invisible to libcgroup (#627378)
  197. * Mon Aug 2 2010 Jan Safranek <jsafrane@redhat.com> 0.36.2-2
  198. - Fix initscripts to report stopped cgconfig service as not running
  199. (#619091)
  200. * Tue Jun 22 2010 Jan Safranek <jsafrane@redhat.com> 0.36.2-1
  201. - Update to 0.36.2, fixing packaging the libraries (#605434)
  202. - Remove the dependency on redhat-lsb (#603578)
  203. * Fri May 21 2010 Jan Safranek <jsafrane@redhat.com> 0.36-1
  204. - Update to 0.36.1
  205. * Tue Mar 9 2010 Jan Safranek <jsafrane@redhat.com> 0.35-1
  206. - Update to 0.35.1
  207. - Separate pam module to its own subpackage
  208. * Mon Jan 18 2010 Jan Safranek <jsafrane@redhat.com> 0.34-4
  209. - Added README.Fedora to describe initscript integration
  210. * Mon Oct 19 2009 Jan Safranek <jsafrane@redhat.com> 0.34-3
  211. - Change the default configuration to mount everything to /cgroup
  212. * Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.34-2
  213. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  214. * Tue Jul 7 2009 Jan Safranek <jsafrane@redhat.com> 0.34-1
  215. - Update to 0.34
  216. * Mon Mar 09 2009 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.33-3
  217. - Add a workaround for rt cgroup controller.
  218. * Mon Mar 09 2009 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.33-2
  219. - Change the cgconfig script to start earlier
  220. - Move the binaries to /bin and /sbin
  221. * Mon Mar 02 2009 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.33-1
  222. - Update to latest upstream
  223. * Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> 0.32.2-4
  224. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  225. * Mon Jan 05 2009 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.32.2-3
  226. - Fix redhat-lsb dependency
  227. * Mon Dec 29 2008 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.32.2-2
  228. - Fix build dependencies
  229. * Mon Dec 29 2008 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.32.2-1
  230. - Update to latest upstream
  231. * Thu Oct 23 2008 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.32.1-1
  232. * Tue Feb 24 2009 Balbir Singh <balbir@linux.vnet.ibm.com> 0.33-1
  233. - Update to 0.33, spec file changes to add Makefiles and pam_cgroup module
  234. * Fri Oct 10 2008 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.32-1
  235. - Update to latest upstream
  236. * Thu Sep 11 2008 Dhaval Giani <dhaval@linux-vnet.ibm.com> 0.31-1
  237. - Update to latest upstream
  238. * Sat Aug 2 2008 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.1c-3
  239. - Change release to fix broken upgrade path
  240. * Wed Jun 11 2008 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.1c-1
  241. - Update to latest upstream version
  242. * Tue Jun 3 2008 Balbir Singh <balbir@linux.vnet.ibm.com> 0.1b-3
  243. - Add post and postun. Also fix Requires for devel to depend on base n-v-r
  244. * Sat May 31 2008 Balbir Singh <balbir@linux.vnet.ibm.com> 0.1b-2
  245. - Fix makeinstall, Source0 and URL (review comments from Tom)
  246. * Mon May 26 2008 Balbir Singh <balbir@linux.vnet.ibm.com> 0.1b-1
  247. - Add a generatable spec file
  248. * Tue May 20 2008 Balbir Singh <balbir@linux.vnet.ibm.com> 0.1-1
  249. - Get the spec file to work
  250. * Tue May 20 2008 Dhaval Giani <dhaval@linux.vnet.ibm.com> 0.01-1
  251. - The first version of libcg