lxc-vl.spec 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  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.0
  13. Release: 1%{?_dist_release}%{?with_systemd:.systemd}
  14. Summary: Linux Resource Containers
  15. Summary(ja): Linux リソースコンテナ
  16. Group: Applications/System
  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: System Environment/Libraries
  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: System Environment/Libraries
  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: Applications/System
  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: System Environment/Libraries
  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: System Environment/Libraries
  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: Development/Libraries
  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. # intentionally blank line
  177. make %{?_smp_mflags}
  178. %install
  179. %{make_install}
  180. make DESTDIR=%{buildroot} install
  181. mkdir -p %{buildroot}%{_sharedstatedir}/%{name}
  182. %if %{with lua}
  183. chmod -x %{buildroot}%{luapkgdir}/lxc.lua
  184. %endif
  185. mkdir -p %{buildroot}%{_pkgdocdir}
  186. cp -a AUTHORS COPYING README %{buildroot}%{_pkgdocdir}
  187. mkdir -p %{buildroot}%{_pkgdocdir}/api
  188. cp -a doc/api/html/* %{buildroot}%{_pkgdocdir}/api/
  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. /sbin/ldconfig
  201. %if 0%{?with_systemd}
  202. %systemd_post %{name}.service
  203. %else
  204. /sbin/chkconfig --add %{name}
  205. %endif # with_systemd
  206. %preun libs
  207. %if 0%{?with_systemd}
  208. %systemd_preun %{name}.service
  209. %else
  210. if [ $1 -eq 0 ]; then
  211. /sbin/service %{name} stop > /dev/null 2>&1
  212. /sbin/chkconfig --del %{name}
  213. fi
  214. %endif # with_systemd
  215. %postun libs
  216. /sbin/ldconfig
  217. %if 0%{?with_systemd}
  218. %systemd_postun %{name}.service
  219. %else
  220. if [ $1 -ge 1 ]; then
  221. /sbin/service %{name} condrestart > /dev/null 2>&1 || :
  222. fi
  223. %endif # with_systemd
  224. %files
  225. %license COPYING
  226. %doc README*
  227. %{_bindir}/%{name}-*
  228. %{_bindir}/run-coccinelle.sh
  229. %{_mandir}/man1/%{name}*
  230. %{_mandir}/*/man1/%{name}*
  231. # in lxc-libs:
  232. %exclude %{_bindir}/%{name}-autostart
  233. %exclude %{_mandir}/man1/%{name}-autostart*
  234. %exclude %{_mandir}/*/man1/%{name}-autostart*
  235. %exclude %{_mandir}/man1/%{name}-user-nic*
  236. %exclude %{_mandir}/*/man1/%{name}-user-nic*
  237. %{_datadir}/%{name}/%{name}.functions
  238. %if 0%{?with_python3}
  239. %exclude %{_bindir}/%{name}-device
  240. %exclude %{_bindir}/%{name}-ls
  241. %exclude %{_mandir}/man1/%{name}-device*
  242. %exclude %{_mandir}/man1/%{name}-ls*
  243. %exclude %{_mandir}/*/man1/%{name}-device*
  244. %exclude %{_mandir}/*/man1/%{name}-ls*
  245. %endif
  246. %dir %{_sysconfdir}/bash_completion.d/
  247. %{_sysconfdir}/bash_completion.d/%{name}
  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. %{_sharedstatedir}/%{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. %dir %{_pkgdocdir}
  273. %{_pkgdocdir}/AUTHORS
  274. %{_pkgdocdir}/COPYING
  275. %{_pkgdocdir}/README
  276. %if 0%{?with_systemd}
  277. %{_unitdir}/%{name}.service
  278. %else
  279. %{_sysconfdir}/rc.d/init.d/%{name}
  280. %{_sysconfdir}/rc.d/init.d/%{name}-net
  281. %endif # with_systemd
  282. %dir %{_localstatedir}/cache/%{name}
  283. %if 0%{?with_python3}
  284. %files -n python3-%{name}
  285. %{python3_sitearch}/*
  286. %files extra
  287. %{_bindir}/%{name}-device
  288. %{_bindir}/%{name}-ls
  289. %{_mandir}/man1/%{name}-device*
  290. %{_mandir}/man1/%{name}-ls*
  291. %{_mandir}/*/man1/%{name}-device*
  292. %{_mandir}/*/man1/%{name}-ls*
  293. %endif # with_python3
  294. %if %{with lua}
  295. %files -n lua-%{name}
  296. %{lualibdir}/%{name}
  297. %{luapkgdir}/%{name}.lua
  298. %endif
  299. %files templates
  300. %{_datadir}/%{name}/templates/lxc-*
  301. %{_datadir}/%{name}/config/*
  302. %files devel
  303. %{_libdir}/pkgconfig/%{name}.pc
  304. %{_includedir}/lxc
  305. %{_libdir}/liblxc.so
  306. %files doc
  307. %dir %{_pkgdocdir}
  308. # README, AUTHORS and COPYING intentionally duplicated because -doc
  309. # can be installed on its own.
  310. %{_pkgdocdir}/*
  311. %changelog
  312. * Sat Apr 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.0.0-1
  313. - updated to 4.0.0.
  314. - updated lxc-vinelinux.
  315. * Mon Mar 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.4-1
  316. - updated to 3.0.4.
  317. - disabled cgmanager.
  318. * Tue Apr 09 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.3-2
  319. - updated the Vine Linux template for lxc-3.0.x.
  320. * Fri Jan 11 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.3-1
  321. - updated to 3.0.3.
  322. - updated Patch0.
  323. - updated Patch100.
  324. - disabled lua.
  325. - disabled python.
  326. - added R:libcgroup.
  327. * Wed Aug 30 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.8-2
  328. - enabled cgmanager.
  329. * Tue Aug 29 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.8-1
  330. - updated to 2.0.8.
  331. - updated Patch0.
  332. - dropped Patch1: added an option to get same effect.
  333. * Wed Jun 29 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.1-3
  334. - made lxc-net to be able to disable dnsmasq.
  335. - dropped compat32-lxc-init-static.
  336. * Sun Jun 26 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.1-2
  337. - enabled init.lxc.static for lxc-execute.
  338. * Thu Jun 23 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.1-1
  339. - updated to 2.0.1.
  340. - replaced all patches.
  341. * Tue Nov 17 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.5-2
  342. - enable python3 support by default
  343. * Sun Nov 15 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.5-1
  344. - update vinelinux template
  345. - add vinelinux.{common,userns}.conf
  346. - add patch1 to disable setproctitle error message,
  347. cherry picked from upstream git.
  348. * Sun Nov 15 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.4-1
  349. - update to 1.1.4-1
  350. - add vinelinux template
  351. * Wed Apr 10 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-3
  352. - add patch10 to not fail on failure to link kmsg
  353. * Wed Nov 21 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-2
  354. - update to 0.8.0 release
  355. * Fri May 25 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-1.20120525
  356. - update to git master
  357. * Wed Apr 25 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-0.rc1
  358. - new upstream release
  359. * Thu Jan 26 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.5-1.20120105
  360. - update to git current (20120105)
  361. * Mon Jun 06 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.2-1
  362. - update to 0.7.4.2
  363. * Thu Apr 28 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.1-2
  364. - include all templates
  365. * Wed Apr 27 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.1-1
  366. - initial build for Vine Linux
  367. * Fri Mar 25 2011 Silas Sewell <silas@sewell.ch> - 0.7.4.1-1
  368. - Update to 0.7.4.1
  369. * Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.2-2
  370. - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
  371. * Mon Jul 26 2010 Silas Sewell <silas@sewell.ch> - 0.7.2-1
  372. - Update to 0.7.2
  373. - Remove templates
  374. * Tue Jul 06 2010 Silas Sewell <silas@sewell.ch> - 0.7.1-1
  375. - Update to 0.7.1
  376. * Wed Feb 17 2010 Silas Sewell <silas@sewell.ch> - 0.6.5-1
  377. - Update to latest release
  378. - Add /var/lib/lxc directory
  379. - Patch for sys/stat.h
  380. * Fri Nov 27 2009 Silas Sewell <silas@sewell.ch> - 0.6.4-1
  381. - Update to latest release
  382. - Add documentation sub-package
  383. * Mon Jul 27 2009 Silas Sewell <silas@sewell.ch> - 0.6.3-2
  384. - Apply patch for rawhide kernel
  385. * Sat Jul 25 2009 Silas Sewell <silas@sewell.ch> - 0.6.3-1
  386. - Initial package