lxc-vl.spec 13 KB

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