lxc-vl.spec 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  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.3
  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. Patch100: 0002-fix-launching-dnsmasq.patch
  24. BuildRequires: meson
  25. BuildRequires: cmake
  26. BuildRequires: docbook-utils
  27. BuildRequires: docbook2X
  28. BuildRequires: doxygen
  29. BuildRequires: glibc-static
  30. BuildRequires: kernel-headers
  31. BuildRequires: libcap-static
  32. BuildRequires: libseccomp-devel
  33. BuildRequires: libtool
  34. %if %{with lua}
  35. BuildRequires: lua-devel
  36. %endif
  37. BuildRequires: openssl-devel
  38. BuildRequires: pam-devel
  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. %patch100 -p1
  147. %build
  148. %meson \
  149. -D examples=true \
  150. -D man=true \
  151. -D tools=true \
  152. -D commands=true \
  153. -D capabilities=true \
  154. -D openssl=true \
  155. -D apparmor=false \
  156. -D selinux=false \
  157. -D seccomp=true \
  158. -D memfd-rexec=true \
  159. -D thread-safety=true \
  160. -D tests=false \
  161. %if %{with systemd}
  162. -D init-script=systemd \
  163. -D systemd-unitdir=%{_unitdir} \
  164. -D sd-bus=auto \
  165. %else
  166. -D init-script=sysvinit \
  167. -D sd-bus=disabled \
  168. %endif # with_systemd
  169. -D distrosysconfdir=sysconfig \
  170. -D pam-cgroup=true \
  171. -D runtime-path=%{_rundir} \
  172. %{nil}
  173. %meson_build
  174. %install
  175. %meson_install
  176. mkdir -p %{buildroot}/%{_lib}
  177. mv -f %{buildroot}%{_libdir}/security %{buildroot}/%{_lib}/
  178. mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}
  179. %if %{with lua}
  180. chmod -x %{buildroot}%{luapkgdir}/lxc.lua
  181. %endif
  182. rm -rf rpmdoc
  183. mkdir -p rpmdoc
  184. mv -f %{buildroot}%{_docdir}/lxc/examples rpmdoc/
  185. # cache dir
  186. mkdir -p %{buildroot}%{_localstatedir}/cache/%{name}
  187. rm -rf %{buildroot}%{_datadir}/lxc/selinux
  188. find %{buildroot}%{_libdir} -name "*.a" -delete
  189. # install vinelinux template
  190. install -m775 %{SOURCE10} %{buildroot}%{_datadir}/lxc/templates/
  191. install -m775 %{SOURCE11} %{buildroot}%{_datadir}/lxc/config/
  192. install -m775 %{SOURCE12} %{buildroot}%{_datadir}/lxc/config/
  193. %if !%{with systemd}
  194. mkdir -p %{buildroot}%{_initdir}
  195. mv -f %{buildroot}%{_sysconfdir}/init.d/* %{buildroot}%{_initdir}/
  196. chmod 755 %{buildroot}%{_initdir}/*
  197. %endif # with_systemd
  198. %check
  199. %meson_test
  200. %post libs
  201. %if %{with systemd}
  202. %systemd_post %{name}-net.service
  203. %systemd_post %{name}.service
  204. %systemd_post %{name}@.service
  205. %systemd_post %{name}-monitord.service
  206. %else
  207. /sbin/chkconfig --add %{name}-net
  208. /sbin/chkconfig --add %{name}-containers
  209. if [ $1 -gt 1 -a -x %{initdir}/%{name} ]; then
  210. /sbin/service %{name} stop > /dev/null 2>&1
  211. /sbin/chkconfig --del %{name}
  212. fi
  213. %endif # with_systemd
  214. %preun libs
  215. %if %{with systemd}
  216. %systemd_preun %{name}-net.service
  217. %systemd_preun %{name}.service
  218. %systemd_preun %{name}@.service
  219. %systemd_preun %{name}-monitord.service
  220. %else
  221. if [ $1 -eq 0 -o -x /bin/systemctl ]; then
  222. /sbin/service %{name}-containers stop > /dev/null 2>&1
  223. /sbin/service %{name}-net stop > /dev/null 2>&1
  224. /sbin/chkconfig --del %{name}-containers
  225. /sbin/chkconfig --del %{name}-net
  226. fi
  227. %endif # with_systemd
  228. %postun libs
  229. %if %{with systemd}
  230. %systemd_postun %{name}-net.service
  231. %systemd_postun %{name}.service
  232. %systemd_postun %{name}@.service
  233. %systemd_postun %{name}-monitord.service
  234. %else
  235. if [ $1 -ge 1 ]; then
  236. /sbin/service %{name}-container condrestart > /dev/null 2>&1 || :
  237. fi
  238. %endif # with_systemd
  239. %files
  240. %license COPYING LICENSE*
  241. %doc AUTHORS MAINTAINERS README*
  242. %doc rpmdoc/examples
  243. %{_bindir}/%{name}-*
  244. %{_mandir}/man1/%{name}*
  245. %{_mandir}/*/man1/%{name}*
  246. # in lxc-libs:
  247. %exclude %{_bindir}/%{name}-autostart
  248. %exclude %{_mandir}/man1/%{name}-autostart*
  249. %exclude %{_mandir}/*/man1/%{name}-autostart*
  250. %exclude %{_mandir}/man1/%{name}-user-nic*
  251. %exclude %{_mandir}/*/man1/%{name}-user-nic*
  252. %{_datadir}/%{name}/%{name}.functions
  253. %if %{with python3}
  254. %exclude %{_bindir}/%{name}-device
  255. %exclude %{_bindir}/%{name}-ls
  256. %exclude %{_mandir}/man1/%{name}-device*
  257. %exclude %{_mandir}/man1/%{name}-ls*
  258. %exclude %{_mandir}/*/man1/%{name}-device*
  259. %exclude %{_mandir}/*/man1/%{name}-ls*
  260. %endif
  261. %dir %{_datadir}/bash-completion
  262. %dir %{_datadir}/bash-completion/completions
  263. %{_datadir}/bash-completion/completions/*
  264. %files libs
  265. %dir %{_datadir}/%{name}
  266. %dir %{_datadir}/%{name}/templates
  267. %dir %{_datadir}/%{name}/config
  268. %{_datadir}/%{name}/hooks
  269. %{_datadir}/%{name}/%{name}-patch.py*
  270. %{_libdir}/liblxc.so.*
  271. %{_libdir}/%{name}
  272. %{_libexecdir}/%{name}
  273. %{_sbindir}/init.%{name}
  274. %{_sbindir}/init.%{name}.static
  275. %{_bindir}/%{name}-autostart
  276. %{_localstatedir}/lib/%{name}
  277. %dir %{_sysconfdir}/%{name}
  278. %config(noreplace) %{_sysconfdir}/%{name}/default.conf
  279. %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
  280. %{_mandir}/man1/%{name}-autostart*
  281. %{_mandir}/*/man1/%{name}-autostart*
  282. %{_mandir}/man1/%{name}-user-nic*
  283. %{_mandir}/*/man1/%{name}-user-nic*
  284. %{_mandir}/man5/%{name}*
  285. %{_mandir}/man7/%{name}*
  286. %{_mandir}/*/man5/%{name}*
  287. %{_mandir}/*/man7/%{name}*
  288. %{_mandir}/man8/pam_cgfs*
  289. %{_mandir}/*/man8/pam_cgfs*
  290. %if %{with systemd}
  291. %{_unitdir}/*.service
  292. %else
  293. %{_initdir}/*
  294. %endif # with_systemd
  295. %dir %{_localstatedir}/cache/%{name}
  296. /%{_lib}/security/pam_cgfs.so
  297. %if %{with python3}
  298. %files -n python3-%{name}
  299. %{python3_sitearch}/*
  300. %files extra
  301. %{_bindir}/%{name}-device
  302. %{_bindir}/%{name}-ls
  303. %{_mandir}/man1/%{name}-device*
  304. %{_mandir}/man1/%{name}-ls*
  305. %{_mandir}/*/man1/%{name}-device*
  306. %{_mandir}/*/man1/%{name}-ls*
  307. %endif # with_python3
  308. %if %{with lua}
  309. %files -n lua-%{name}
  310. %{lualibdir}/%{name}
  311. %{luapkgdir}/%{name}.lua
  312. %endif
  313. %files templates
  314. %{_datadir}/%{name}/templates/lxc-*
  315. %{_datadir}/%{name}/config/*
  316. %files devel
  317. %{_libdir}/pkgconfig/%{name}.pc
  318. %{_includedir}/lxc
  319. %{_libdir}/liblxc.so
  320. %changelog
  321. * Fri Jul 05 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.3-1
  322. - new upstream release.
  323. * Thu Oct 06 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.1-1
  324. - new upstream release.
  325. * Thu Nov 04 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.0.11-1
  326. - new upstream release.
  327. * Wed May 12 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.0.9-1
  328. - new upstream release.
  329. * Mon Aug 10 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.0.4-1
  330. - new upstream release.
  331. - added systemd support (disabled as default).
  332. * Sat Apr 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.0.0-1
  333. - updated to 4.0.0.
  334. - updated lxc-vinelinux.
  335. * Mon Mar 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.4-1
  336. - updated to 3.0.4.
  337. - disabled cgmanager.
  338. * Tue Apr 09 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.3-2
  339. - updated the Vine Linux template for lxc-3.0.x.
  340. * Fri Jan 11 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.3-1
  341. - updated to 3.0.3.
  342. - updated Patch0.
  343. - updated Patch100.
  344. - disabled lua.
  345. - disabled python.
  346. - added R:libcgroup.
  347. * Wed Aug 30 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.8-2
  348. - enabled cgmanager.
  349. * Tue Aug 29 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.8-1
  350. - updated to 2.0.8.
  351. - updated Patch0.
  352. - dropped Patch1: added an option to get same effect.
  353. * Wed Jun 29 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.1-3
  354. - made lxc-net to be able to disable dnsmasq.
  355. - dropped compat32-lxc-init-static.
  356. * Sun Jun 26 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.1-2
  357. - enabled init.lxc.static for lxc-execute.
  358. * Thu Jun 23 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.1-1
  359. - updated to 2.0.1.
  360. - replaced all patches.
  361. * Tue Nov 17 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.5-2
  362. - enable python3 support by default
  363. * Sun Nov 15 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.5-1
  364. - update vinelinux template
  365. - add vinelinux.{common,userns}.conf
  366. - add patch1 to disable setproctitle error message,
  367. cherry picked from upstream git.
  368. * Sun Nov 15 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.4-1
  369. - update to 1.1.4-1
  370. - add vinelinux template
  371. * Wed Apr 10 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-3
  372. - add patch10 to not fail on failure to link kmsg
  373. * Wed Nov 21 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-2
  374. - update to 0.8.0 release
  375. * Fri May 25 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-1.20120525
  376. - update to git master
  377. * Wed Apr 25 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-0.rc1
  378. - new upstream release
  379. * Thu Jan 26 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.5-1.20120105
  380. - update to git current (20120105)
  381. * Mon Jun 06 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.2-1
  382. - update to 0.7.4.2
  383. * Thu Apr 28 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.1-2
  384. - include all templates
  385. * Wed Apr 27 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.1-1
  386. - initial build for Vine Linux
  387. * Fri Mar 25 2011 Silas Sewell <silas@sewell.ch> - 0.7.4.1-1
  388. - Update to 0.7.4.1
  389. * Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.2-2
  390. - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
  391. * Mon Jul 26 2010 Silas Sewell <silas@sewell.ch> - 0.7.2-1
  392. - Update to 0.7.2
  393. - Remove templates
  394. * Tue Jul 06 2010 Silas Sewell <silas@sewell.ch> - 0.7.1-1
  395. - Update to 0.7.1
  396. * Wed Feb 17 2010 Silas Sewell <silas@sewell.ch> - 0.6.5-1
  397. - Update to latest release
  398. - Add /var/lib/lxc directory
  399. - Patch for sys/stat.h
  400. * Fri Nov 27 2009 Silas Sewell <silas@sewell.ch> - 0.6.4-1
  401. - Update to latest release
  402. - Add documentation sub-package
  403. * Mon Jul 27 2009 Silas Sewell <silas@sewell.ch> - 0.6.3-2
  404. - Apply patch for rawhide kernel
  405. * Sat Jul 25 2009 Silas Sewell <silas@sewell.ch> - 0.6.3-1
  406. - Initial package