lxc-vl.spec 13 KB

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