lxc-vl.spec 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  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.1
  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.4
  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/%{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. # cache dir
  189. mkdir -p %{buildroot}%{_localstatedir}/cache/%{name}
  190. rm -rf %{buildroot}%{_datadir}/lxc/selinux
  191. # install vinelinux template
  192. install -m775 %{SOURCE10} %{buildroot}%{_datadir}/lxc/templates/
  193. install -m775 %{SOURCE11} %{buildroot}%{_datadir}/lxc/config/
  194. install -m775 %{SOURCE12} %{buildroot}%{_datadir}/lxc/config/
  195. rm -f %{buildroot}%{_libdir}/liblxc.{a,la}
  196. %check
  197. make check
  198. %post libs
  199. /sbin/ldconfig
  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. /sbin/ldconfig
  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/api
  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/%{name}
  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. %doc COPYING LICENSE* AUTHORS MAINTAINERS README*
  311. %doc rpmdoc/api
  312. %changelog
  313. * Mon Aug 10 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.0.4-1
  314. - new upstream release,
  315. - added systemd support (disabled as default).
  316. * Sat Apr 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.0.0-1
  317. - updated to 4.0.0.
  318. - updated lxc-vinelinux.
  319. * Mon Mar 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.4-1
  320. - updated to 3.0.4.
  321. - disabled cgmanager.
  322. * Tue Apr 09 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.3-2
  323. - updated the Vine Linux template for lxc-3.0.x.
  324. * Fri Jan 11 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.3-1
  325. - updated to 3.0.3.
  326. - updated Patch0.
  327. - updated Patch100.
  328. - disabled lua.
  329. - disabled python.
  330. - added R:libcgroup.
  331. * Wed Aug 30 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.8-2
  332. - enabled cgmanager.
  333. * Tue Aug 29 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.8-1
  334. - updated to 2.0.8.
  335. - updated Patch0.
  336. - dropped Patch1: added an option to get same effect.
  337. * Wed Jun 29 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.1-3
  338. - made lxc-net to be able to disable dnsmasq.
  339. - dropped compat32-lxc-init-static.
  340. * Sun Jun 26 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.1-2
  341. - enabled init.lxc.static for lxc-execute.
  342. * Thu Jun 23 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.1-1
  343. - updated to 2.0.1.
  344. - replaced all patches.
  345. * Tue Nov 17 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.5-2
  346. - enable python3 support by default
  347. * Sun Nov 15 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.5-1
  348. - update vinelinux template
  349. - add vinelinux.{common,userns}.conf
  350. - add patch1 to disable setproctitle error message,
  351. cherry picked from upstream git.
  352. * Sun Nov 15 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.4-1
  353. - update to 1.1.4-1
  354. - add vinelinux template
  355. * Wed Apr 10 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-3
  356. - add patch10 to not fail on failure to link kmsg
  357. * Wed Nov 21 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-2
  358. - update to 0.8.0 release
  359. * Fri May 25 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-1.20120525
  360. - update to git master
  361. * Wed Apr 25 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-0.rc1
  362. - new upstream release
  363. * Thu Jan 26 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.5-1.20120105
  364. - update to git current (20120105)
  365. * Mon Jun 06 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.2-1
  366. - update to 0.7.4.2
  367. * Thu Apr 28 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.1-2
  368. - include all templates
  369. * Wed Apr 27 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.1-1
  370. - initial build for Vine Linux
  371. * Fri Mar 25 2011 Silas Sewell <silas@sewell.ch> - 0.7.4.1-1
  372. - Update to 0.7.4.1
  373. * Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.2-2
  374. - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
  375. * Mon Jul 26 2010 Silas Sewell <silas@sewell.ch> - 0.7.2-1
  376. - Update to 0.7.2
  377. - Remove templates
  378. * Tue Jul 06 2010 Silas Sewell <silas@sewell.ch> - 0.7.1-1
  379. - Update to 0.7.1
  380. * Wed Feb 17 2010 Silas Sewell <silas@sewell.ch> - 0.6.5-1
  381. - Update to latest release
  382. - Add /var/lib/lxc directory
  383. - Patch for sys/stat.h
  384. * Fri Nov 27 2009 Silas Sewell <silas@sewell.ch> - 0.6.4-1
  385. - Update to latest release
  386. - Add documentation sub-package
  387. * Mon Jul 27 2009 Silas Sewell <silas@sewell.ch> - 0.6.3-2
  388. - Apply patch for rawhide kernel
  389. * Sat Jul 25 2009 Silas Sewell <silas@sewell.ch> - 0.6.3-1
  390. - Initial package