lxc-vl.spec 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. %bcond_with systemd
  2. %bcond_with python3
  3. %bcond_with lua
  4. %global luaver 5.4
  5. %global lualibdir %{_libdir}/lua/%{luaver}
  6. %global luapkgdir %{_datadir}/lua/%{luaver}
  7. %define _unpackaged_files_terminate_build 1
  8. Name: lxc
  9. Version: 5.0.1
  10. Release: 1%{?_dist_release}%{?with_systemd:.systemd}
  11. Summary: Linux Resource Containers
  12. Summary(ja): Linux リソースコンテナ
  13. Group: virtualization
  14. License: LGPLv2+ and GPLv2
  15. URL: https://linuxcontainers.org/
  16. Vendor: Project Vine
  17. Distribution: Vine Linux
  18. Source0: https://linuxcontainers.org/downloads/lxc/%{name}-%{version}.tar.gz
  19. Source10: lxc-vinelinux
  20. Source11: vinelinux.common.conf
  21. Source12: vinelinux.userns.conf
  22. Patch0: 0001-fix-initscript.patch
  23. # https://github.com/lxc/lxc/commit/d83051ea6a0df1dbaa255be1291b739f3a2f7f09
  24. Patch1: lxc-glibc-2.36.patch
  25. Patch100: 0002-fix-launching-dnsmasq.patch
  26. BuildRequires: meson
  27. BuildRequires: cmake
  28. BuildRequires: docbook-utils
  29. BuildRequires: docbook2X
  30. BuildRequires: doxygen
  31. BuildRequires: glibc-static
  32. BuildRequires: kernel-headers
  33. BuildRequires: libcap-static
  34. BuildRequires: libseccomp-devel
  35. BuildRequires: libtool
  36. %if %{with lua}
  37. BuildRequires: lua-devel
  38. %endif
  39. BuildRequires: perl-XML-SAX
  40. %if %{with python3}
  41. BuildRequires: python3-devel >= 3.2
  42. BuildRequires: python3-rpm-macros
  43. %endif # with_python3
  44. %if %{with systemd}
  45. BuildRequires: systemd-devel
  46. %endif # with_systemd
  47. # for lxc-top
  48. %if %{with lua}
  49. Requires: lua-%{name}%{?_isa} = %{version}-%{release}
  50. Requires: lua-alt-getopt
  51. %endif
  52. %if !%{with systemd}
  53. Requires: libcgroup
  54. %endif
  55. Obsoletes: lxc-extra < 3.0.0
  56. Obsoletes: lxc-lua < 3.0.0
  57. Obsoletes: python3-lxc < 3.0.0
  58. Obsoletes: lxc-doc < 5.0.0
  59. %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
  60. %description
  61. Linux Resource Containers provide process and resource isolation without the
  62. overhead of full virtualization.
  63. %package libs
  64. Summary: Runtime library files for %{name}
  65. Summary(ja): %{name}のランタイムライブラリ
  66. Group: virtualization
  67. %if %{with systemd}
  68. Requires(post): systemd
  69. Requires(preun): systemd
  70. Requires(postun): systemd
  71. %else
  72. Requires(post): chkconfig
  73. Requires(preun): initscripts, chkconfig
  74. Requires(postun): initscripts
  75. %endif # with_systemd
  76. Obsoletes: compat32-lxc-init-static.32bit < 2.0.1-3
  77. %description libs
  78. Linux Resource Containers provide process and resource isolation without the
  79. overhead of full virtualization.
  80. The %{name}-libs package contains libraries for running %{name} applications.
  81. %if %{with python3}
  82. %package -n python3-%{name}
  83. Summary: Python binding for %{name}
  84. Summary(ja): %{name} の Python バインディング
  85. Group: programming
  86. %description -n python3-%{name}
  87. Linux Resource Containers provide process and resource isolation without the
  88. overhead of full virtualization.
  89. The python3-%{name} package contains the Python3 binding for %{name}.
  90. %global __provides_exclude %{?__provides_exclude:%__provides_exclude|}_lxc\\..*\\.so
  91. %package extra
  92. Summary: Extra tools for %{name}
  93. Summary(ja): %{name} の追加ツール
  94. Group: virtualization
  95. Requires: python3-%{name} = %{version}-%{release}
  96. %description extra
  97. Linux Resource Containers provide process and resource isolation without the
  98. overhead of full virtualization.
  99. This package contains tools needing the Python3 bindings.
  100. %endif # with_python3
  101. %if %{with lua}
  102. %package -n lua-%{name}
  103. Summary: Lua binding for %{name}
  104. Summary(ja): %{name} の Lua バインディング
  105. Group: programming
  106. %description -n lua-%{name}
  107. Linux Resource Containers provide process and resource isolation without the
  108. overhead of full virtualization.
  109. The lua-%{name} package contains the Lua binding for %{name}.
  110. %endif
  111. %global __provides_exclude %{?__provides_exclude:%__provides_exclude|}core\\.so\\.0
  112. %package templates
  113. Summary: Templates for %{name}
  114. Summary(ja): %{name} のテンプレート
  115. Group: virtualization
  116. Requires: %{name}-libs%{?_isa} = %{version}-%{release}
  117. # Note: Requirements for the template scripts (busybox, dpkg,
  118. # debootstrap, vbootstrap, rsync, openssh-server, dhclient, apt, pacman, zypper,
  119. # ubuntu-cloudimg-query etc...) are not explicitly mentioned here:
  120. # their presence varies wildly on supported Fedora/EPEL releases and
  121. # archs, and they are in most cases needed for a single template
  122. # only. Also, the templates normally fail graciously when such a tool
  123. # is missing. Moving each template to its own subpackage on the other
  124. # hand would be overkill.
  125. %description templates
  126. Linux Resource Containers provide process and resource isolation without the
  127. overhead of full virtualization.
  128. The %{name}-templates package contains templates for creating containers.
  129. %package devel
  130. Summary: Development files for %{name}
  131. Summary(ja): %{name}の開発ファイル
  132. Group: programming
  133. Requires: %{name}-libs%{?_isa} = %{version}-%{release}
  134. Requires: pkgconfig
  135. %description devel
  136. Linux Resource Containers provide process and resource isolation without the
  137. overhead of full virtualization.
  138. The %{name}-devel package contains libraries and header files for
  139. developing applications that use %{name}.
  140. %debug_package
  141. %prep
  142. %setup -q -n %{name}-%{version}
  143. %if !%{with systemd}
  144. %patch0 -p1
  145. %endif
  146. %patch1 -p1
  147. %patch100 -p1
  148. %build
  149. %meson \
  150. -Dapparmor=false \
  151. -Dselinux=false \
  152. %if %{with systemd}
  153. -Dinit-script=systemd \
  154. %else
  155. -Dinit-script=sysvinit \
  156. -Dsd-bus=disabled \
  157. %endif # with_systemd
  158. %{nil}
  159. %meson_build
  160. %install
  161. %meson_install
  162. mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}
  163. %if %{with lua}
  164. chmod -x %{buildroot}%{luapkgdir}/lxc.lua
  165. %endif
  166. rm -rf rpmdoc
  167. mkdir -p rpmdoc
  168. mv -f %{buildroot}%{_docdir}/lxc/examples rpmdoc/
  169. # cache dir
  170. mkdir -p %{buildroot}%{_localstatedir}/cache/%{name}
  171. rm -rf %{buildroot}%{_datadir}/lxc/selinux
  172. find %{buildroot}%{_libdir} -name "*.a" -delete
  173. # install vinelinux template
  174. install -m775 %{SOURCE10} %{buildroot}%{_datadir}/lxc/templates/
  175. install -m775 %{SOURCE11} %{buildroot}%{_datadir}/lxc/config/
  176. install -m775 %{SOURCE12} %{buildroot}%{_datadir}/lxc/config/
  177. %if !%{with systemd}
  178. mkdir -p %{buildroot}%{_initdir}
  179. mv -f %{buildroot}%{_sysconfdir}/init.d/* %{buildroot}%{_initdir}/
  180. chmod 755 %{buildroot}%{_initdir}/*
  181. %endif # with_systemd
  182. %check
  183. %meson_test
  184. %post libs
  185. %if %{with systemd}
  186. %systemd_post %{name}-net.service
  187. %systemd_post %{name}.service
  188. %systemd_post %{name}@.service
  189. %systemd_post %{name}-monitord.service
  190. %else
  191. /sbin/chkconfig --add %{name}-net
  192. /sbin/chkconfig --add %{name}-containers
  193. if [ $1 -gt 1 -a -x %{initdir}/%{name} ]; then
  194. /sbin/service %{name} stop > /dev/null 2>&1
  195. /sbin/chkconfig --del %{name}
  196. fi
  197. %endif # with_systemd
  198. %preun libs
  199. %if %{with systemd}
  200. %systemd_preun %{name}-net.service
  201. %systemd_preun %{name}.service
  202. %systemd_preun %{name}@.service
  203. %systemd_preun %{name}-monitord.service
  204. %else
  205. if [ $1 -eq 0 -o -x /bin/systemctl ]; then
  206. /sbin/service %{name}-containers stop > /dev/null 2>&1
  207. /sbin/service %{name}-net stop > /dev/null 2>&1
  208. /sbin/chkconfig --del %{name}-containers
  209. /sbin/chkconfig --del %{name}-net
  210. fi
  211. %endif # with_systemd
  212. %postun libs
  213. %if %{with systemd}
  214. %systemd_postun %{name}-net.service
  215. %systemd_postun %{name}.service
  216. %systemd_postun %{name}@.service
  217. %systemd_postun %{name}-monitord.service
  218. %else
  219. if [ $1 -ge 1 ]; then
  220. /sbin/service %{name}-container condrestart > /dev/null 2>&1 || :
  221. fi
  222. %endif # with_systemd
  223. %files
  224. %license COPYING LICENSE*
  225. %doc AUTHORS MAINTAINERS README*
  226. %doc rpmdoc/examples
  227. %{_bindir}/%{name}-*
  228. %{_mandir}/man1/%{name}*
  229. %{_mandir}/*/man1/%{name}*
  230. # in lxc-libs:
  231. %exclude %{_bindir}/%{name}-autostart
  232. %exclude %{_mandir}/man1/%{name}-autostart*
  233. %exclude %{_mandir}/*/man1/%{name}-autostart*
  234. %exclude %{_mandir}/man1/%{name}-user-nic*
  235. %exclude %{_mandir}/*/man1/%{name}-user-nic*
  236. %{_datadir}/%{name}/%{name}.functions
  237. %if %{with python3}
  238. %exclude %{_bindir}/%{name}-device
  239. %exclude %{_bindir}/%{name}-ls
  240. %exclude %{_mandir}/man1/%{name}-device*
  241. %exclude %{_mandir}/man1/%{name}-ls*
  242. %exclude %{_mandir}/*/man1/%{name}-device*
  243. %exclude %{_mandir}/*/man1/%{name}-ls*
  244. %endif
  245. %dir %{_datadir}/bash-completion
  246. %dir %{_datadir}/bash-completion/completions
  247. %{_datadir}/bash-completion/completions/*
  248. %files libs
  249. %dir %{_datadir}/%{name}
  250. %dir %{_datadir}/%{name}/templates
  251. %dir %{_datadir}/%{name}/config
  252. %{_datadir}/%{name}/hooks
  253. %{_datadir}/%{name}/%{name}-patch.py*
  254. %{_libdir}/liblxc.so.*
  255. %{_libdir}/%{name}
  256. %{_libexecdir}/%{name}
  257. %{_sbindir}/init.%{name}
  258. %{_sbindir}/init.%{name}.static
  259. %{_bindir}/%{name}-autostart
  260. %{_localstatedir}/lib/%{name}
  261. %dir %{_sysconfdir}/%{name}
  262. %config(noreplace) %{_sysconfdir}/%{name}/default.conf
  263. %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
  264. %{_mandir}/man1/%{name}-autostart*
  265. %{_mandir}/*/man1/%{name}-autostart*
  266. %{_mandir}/man1/%{name}-user-nic*
  267. %{_mandir}/*/man1/%{name}-user-nic*
  268. %{_mandir}/man5/%{name}*
  269. %{_mandir}/man7/%{name}*
  270. %{_mandir}/*/man5/%{name}*
  271. %{_mandir}/*/man7/%{name}*
  272. %if %{with systemd}
  273. %{_unitdir}/*.service
  274. %else
  275. %{_initdir}/*
  276. %endif # with_systemd
  277. %dir %{_localstatedir}/cache/%{name}
  278. %if %{with python3}
  279. %files -n python3-%{name}
  280. %{python3_sitearch}/*
  281. %files extra
  282. %{_bindir}/%{name}-device
  283. %{_bindir}/%{name}-ls
  284. %{_mandir}/man1/%{name}-device*
  285. %{_mandir}/man1/%{name}-ls*
  286. %{_mandir}/*/man1/%{name}-device*
  287. %{_mandir}/*/man1/%{name}-ls*
  288. %endif # with_python3
  289. %if %{with lua}
  290. %files -n lua-%{name}
  291. %{lualibdir}/%{name}
  292. %{luapkgdir}/%{name}.lua
  293. %endif
  294. %files templates
  295. %{_datadir}/%{name}/templates/lxc-*
  296. %{_datadir}/%{name}/config/*
  297. %files devel
  298. %{_libdir}/pkgconfig/%{name}.pc
  299. %{_includedir}/lxc
  300. %{_libdir}/liblxc.so
  301. %changelog
  302. * Thu Oct 06 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.1-1
  303. - new upstream release.
  304. * Thu Nov 04 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.0.11-1
  305. - new upstream release.
  306. * Wed May 12 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.0.9-1
  307. - new upstream release.
  308. * Mon Aug 10 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.0.4-1
  309. - new upstream release.
  310. - added systemd support (disabled as default).
  311. * Sat Apr 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.0.0-1
  312. - updated to 4.0.0.
  313. - updated lxc-vinelinux.
  314. * Mon Mar 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.4-1
  315. - updated to 3.0.4.
  316. - disabled cgmanager.
  317. * Tue Apr 09 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.3-2
  318. - updated the Vine Linux template for lxc-3.0.x.
  319. * Fri Jan 11 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.3-1
  320. - updated to 3.0.3.
  321. - updated Patch0.
  322. - updated Patch100.
  323. - disabled lua.
  324. - disabled python.
  325. - added R:libcgroup.
  326. * Wed Aug 30 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.8-2
  327. - enabled cgmanager.
  328. * Tue Aug 29 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.8-1
  329. - updated to 2.0.8.
  330. - updated Patch0.
  331. - dropped Patch1: added an option to get same effect.
  332. * Wed Jun 29 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.1-3
  333. - made lxc-net to be able to disable dnsmasq.
  334. - dropped compat32-lxc-init-static.
  335. * Sun Jun 26 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.1-2
  336. - enabled init.lxc.static for lxc-execute.
  337. * Thu Jun 23 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.1-1
  338. - updated to 2.0.1.
  339. - replaced all patches.
  340. * Tue Nov 17 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.5-2
  341. - enable python3 support by default
  342. * Sun Nov 15 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.5-1
  343. - update vinelinux template
  344. - add vinelinux.{common,userns}.conf
  345. - add patch1 to disable setproctitle error message,
  346. cherry picked from upstream git.
  347. * Sun Nov 15 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.4-1
  348. - update to 1.1.4-1
  349. - add vinelinux template
  350. * Wed Apr 10 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-3
  351. - add patch10 to not fail on failure to link kmsg
  352. * Wed Nov 21 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-2
  353. - update to 0.8.0 release
  354. * Fri May 25 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-1.20120525
  355. - update to git master
  356. * Wed Apr 25 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-0.rc1
  357. - new upstream release
  358. * Thu Jan 26 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.5-1.20120105
  359. - update to git current (20120105)
  360. * Mon Jun 06 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.2-1
  361. - update to 0.7.4.2
  362. * Thu Apr 28 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.1-2
  363. - include all templates
  364. * Wed Apr 27 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.1-1
  365. - initial build for Vine Linux
  366. * Fri Mar 25 2011 Silas Sewell <silas@sewell.ch> - 0.7.4.1-1
  367. - Update to 0.7.4.1
  368. * Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.2-2
  369. - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
  370. * Mon Jul 26 2010 Silas Sewell <silas@sewell.ch> - 0.7.2-1
  371. - Update to 0.7.2
  372. - Remove templates
  373. * Tue Jul 06 2010 Silas Sewell <silas@sewell.ch> - 0.7.1-1
  374. - Update to 0.7.1
  375. * Wed Feb 17 2010 Silas Sewell <silas@sewell.ch> - 0.6.5-1
  376. - Update to latest release
  377. - Add /var/lib/lxc directory
  378. - Patch for sys/stat.h
  379. * Fri Nov 27 2009 Silas Sewell <silas@sewell.ch> - 0.6.4-1
  380. - Update to latest release
  381. - Add documentation sub-package
  382. * Mon Jul 27 2009 Silas Sewell <silas@sewell.ch> - 0.6.3-2
  383. - Apply patch for rawhide kernel
  384. * Sat Jul 25 2009 Silas Sewell <silas@sewell.ch> - 0.6.3-1
  385. - Initial package