lxc-vl.spec 13 KB

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